From Mon Sep 20 13:16:53 2004 Date: Mon, 20 Sep 2004 13:16:53 -0400 (EDT) From: Postmaster Subject: Message from mail server Content-Length: 95 Mime-Version: 1.0 Status: RO X-IMAP: 1095687839 7 Delete. This is a system message. --END+PSEUDO-- From pmoura@di.ubi.pt Thu Sep 16 19:02:28 2004 X-Unix-From: pmoura@di.ubi.pt Thu Sep 16 19:02:28 2004 Return-Path: Received: from neve.di.ubi.pt ([193.136.66.4]) by mailhost.sju.edu (8.12.10+Sun/8.12.10) with ESMTP id i8GN237N004917 for ; Thu, 16 Sep 2004 19:02:08 -0400 (EDT) Received: from [217.129.251.194] (to-217-129-251-194.netvisao.pt [217.129.251.194]) (authenticated bits=0) by neve.di.ubi.pt (8.12.8/8.12.5) with ESMTP id i8GN0qam002303 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO); Fri, 17 Sep 2004 00:00:55 +0100 In-Reply-To: <200409162040.i8GKe67O000274@mailhost.sju.edu> References: <200409162040.i8GKe67O000274@mailhost.sju.edu> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Message-Id: Cc: Roger.Scowen@npl.co.uk, MCOVINGT@ai.uga.edu, kbowen@als.com, nakamura@k.dendai.ac.jp, Bart.Demoen@cs.kuleuven.ac.be, mary@amzi.com, mcarro@fi.upm.es, matsc@sics.se, ok@atlas.otago.ac.nz, veronica@cs.sfu.ca, Daniel.Diaz@inria.fr, klaus.daessler@t-online.de, jan@swi.psy.uva.nl, Paulo Moura , Pierre.Deransart@inria.fr, herme@fi.upm.es, eddbali@lifo.univ-orleans.fr, oskar@ifcomputer.co.jp From: Paulo Moura Subject: Re: Technical report on DCGs Date: Thu, 16 Sep 2004 23:58:10 +0100 To: Jonathan Hodgson X-Mailer: Apple Mail (2.619) X-saintjosephs-MailScanner-Information: Please contact the help desk for more information X-saintjosephs-MailScanner: No Viruses Detected Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mailhost.sju.edu id i8GN237N004917 Content-Length: 2293 Status: RO X-Status: $$$T X-UID: 0000000001 On 16/set/2004, at 21:40, Jonathan Hodgson wrote: > In the interests of trying to get a stronger response I am circulating > this to > a larger group than usual. You will find attached a preliminary draft > of a > report on DCGs that Roger Scowen has prepared. WG17 is interested in > knowing how > existing implementations handle the code in the report. A newer > version with > the code in a separate text file should be available very soon. In the > meanwhile > your comments will be gratefully received either by myself or Roger at > Roger.Scowen@npl.co.uk I can expand in the current Logtalk version (2.21.0) all test cases except 15, 25, 26, and 27. I get different results only for the 28 and 31 test cases. Possibly a bug in the expansion of \+/1. I guess I have some hacking to do on the weekend :-) Some additional test cases with the corresponding expansions in Logtalk: p-->!,[a] p(A,B):-!,A=[a|B] p-->[a],!,{fail} p(A,B):-A=[a|C],!,fail,C=B p-->[] p(A,A) p-->[x]->[];q p(A,B):-A=[x|C]->C=B;q(A,B) p-->[a];[b] p(A,B):-A=[a|B];A=[b|B] p-->q;r p(A,B):-q(A,B);r(A,B) p-->{3} p(A,B):-3,A=B p-->[97,98,99];[113] p(A,B):-A=[97,98,99|B];A=[113|B] p-->q;[] p(A,B):-q(A,B);A=B p-->{a},{b},{c} p(A,B):-a,b,c,A=B p-->{q}->[a];[b] p(A,B):-q->A=[a|B];A=[b|B] p-->{q}->[];b p(A,B):-q->A=B;b(A,B) p-->[foo],{write(x)},[bar] p(A,B):-A=[foo|C],write(x),C=[bar|B] p-->[foo],{write(hello)},{nl} p(A,B):-A=[foo|C],write(hello),nl,C=B p-->[foo],{write(hello),nl} p(A,B):-A=[foo|C],write(hello),nl,C=B p,[a,b]-->[foo],{write(hello),nl} p(A,B):-A=[foo|C],write(hello),nl,B=[a,b|C] p(a),[C]-->!,[C,a],q p(a,A,B):-!,A=[C,a|D],q(D,E),B=[C|E] p(A,B),[A,B]-->[A,B] p(A,B,C,D):-C=[A,B|E],D=[A,B|E] a-->b,!;c a(A,B):-b(A,C),!,C=B;c(A,B) Cheers, Paulo ----------------------------------------------------------- Paulo Jorge Lopes de Moura Dep. of Informatics Office 4.3 Ext. 3257 University of Beira Interior Phone: +351 275319700 6201-001 Covilhã Fax: +351 275319891 Portugal ----------------------------------------------------------- From matsc@sics.se Fri Sep 17 05:45:27 2004 X-Unix-From: matsc@sics.se Fri Sep 17 05:45:27 2004 Return-Path: Received: from brev.sics.se (brev.sics.se [193.10.64.200]) by mailhost.sju.edu (8.12.10+Sun/8.12.10) with ESMTP id i8H9jB7N017420 for ; Fri, 17 Sep 2004 05:45:12 -0400 (EDT) Received: from r2d2.sics.se (r2d2.sics.se [193.10.66.198]) by brev.sics.se (8.12.8/8.12.8) with ESMTP id i8H9efQa013198; Fri, 17 Sep 2004 11:40:41 +0200 env-to () env-from (matsc@sics.se) Received: from r2d2.sics.se (matsc@localhost) by r2d2.sics.se (8.11.6/8.9.3) with ESMTP id i8H9efv30765; Fri, 17 Sep 2004 11:40:41 +0200 env-from (matsc@sics.se) Message-Id: <200409170940.i8H9efv30765@r2d2.sics.se> X-Authentication-Warning: r2d2.sics.se: matsc owned process doing -bs To: Paulo Moura cc: Jonathan Hodgson , Roger.Scowen@npl.co.uk, MCOVINGT@ai.uga.edu, kbowen@als.com, nakamura@k.dendai.ac.jp, Bart.Demoen@cs.kuleuven.ac.be, mary@amzi.com, mcarro@fi.upm.es, matsc@sics.se, ok@atlas.otago.ac.nz, veronica@cs.sfu.ca, Daniel.Diaz@inria.fr, klaus.daessler@t-online.de, jan@swi.psy.uva.nl, Pierre.Deransart@inria.fr, herme@fi.upm.es, eddbali@lifo.univ-orleans.fr, oskar@ifcomputer.co.jp In-Reply-To: Message from Paulo Moura of "Thu, 16 Sep 2004 23:58:10 BST." Date: Fri, 17 Sep 2004 11:40:40 +0200 From: Mats Carlsson X-Virus-Scanned: by amavisd-new X-saintjosephs-MailScanner-Information: Please contact the help desk for more information X-saintjosephs-MailScanner: No Viruses Detected Subject: Re: Technical report on DCGs Content-Length: 1543 Status: RO X-Status: $$$T X-UID: 0000000002 > I can expand in the current Logtalk version (2.21.0) all test cases > except 15, 25, 26, and 27. I get different results only for the 28 and > 31 test cases. Possibly a bug in the expansion of \+/1. Some results for SICStus 3.11.2: test cases 15, 25, 26, 27: type error in expansion all other test cases: expanded as expected > Some additional test cases with the corresponding expansions in Logtalk: Corresponding expansions in SICStus: p-->!,[a]. p(A,B):-!,'C'(A,a,B). p-->[a],!,{fail}. p(A,B):-'C'(A,a,B),!,fail. p-->[]. p(A,B):-B=A. p-->[x]->[];q. p(A,B):-'C'(A,x,B)->true;q(A,B). p-->[a];[b]. p(A,B):-'C'(A,a,B);'C'(A,b,B). p-->q;r. p(A,B):-q(A,B);r(A,B). p-->{3}. p(A,B):-3,B=A. p-->[97,98,99];[113]. p(A,B):-'C'(A,97,C),'C'(C,98,D),'C'(D,99,B);'C'(A,113,B). p-->q;[]. p(A,B):-q(A,B);B=A. p-->{a},{b},{c}. p(A,B):-(a,b,c),B=A. p-->{q}->[a];[b]. p(A,B):-q->'C'(A,a,B);'C'(A,b,B). p-->{q}->[];b. p(A,B):-q->B=A;b(A,B). p-->[foo],{write(x)},[bar]. p(A,B):-'C'(A,foo,C),write(x),'C'(C,bar,B). p-->[foo],{write(hello)},{nl}. p(A,B):-'C'(A,foo,B),write(hello),nl. p-->[foo],{write(hello),nl}. p(A,B):-'C'(A,foo,B),write(hello),nl. p,[a,b]-->[foo],{write(hello),nl}. p(A,B):-('C'(A,foo,C),write(hello),nl),'C'(B,a,D),'C'(D,b,C). p(a),[C]-->!,[C,a],q. p(a,A,B):-(!,('C'(A,C,D),'C'(D,a,E)),q(E,F)),'C'(B,C,F). p(A,B),[A,B]-->[A,B]. p(A,B,C,D):-('C'(C,A,E),'C'(E,B,F)),'C'(D,A,G),'C'(G,B,F). a-->b,!;c. a(A,B):-b(A,B),!;c(A,B). --Mats From pmoura@di.ubi.pt Sat Sep 18 10:00:55 2004 X-Unix-From: pmoura@di.ubi.pt Sat Sep 18 10:00:55 2004 Return-Path: Received: from neve.di.ubi.pt ([193.136.66.4]) by mailhost.sju.edu (8.12.10+Sun/8.12.10) with ESMTP id i8IE0c7N001565 for ; Sat, 18 Sep 2004 10:00:39 -0400 (EDT) Received: from [192.168.2.101] (to-217-129-250-27.netvisao.pt [217.129.250.27]) (authenticated bits=0) by neve.di.ubi.pt (8.12.8/8.12.5) with ESMTP id i8IE0aam021723 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO); Sat, 18 Sep 2004 15:00:37 +0100 In-Reply-To: <200409162040.i8GKe67O000274@mailhost.sju.edu> References: <200409162040.i8GKe67O000274@mailhost.sju.edu> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: Cc: Roger.Scowen@npl.co.uk, MCOVINGT@ai.uga.edu, kbowen@als.com, nakamura@k.dendai.ac.jp, Bart.Demoen@cs.kuleuven.ac.be, mary@amzi.com, mcarro@fi.upm.es, matsc@sics.se, ok@atlas.otago.ac.nz, veronica@cs.sfu.ca, Daniel.Diaz@inria.fr, klaus.daessler@t-online.de, jan@swi.psy.uva.nl, Paulo Moura , Pierre.Deransart@inria.fr, herme@fi.upm.es, eddbali@lifo.univ-orleans.fr, oskar@ifcomputer.co.jp From: Paulo Moura Subject: YAP 4.5.3 CVS results (Re: Technical report on DCGs) Date: Sat, 18 Sep 2004 14:57:48 +0100 To: Jonathan Hodgson X-Mailer: Apple Mail (2.619) X-saintjosephs-MailScanner-Information: Please contact the help desk for more information X-saintjosephs-MailScanner: No Viruses Detected Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mailhost.sju.edu id i8IE0c7N001565 Content-Length: 6291 Status: RO X-Status: $$$T X-UID: 0000000003 On 16/set/2004, at 21:40, Jonathan Hodgson wrote: > In the interests of trying to get a stronger response I am circulating > this to > a larger group than usual. You will find attached a preliminary draft > of a > report on DCGs that Roger Scowen has prepared. WG17 is interested in > knowing how > existing implementations handle the code in the report. A newer > version with > the code in a separate text file should be available very soon. In the > meanwhile > your comments will be gratefully received either by myself or Roger at > Roger.Scowen@npl.co.uk Below are the results for the current CVS version of YAP 4.5.3. Some notes on the code provided: 1. I have to change the clause for the predicate check_grammar_rule_clauses/1 on file r382check.pl to: check_grammar_rule_clauses(N) :- clause(a(N, S0, S1), ET), expand((a(N) --> B), (a(N, S0, S1) :- EB)), ( EB = ET -> write_list([nl, ' ok - a(', N, ')']) ; write_list([nl, ' fail- ', a(N), ' --> ', B]), write_list([nl, ' expected:', a(N, S0, S1), ' :- ', EB]), write_list([nl, ' expanded:', ET]) ), fail. This modification still does not solve the problem with results for the cases 19 and 20 below, which should be "ok" instead of "fail". The DCG parser and expander of Logtalk defines a predicate which could solve this problem: % '$lgt_dcg_simplify_and'(+goal, -goal) % % removes redundant calls to true/0 and flats a conjunction of goals '$lgt_dcg_simplify_and'((Goal1 -> Goal2), (SGoal1 -> SGoal2)) :- !, '$lgt_dcg_simplify_and'(Goal1, SGoal1), '$lgt_dcg_simplify_and'(Goal2, SGoal2). '$lgt_dcg_simplify_and'((Goal1;Goal2), (SGoal1;SGoal2)) :- !, '$lgt_dcg_simplify_and'(Goal1, SGoal1), '$lgt_dcg_simplify_and'(Goal2, SGoal2). '$lgt_dcg_simplify_and'(((Goal1,Goal2),Goal3), Body) :- !, '$lgt_dcg_simplify_and'((Goal1,(Goal2,Goal3)), Body). '$lgt_dcg_simplify_and'((true,Goal), Body) :- !, '$lgt_dcg_simplify_and'(Goal, Body). '$lgt_dcg_simplify_and'((Goal,true), Body) :- !, '$lgt_dcg_simplify_and'(Goal, Body). '$lgt_dcg_simplify_and'((Goal1,Goal2), (Goal1,Goal3)) :- !, '$lgt_dcg_simplify_and'(Goal2, Goal3). '$lgt_dcg_simplify_and'(Goal, Goal). 2. The instructions at the beggining at both files r382.pl and r382check.pl should say "reconsult" instead of "consult" as some Prolog (such as YAP) support both ways of loading files. Doing a consult instead of a reconsult results in duplicated clauses for some of the utility predicates, leading to bugs at runtime. Checking Grammar Rules in system yap453 using system yap453 (1) - Does expand_term/3 work as expected? ok - expanding a(1)-->b ok - expanding a(2)-->[b] fail- expanding a(3)-->[] correct = a(3,_74,_75):-_75=_74 wrong = a(3,_67,_67) ok - expanding a(4)-->[98] ok - expanding a(5)-->{b} ok - expanding a(6)-->b,c ok - expanding a(7)-->b;c ok - expanding a(8)-->b->c ok - expanding a(9)-->b1,b2->c;d ok - expanding a(10)-->b->c1,c2;d ok - expanding a(11)-->b->c;d1,d2 ok - expanding a(12)-->b,!,c,d ok - expanding a(13)-->b,!,c;d ok - expanding a(14)-->[abc,xyz] ok - expanding a(15)-->[abc|xyz] ok - expanding a(16)-->[_104] ok - expanding a(17)-->[[],{},3,3.2,a(b)] ok - expanding a(18)-->_107 fail- expanding a(19)-->{c,d} correct = a(19,_139,_140):-(c,d),_140=_139 wrong = a(19,_123,_124):-c,d,_124=_123 fail- expanding a(20)-->{c,d} correct = a(20,_142,_143):-(c,d),_143=_142 wrong = a(20,_126,_127):-c,d,_127=_126 ?? - expanding a(21),[t]-->b,c ?? - expanding a(22),[t]-->b,[t] ?? - expanding a(23),[t]-->b,[s,t] ?? - expanding a(24),[t]-->b,[s],[t] ?? - expanding a(25),[t],[t2]-->b,c ?? - expanding a(26),b-->c fail- expanding [b],a(27)-->c correct = .(b,[],_158,_159):-c(_158,_165),a(27,_159,_165) wrong = [b],a(27)-->c fail- expanding a(28)--> \+b,c correct = a(28,_167,_168):-(b(_167,_180)->fail;_182=_167),c(_182,_168) wrong = a(28,_150,_151):- \+(b,_150,_158),c(_158,_151) ok - expanding a(29)-->true,c ok - expanding a(30)-->false,c fail- expanding a(31)-->b,\+c,d correct = a(31,_185,_186):-b(_185,_192),(c(_192,_204)->fail; _206=_192),d(_206,_186) wrong = a(31,_162,_163):-b(_162,_169),\+(c,_169,_176),d(_176,_163) ok - expanding a(32,_152)-->call(_152),c ok - expanding [-->b,c ok - expanding = -->b,c ok - expanding c(_157)-->b(_157) not tested - expanding a(21),[t]-->b,c not tested - expanding a(22),[t]-->b,[t] not tested - expanding a(23),[t]-->b,[s,t] not tested - expanding a(24),[t]-->b,[s],[t] not tested - expanding a(25),[t],[t2]-->b,c not tested - expanding a(26),b-->c (2a) - The following procedures exist in the system C/3 - [built_in] term_expansion/2 - [] expand_term/2 - [built_in] phrase/2 - [built_in] phrase/3 - [built_in] (2b) - The following procedures do not exist in the system (3) - Are grammar rule clauses consistent with expand_term/3? ok - a(1) ok - a(2) fail- a(3) --> [] expected:a(3,_49,_49) :- _49=_49 expanded:true ok - a(4) ok - a(5) ok - a(6) ok - a(7) ok - a(8) ok - a(9) ok - a(10) ok - a(11) ok - a(12) ok - a(13) ok - a(14) ok - a(15) ok - a(16) ok - a(17) ok - a(18) fail- a(19) --> {c,d} expected:a(19,_49,_50) :- (c,d),_50=_49 expanded:c,d,_50=_49 fail- a(20) --> {c,d} expected:a(20,_49,_50) :- (c,d),_50=_49 expanded:c,d,_50=_49 fail- a(28) --> \+b,c expected:a(28,_49,_50) :- (b(_49,_175)->fail;_177=_49),c(_177,_50) expanded:\+(b,_49,_143),c(_143,_50) ok - a(29) ok - a(30) fail- a(31) --> b,\+c,d expected:a(31,_49,_50) :- b(_49,_184),(c(_184,_196)->fail;_198=_184),d(_198,_50) expanded:b(_49,_148),\+(c,_148,_155),d(_155,_50) Cheers, Paulo ----------------------------------------------------------- Paulo Jorge Lopes de Moura Dep. of Informatics Office 4.3 Ext. 3257 University of Beira Interior Phone: +351 275319700 6201-001 Covilhã Fax: +351 275319891 Portugal ----------------------------------------------------------- From herme@fi.upm.es Sat Sep 18 10:29:14 2004 X-Unix-From: herme@fi.upm.es Sat Sep 18 10:29:14 2004 Return-Path: Received: from goofy.fi.upm.es (goofy.fi.upm.es [138.100.8.23]) by mailhost.sju.edu (8.12.10+Sun/8.12.10) with ESMTP id i8IESx7N013224 for ; Sat, 18 Sep 2004 10:29:01 -0400 (EDT) Received: from clip.dia.fi.upm.es (clip.dia.fi.upm.es [138.100.11.74]) by relay.fi.upm.es (PMDF V6.2-X27 #30875) with ESMTPS id <01LF0P8R6O2G000WO4@relay.fi.upm.es> for jhodgson@mailhost.sju.edu; Sat, 18 Sep 2004 16:28:50 +0200 (MET-DST) Received: from clip.dia.fi.upm.es (IDENT:xGxzQirNYR4CevqSRYcIOZXnmvDi+CyP@localhost.localdomain [127.0.0.1]) by clip.dia.fi.upm.es (8.12.8/8.11.6) with ESMTP id i8IESYls021558; Sat, 18 Sep 2004 16:28:34 +0200 Received: (from herme@localhost) by clip.dia.fi.upm.es (8.12.8/8.12.8/Submit) id i8IESXSE021554; Sat, 18 Sep 2004 16:28:33 +0200 Date: Sat, 18 Sep 2004 16:28:33 +0200 From: Manuel Hermenegildo Subject: Re: Technical report on DCGs In-reply-to: <200409162040.i8GKe67O000274@mailhost.sju.edu> To: jhodgson@mailhost.sju.edu Cc: matsc@sics.se, MCOVINGT@ai.uga.edu, Pierre.Deransart@inria.fr, nakamura@k.dendai.ac.jp, eddbali@lifo.univ-orleans.fr, Roger.Scowen@npl.co.uk, mcarro@fi.upm.es, oskar@ifcomputer.co.jp, jan@swi.psy.uva.nl, Bart.Demoen@cs.kuleuven.ac.be, pmoura@di.ubi.pt, klaus.daessler@t-online.de, veronica@cs.sfu.ca, ok@atlas.otago.ac.nz, kbowen@als.com, mary@amzi.com, Daniel.Diaz@inria.fr Reply-to: Manuel Hermenegildo Message-id: <200409181428.i8IESXSE021554@clip.dia.fi.upm.es> References: <200409162040.i8GKe67O000274@mailhost.sju.edu> X-saintjosephs-MailScanner-Information: Please contact the help desk for more information X-saintjosephs-MailScanner: No Viruses Detected Content-Length: 3233 Status: RO X-Status: $$$T X-UID: 0000000004 Thanks Jonathan for pushing things and putting together the report! Some results for Ciao-1.10: it seems like mostly everything works except that in 21,22,23,24,25,26,27 literals coming from head tokens are generated in a different order (which is very easy to change, of course). These are the out of order tests: fail- expanding a(21),[t]-->b,c correct = a(21,_402,_403):-(b(_402,_412),c(_412,_415)),C(_403,t,_415) wrong = a(21,_310,_311):-C(_311,t,_318),b(_310,_324),c(_324,_318) fail- expanding a(22),[t]-->b,[t] correct = a(22,_405,_406):-(b(_405,_415),C(_415,t,_419)),C(_406,t,_419) wrong = a(22,_312,_313):-C(_313,t,_320),b(_312,_326),C(_326,t,_320) fail- expanding a(23),[t]-->b,[s,t] correct = a(23,_414,_415):-(b(_414,_424),C(_424,s,_431),C(_431,t,_435)),C(_415,t,_435) wrong = a(23,_314,_315):-C(_315,t,_322),b(_314,_328),C(_328,s,_335),C(_335,t,_322) fail- expanding a(24),[t]-->b,[s],[t] correct = a(24,_417,_418):-(b(_417,_427),C(_427,s,_434),C(_434,t,_438)),C(_418,t,_438) wrong = a(24,_317,_318):-C(_318,t,_325),b(_317,_331),C(_331,s,_338),C(_338,t,_325) fail- expanding a(25),[t],[t2]-->b,c correct = a(25,_414,_415):-(b(_414,_424),c(_424,_427)),C(_415,t,_434),C(_434,t2,_427) wrong = a(25,_315,_316):-(C(_316,t,_326),C(_326,t2,_330)),b(_315,_336),c(_336,_330) fail- expanding a(26),b-->c correct = a(26,_390,_391):-c(_390,_397),b(_391,_397) wrong = a(26,_305,_306):-b(_306,_312),c(_305,_312) fail- expanding [b],a(27)-->c correct = .(b,[],_395,_396):-c(_395,_402),a(27,_396,_402) wrong = .(b,[],_308,_309):-a(27,_309,_316),c(_308,_316) And these are the rest: p-->!,[a]. p(A,B):-!,'C'(A,a,B). p-->[a],!,{fail}. p(A,B):-'C'(A,a,B),!,fail. p-->[]. p(A,B):-B=A. p-->[x]->[];q. p(A,B):-'C'(A,x,B)->true;q(A,B). p-->[a];[b]. p(A,B):-'C'(A,a,B);'C'(A,b,B). p-->q;r. p(A,B):-q(A,B);r(A,B). p-->{3}. p(A,B):-3,B=A. p-->"abc";"q". p(A,B):-'C'(A,97,C),'C'(C,98,D),'C'(D,99,B);'C'(A,113,B). p-->q;[]. p(A,B):-q(A,B);B=A. p-->{a},{b},{c}. p(A,B):-(a,b,c),B=A. p-->{q}->[a];[b]. p(A,B):-q->'C'(A,a,B);'C'(A,b,B). p-->{q}->[];b. p(A,B):-q->B=A;b(A,B). p-->[foo],{write(x)},[bar]. p(A,B):-'C'(A,foo,C),write(x),'C'(C,bar,B). p-->[foo],{write(hello)},{nl}. p(A,B):-'C'(A,foo,B),write(hello),nl. p-->[foo],{write(hello),nl}. p(A,B):-'C'(A,foo,B),write(hello),nl. p,[a,b]-->[foo],{write(hello),nl}. p(A,B):-('C'(B,a,C),'C'(C,b,D)),'C'(A,foo,D),write(hello),nl. p(a),[A]-->!,[A,a],q. p(a,A,B):-'C'(B,A,C),!,('C'(A,A,D),'C'(D,a,E)),q(E,C). p(A,B),[A,B]-->[A,B]. p(A,B,A,B):-('C'(B,A,C),'C'(C,B,D)),'C'(A,A,E),'C'(E,B,D). a-->b,!;c. a(A,B):-b(A,B),!;c(A,B). Cheers, Manuel and the UPMers -- ------------------------------------------------------------------------------- herme@fi.upm.es | Manuel Hermenegildo +34-91-336-7435 (Work) | Facultad de Informatica +34-91-352-4819 or 336-7412 (FAX) | Universidad Politecnica de Madrid http://www.clip.dia.fi.upm.es/~herme | 28660-Boadilla del Monte, MADRID SPAIN ------------------------------------------------------------------------------- From pmoura@di.ubi.pt Sat Sep 18 13:41:43 2004 X-Unix-From: pmoura@di.ubi.pt Sat Sep 18 13:41:43 2004 Return-Path: Received: from neve.di.ubi.pt ([193.136.66.4]) by mailhost.sju.edu (8.12.10+Sun/8.12.10) with ESMTP id i8IHfI7N009106 for ; Sat, 18 Sep 2004 13:41:23 -0400 (EDT) Received: from [217.129.250.27] (to-217-129-250-27.netvisao.pt [217.129.250.27]) (authenticated bits=0) by neve.di.ubi.pt (8.12.8/8.12.5) with ESMTP id i8IHfNam023144 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO); Sat, 18 Sep 2004 18:41:25 +0100 In-Reply-To: <200409162040.i8GKe67O000274@mailhost.sju.edu> References: <200409162040.i8GKe67O000274@mailhost.sju.edu> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Message-Id: <8F3AECD2-0999-11D9-AE7D-003065804322@di.ubi.pt> Cc: Roger.Scowen@npl.co.uk, MCOVINGT@ai.uga.edu, kbowen@als.com, nakamura@k.dendai.ac.jp, Bart.Demoen@cs.kuleuven.ac.be, mary@amzi.com, mcarro@fi.upm.es, matsc@sics.se, ok@atlas.otago.ac.nz, veronica@cs.sfu.ca, Daniel.Diaz@inria.fr, klaus.daessler@t-online.de, jan@swi.psy.uva.nl, Paulo Moura , Pierre.Deransart@inria.fr, herme@fi.upm.es, eddbali@lifo.univ-orleans.fr, oskar@ifcomputer.co.jp From: Paulo Moura Subject: dynamic directives in code (Re: Technical report on DCGs) Date: Sat, 18 Sep 2004 18:38:32 +0100 To: Jonathan Hodgson X-Mailer: Apple Mail (2.619) X-saintjosephs-MailScanner-Information: Please contact the help desk for more information X-saintjosephs-MailScanner: No Viruses Detected Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mailhost.sju.edu id i8IHfI7N009106 Content-Length: 1236 Status: RO X-Status: $$$T X-UID: 0000000005 On 16/set/2004, at 21:40, Jonathan Hodgson wrote: > In the interests of trying to get a stronger response I am circulating > this to > a larger group than usual. You will find attached a preliminary draft > of a > report on DCGs that Roger Scowen has prepared. WG17 is interested in > knowing how > existing implementations handle the code in the report. A newer > version with > the code in a separate text file should be available very soon. In the > meanwhile > your comments will be gratefully received either by myself or Roger at > Roger.Scowen@npl.co.uk As the part I of the ISO standard does not require "dynamic" to be declared as an operator, it might be advisable to update the in file r382.pl to write ":- dynamic(" instead of ":- dynamic (" or ":- dynamic foo/3.". Cheers, Paulo ----------------------------------------------------------- Paulo Jorge Lopes de Moura Dep. of Informatics Office 4.3 Ext. 3257 University of Beira Interior Phone: +351 275319700 6201-001 Covilhã Fax: +351 275319891 Portugal ----------------------------------------------------------- From pmoura@di.ubi.pt Mon Sep 20 11:14:21 2004 X-Unix-From: pmoura@di.ubi.pt Mon Sep 20 11:14:21 2004 Return-Path: Received: from neve.di.ubi.pt ([193.136.66.4]) by mailhost.sju.edu (8.12.10+Sun/8.12.10) with ESMTP id i8KFEF7N027971 for ; Mon, 20 Sep 2004 11:14:16 -0400 (EDT) Received: from [10.0.0.46] ([10.0.0.46]) (authenticated bits=0) by neve.di.ubi.pt (8.12.8/8.12.5) with ESMTP id i8KFH8am017872 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO); Mon, 20 Sep 2004 16:17:08 +0100 Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Message-Id: Cc: Paulo Jorge Lopes de Moura From: Paulo Moura Subject: Some typos on the DCG draft (Annex B) Date: Mon, 20 Sep 2004 16:14:13 +0100 To: Jonathan Hodgson , Roger.Scowen@npl.co.uk X-Mailer: Apple Mail (2.619) X-saintjosephs-MailScanner-Information: Please contact the help desk for more information X-saintjosephs-MailScanner: No Viruses Detected Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mailhost.sju.edu id i8KFEF7N027971 Content-Length: 1155 Status: RO X-Status: $$$T X-UID: 0000000006 Hi! I belief I found some typos on Annex B of the current draft: B.2 Expand a terminal list Where it reads: terminals([], S0, S1) I belief it should be: terminals([], S0, S0) B.4 Expand a body Where it reads: body(‘;’(‘->‘(If, Then), Else), S0, S2) B_if = body(If, S0, S1), B_then = body(Then, S1, S2), B_else = body(Else, S1, S2), B = ‘;’(‘->‘(B_if, B_then), B_else) I belief it should be: body(‘;’(‘->‘(If, Then), Else), S0, S2) B_if = body(If, S0, S1), B_then = body(Then, S1, S2), B_else = body(Else, S0, S2), <----- HERE B = ‘;’(‘->‘(B_if, B_then), B_else) Where it reads: body(','(First, Second), S0, S1) I belief it should be: body(','(First, Second), S0, S2) Cheers, Paulo ----------------------------------------------------------- Paulo Jorge Lopes de Moura Dep. of Informatics Office 4.3 Ext. 3257 University of Beira Interior Phone: +351 275319700 6201-001 Covilhã Fax: +351 275319891 Portugal ----------------------------------------------------------- From pmoura@di.ubi.pt Mon Sep 20 11:44:20 2004 X-Unix-From: pmoura@di.ubi.pt Mon Sep 20 11:44:20 2004 Return-Path: Received: from neve.di.ubi.pt ([193.136.66.4]) by mailhost.sju.edu (8.12.10+Sun/8.12.10) with ESMTP id i8KFi07N005364 for ; Mon, 20 Sep 2004 11:44:01 -0400 (EDT) Received: from [10.0.0.46] ([10.0.0.46]) (authenticated bits=0) by neve.di.ubi.pt (8.12.8/8.12.5) with ESMTP id i8KFiEam018369 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO); Mon, 20 Sep 2004 16:44:14 +0100 In-Reply-To: <20040917143646.GB12973@gollem.swi.psy.uva.nl> References: <200409171405.i8HE5RW02488@r2d2.sics.se> <9CD311D6-08B3-11D9-BB76-000A95DAA580@di.ubi.pt> <20040917143646.GB12973@gollem.swi.psy.uva.nl> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Message-Id: <83F30134-0B1B-11D9-9D04-000A95DAA580@di.ubi.pt> Cc: Roger.Scowen@npl.co.uk, MCOVINGT@ai.uga.edu, kbowen@als.com, nakamura@k.dendai.ac.jp, mary@amzi.com, mcarro@fi.upm.es, jhodgson@mailhost.sju.edu, Bart Demoen , ok@atlas.otago.ac.nz, veronica@cs.sfu.ca, Daniel.Diaz@inria.fr, klaus.daessler@t-online.de, Mats Carlsson , Paulo Moura , Pierre.Deransart@inria.fr, herme@fi.upm.es, eddbali@lifo.univ-orleans.fr, oskar@ifcomputer.co.jp From: Paulo Moura Subject: Re: Technical report on DCGs Date: Mon, 20 Sep 2004 16:41:18 +0100 To: Jan Wielemaker X-Mailer: Apple Mail (2.619) X-saintjosephs-MailScanner-Information: Please contact the help desk for more information X-saintjosephs-MailScanner: No Viruses Detected Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mailhost.sju.edu id i8KFi07N005364 Content-Length: 1425 Status: RO X-Status: $$$T X-UID: 0000000007 On 17/set/2004, at 15:36, Jan Wielemaker wrote: > The more I think about it, the less I like the idea of defining the > expansion itself. In this context the standard document can provide a > reference implementation of the translator, a set of test rules and a > set of queries on the expanded ruleset. If the reference implementation > is covered by a liberal license, implementors can adapt it to their > local system to improve performance, debugging, etc. Maybe the r382check.pl program could be updated to allow multiple, equivalent, expansions. For example, instead of: expand((a(1) --> [b]), (a(1, S0, S1) :- 'C'(S0, b, S1))). we could allow for: expand((a(1) --> [b]), (a(1, S0, S1) :- 'C'(S0, b, S1))). expand((a(1) --> [b]), (a(1, S0, S1) :- S0 = [b| S1])). Similar for the expansion of \+ Goal. This, of course, would imply modifying the predicate check_expand_term/0 to check for "(expand(T, ET), ET = ET1) -> ..." instead of "expand(T, ET) -> ...". Cheers, Paulo ----------------------------------------------------------- Paulo Jorge Lopes de Moura Dep. of Informatics Office 4.3 Ext. 3257 University of Beira Interior Phone: +351 275319700 6201-001 Covilhã Fax: +351 275319891 Portugal -----------------------------------------------------------