billaud@geocub.UUCP (Michel BILLAUD) (05/23/91)
I'm looking for a collection of 'Folk Theorems' for
Prolog programs. Four such examples :
1. Two consecutive cuts are redundant
Exemple p :- a,b,!,!,c,d.
is equivalent to : p :- a,b,!,c,d.
2. In a procedure, if the body of the last clause starts with
a cut, just drop it.
Exemple p :- !,a,b.
==> p :- a,b.
3. if a and b are deterministic (produce 0 or 1 solution)
so is the compound goal a,b .
4. If a is deterministic
then you can change the LAST clause of a procedure
like : p :- a,!,b,c,d.
into : p :- a,b,c,d.
Thanks a lot
Michel BILLAUD
--
Michel BILLAUD : billaud@geocub.greco-prog.fr
Departement d'Informatique : ...!decvax!mcvax!inria!geocub!billaud
IUT "A", Universite Bordeaux I :
33405 Talence (FRANCE) : phone: 56.84.57.92 // 56.84.69.22