home *** CD-ROM | disk | FTP | other *** search
Prolog Source | 1990-03-26 | 329 b | 15 lines |
- /*
- Copyright (c) 1986, 90 by Prolog Development Center
- */
- domains
- tree = reference t(val, tree, tree)
- val = string
-
- predicates
- insert(val, tree)
-
- clauses
- insert(ID, t(ID, _, _)) :- !.
- insert(ID, t(ID1, Tree,_)) :- ID<ID1, !, insert(Val, Tree).
- insert(ID, t(_, _, Tree)) :- insert(Val, Tree).