Re: Syntax Error in GNU Prolog 1.2.16
- From: amill123@xxxxxxxxx
- Date: 13 Dec 2006 09:42:03 -0800
Hi, I tried removing the parentheses from the dynamic facts. I get the
same error as previously for loc_list/2, I get the following warning
for turned_off/1:
warning: unknown directive (/)/2 - maybe use initialization/1 -
directive ignored
....and the following error for the rest of the dynamic facts:
error: syntax error: . or operator expected after expression (char:11)
As far as not, I have in my code the rule:
not(X) :- \+(X).
....so using not shouldn't be a problem.
I'm actually doing the tutorial at
http://www.amzi.com/AdventureInProlog/index.htm which is very similar
to the info in the link you sent.
Thanks,
A
Darren Bane wrote:
amill123@xxxxxxxxx wrote:
I have some facts in a program that I am running under GNU Prolog that
I am trying to declare as dynamic. Here are the facts:
:- dynamic(loc_list/2).
I think this should be
:- dynamic loc_list/2.
!snip!
can_take(Thing) :-
(not(Thing = door)), % Error occurs here!
I can guess what not does, and I think the standard way to write it is
\+ Thing = door,
or probably even better,
Thing \= door,
!snip!
I can't really help with your other problems. But just from looking at
the names chosen, I can guess that your problem domain is an adventure
game. Are you aware of
http://www.ainewsletter.com/downloads/if_docs/
?
--
Darren Bane
.
- References:
- Syntax Error in GNU Prolog 1.2.16
- From: amill123
- Re: Syntax Error in GNU Prolog 1.2.16
- From: Darren Bane
- Syntax Error in GNU Prolog 1.2.16
- Prev by Date: Building lists and sublists
- Next by Date: Re: Playing a sound with XPCE
- Previous by thread: Re: Syntax Error in GNU Prolog 1.2.16
- Next by thread: Re: Syntax Error in GNU Prolog 1.2.16
- Index(es):