Esempio di sessione
leo:~> Terzo
loading /home/stud/catuscia/terzo/bin/.lpsml ......................... done
Terzo lambda-Prolog, Version 1.0b, Built Tue Jul 16 15:52:11 EDT 1996
[reading file /home/stud/catuscia/terzo/lib/terzo.rc]
path /home/stud/catuscia/terzo/lib/ .
[reading file /home/stud/catuscia/terzo/lib/list_util.mod]
GC #0.0.0.0.1.1: (0 ms.)
GC #0.0.0.1.2.16: (10 ms.)
module ListUtil
[closed file /home/stud/catuscia/terzo/lib/list_util.mod]
[reading file /home/stud/catuscia/terzo/doc/SystemModules/maps.mod]
module maps
[closed file /home/stud/catuscia/terzo/doc/SystemModules/maps.mod]
[closed file /home/stud/catuscia/terzo/lib/terzo.rc]
Terzo> #query ListUtil.
?- append L1 L2 (1::2::nil).
L1 = nil
L2 = 1 :: 2 :: nil ;
L1 = 1 :: nil
L2 = 2 :: nil ;
L1 = 1 :: 2 :: nil
L2 = nil ;
no more solutions
?- memb 2 L.
L = 2 :: L1 ;
L = Y :: 2 :: L2 ;
L = Y :: Y1 :: 2 :: L3 ;
L = Y :: Y1 :: Y2 :: 2 :: L4 .
?- member 2 L.
L = 2 :: L1 ;
no more solutions
?- #end.
Terzo> #query maps.
?- mapfun (x\0) (1::2::nil) L.
L = 0 :: 0 :: nil ;
no more solutions
?- mappred (x\y\(y is x + 1)) (1::2::nil) L.
L = 2 :: 3 :: nil ;
no more solutions
?- forevery (x\(x > 0)) (1::2::nil).
solved
?- reduce (x\y\(x + y)) (1::2::3::nil) 0 Z.
Z = 1 + (2 + (3 + 0)) ;
no more solutions
?- reduce (x\y\(x + y)) (1::2::3::nil) 0 Z, W is Z.
Z = 1 + (2 + (3 + 0))
W = 6 ;
no more solutions
?- #end.
Terzo> leo:~>