Translate SWI Code Fragment to Sicstus

This is a discussion on Translate SWI Code Fragment to Sicstus within the PROLOG forums in Programming Languages category; I need to translate the following code, that prints out the SLD tree, from SWI-Prolog to Sictsus. It is part of the graphviz.pl file that can be found at : http://www.cs.bris.ac.uk/Teaching/Re...0106/graphviz/ The problem are these two lines when I try to load it in Sicstus 4.0.4: writes(:-A) :- !,write(':-'),writes(A). writes(?-A) :- !,write('?-'),writes(A). Sicstus is telling me: ! Syntax error ! , or ) expected in arguments ! in line 90 ! writes ( :- ! <<here>> ! A ) :- ! , write ( :- ) , writes ( A ) . ! Approximate lines: 89-91, file: '/....../graphviz_sic.pl' ! Syntax ...

Go Back   Application Development Forum > Programming Languages > PROLOG

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 07-14-2008, 09:32 AM
Michael Igler
Guest
 
Default Translate SWI Code Fragment to Sicstus

I need to translate the following code, that prints out the SLD tree,
from SWI-Prolog to Sictsus. It is part of the graphviz.pl file that can
be found at :

http://www.cs.bris.ac.uk/Teaching/Re...0106/graphviz/


The problem are these two lines when I try to load it in Sicstus 4.0.4:

writes(:-A) :- !,write(':-'),writes(A).
writes(?-A) :- !,write('?-'),writes(A).


Sicstus is telling me:

! Syntax error
! , or ) expected in arguments
! in line 90
! writes ( :-
! <<here>>
! A ) :- ! , write ( :- ) , writes ( A ) .
! Approximate lines: 89-91, file: '/....../graphviz_sic.pl'
! Syntax error
! , or ) expected in arguments
! in line 91
! writes ( ?-
! <<here>>
! A ) :- ! , write ( ?- ) , writes ( A ) .

Do I need an escape charcter for the :- so it works and if so, which one
is it?



Thanks,

Michael







Reply With Quote
  #2  
Old 07-14-2008, 11:03 AM
Jan Wielemaker
Guest
 
Default Re: Translate SWI Code Fragment to Sicstus

On 2008-07-14, Michael Igler <michael.igler@web.de> wrote:
> I need to translate the following code, that prints out the SLD tree,
> from SWI-Prolog to Sictsus. It is part of the graphviz.pl file that can
> be found at :
>
> http://www.cs.bris.ac.uk/Teaching/Re...0106/graphviz/
>
>
> The problem are these two lines when I try to load it in Sicstus 4.0.4:
>
> writes(:-A) :- !,write(':-'),writes(A).
> writes(?-A) :- !,write('?-'),writes(A).


This should run on any Prolog system:

writes(:-(A)) :- !,write((:-)),writes(A).

--- Jan
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 04:22 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.