home *** CD-ROM | disk | FTP | other *** search
Prolog Source | 1986-10-07 | 460 b | 24 lines |
- /* program 62 */
- /*
- Read section in manual on page 149 for an
- explanation of this program
- */
-
- domains
- tree =reference t(id,val,tree,tree)
- id = symbol
- val = integer
-
- predicates
- lookup(id,val,tree)
-
- clauses
- lookup(ID,VAL,t(ID,VAL,_,_)):- !.
- lookup(ID,VAL,t(IDI,_,TREE,_)):-
- ID<IDI,!,
- lookup(ID,VAL,TREE).
- lookup(ID,VAL,t(_,_,_,TREE)):-
- lookup(ID,VAL,TREE).
-
-
-