is encoded in article.tsg as follows:
article :- name(FileName, "article.pl"), open(FileName,write,Stream), sigma_tsg(tsg(i,[i,x,y],[(i -> f(x,y)), (x -> zero), (y -> zero), [(x -> suc(x)), (y -> suc(suc(y)))] ]),Stream), close(Stream).
Predicate article create the parser in article.pl. This parser is called by th e predicate phrase_tsg/2. Here is a run for this example :
bash-2.03$ sicstus SICStus 3.8.3 (sparc-solaris-5.7): Mon May 8 14:25:09 MET DST 2000 Licensed to info.univ-angers.fr | ?- ['article.tsg']. {consulting /home/info/helios/stephan/public_html/Research/GRAMMAIRES/TSG/PROGRAMMATION/SICSTUS/article.tsg...} {consulting /home/info/helios/stephan/public_html/Research/GRAMMAIRES/TSG/PROGRAMMATION/SICSTUS/tsg.pl...} {loading /opt/SICStus-3.8.3/lib/sicstus-3.8.3/library/lists.po...} {module lists imported into user} {loaded /opt/SICStus-3.8.3/lib/sicstus-3.8.3/library/lists.po in module lists, 0 msec 20472 bytes} {consulted /home/info/helios/stephan/public_html/Research/GRAMMAIRES/TSG/PROGRAMMATION/SICSTUS/tsg.pl in module user, 20 msec 32200 bytes} {consulted /home/info/helios/stephan/public_html/Research/GRAMMAIRES/TSG/PROGRAMMATION/SICSTUS/article.tsg in module user, 20 msec 33176 bytes} yes | ?- [article]. {consulting /home/info/helios/stephan/public_html/Research/GRAMMAIRES/TSG/PROGRAMMATION/SICSTUS/article.pl...} {consulted /home/info/helios/stephan/public_html/Research/GRAMMAIRES/TSG/PROGRAMMATION/SICSTUS/article.pl in module user, 10 msec 1448 bytes} yes | ?- article. yes | ?- phrase_tsg(f(suc(zero),suc(suc(zero))),i). yes | ?-The tracing TSG grammars compilor .
:- [tsg_with_trace]. article_with_trace :- name(FileName, "article_with_trace.pl"), open(FileName,write,Stream), sigma_tsg(tsg(i,[i,x,y],[(i -> f(x,y)), (x -> zero), (y -> zero), [(x -> suc(x)), (y -> suc(suc(y)))] ]),Stream), close(Stream).
Predicate article_with_trace create the parser in article_with_trace.pl. This parser is called by the predicate phrase_tsg/3. Here is a run for this example :
bash-2.03$ sicstus SICStus 3.8.3 (sparc-solaris-5.7): Mon May 8 14:25:09 MET DST 2000 Licensed to info.univ-angers.fr | ?- ['article_with_trace.tsg']. {consulting /home/info/helios/stephan/public_html/Research/GRAMMAIRES/TSG/PROGRAMMATION/SICSTUS/article_with_trace.tsg...} {consulting /home/info/helios/stephan/public_html/Research/GRAMMAIRES/TSG/PROGRAMMATION/SICSTUS/tsg_with_trace.pl...} {loading /opt/SICStus-3.8.3/lib/sicstus-3.8.3/library/lists.po...} {module lists imported into user} {loaded /opt/SICStus-3.8.3/lib/sicstus-3.8.3/library/lists.po in module lists, 0 msec 20472 bytes} {Warning: [Axiome] - singleton variables in user:sigma_tsg/2 in lines 11-26} {consulted /home/info/helios/stephan/public_html/Research/GRAMMAIRES/TSG/PROGRAMMATION/SICSTUS/tsg_with_trace.pl in module user, 20 msec 34456 bytes} {consulted /home/info/helios/stephan/public_html/Research/GRAMMAIRES/TSG/PROGRAMMATION/SICSTUS/article_with_trace.tsg in module user, 20 msec 35552 bytes} yes | ?- [article_with_trace]. {consulting /home/info/helios/stephan/public_html/Research/GRAMMAIRES/TSG/PROGRAMMATION/SICSTUS/article_with_trace.pl...} {consulted /home/info/helios/stephan/public_html/Research/GRAMMAIRES/TSG/PROGRAMMATION/SICSTUS/article_with_trace.pl in module user, 10 msec 2448 bytes} yes | ?- phrase_tsg(f(suc(zero),suc(suc(zero))),i,user_output). f((x,0),(y,0)) f(suc((x,1)),(y,0)) f(suc(zero),(y,0)) f(suc(zero),suc(suc((y,1)))) f(suc(zero),suc(suc(zero))) yes | ?-