home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l217 / 2.ddi / EXAMPLES / CH21EX03.PRO < prev    next >
Encoding:
Prolog Source  |  1990-03-26  |  329 b   |  15 lines

  1. /*
  2.    Copyright (c) 1986, 90 by Prolog Development Center
  3. */
  4. domains
  5.    tree = reference t(val, tree, tree)
  6.    val  = string
  7.  
  8. predicates
  9.    insert(val, tree)
  10.  
  11. clauses
  12.    insert(ID, t(ID, _, _)) :- !.
  13.    insert(ID, t(ID1, Tree,_)) :- ID<ID1, !, insert(Val, Tree).
  14.    insert(ID, t(_, _, Tree)) :- insert(Val, Tree).
  15.