Article View: comp.lang.prolog
Article #2245[Prolog] Collection of 'Folk Theorems' wanted !
From: Michel BILLAUD
Date: Thu, 23 May 1991 10:30
Date: Thu, 23 May 1991 10:30
29 lines
1211 bytes
1211 bytes
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
Technical Details
Message-ID:
<3266@geocub.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!mcsun!corton!geocub!billaudShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!mcsun!corton!geocub!billaud From: billaud@geocub.UUCP (Michel BILLAUD) Newsgroups: comp.lang.prolog,comp.theory Subject: [Prolog] Collection of 'Folk Theorems' wanted ! Message-ID: <3266@geocub.UUCP> Date: 23 May 91 10:30:13 GMT Lines: 29