Hmmm... the clauses seem paired in like so, in the or/2 reference, like
(or
((equal 3 @X) (equal @X 4))
((equal 7 @X) (equal @X 7)) )
When I similarly pair the clauses of or/2:
(be foo (@N) (or ((a @N) (b @N))))
It works.
:-)
--- On Wed, 6/29/11, Doug Snead <[email protected]> wrote:
> From: Doug Snead <[email protected]>
> Subject: pilog question
> To: [email protected]
> Date: Wednesday, June 29, 2011, 2:03 PM
> I have a question about how or/2
> works in pilog. Here's my test of or/2:
>
> ~/lisp/miniPicoLisp
> $ ./pil
> : (be a (3))
> -> a
> : (be b (3))
> -> b
> : (? (a 3))
> -> T
> : (be foo (@N) (or (a @N) (b @N)))
> -> foo
> : (? foo a b or (foo 3))
> 1 (foo 3)
> 1 (or (a 3) (b 3))
> -> NIL
> :
>
> Shouldn't that be T ?
>
> It seems to not to try to prove either (a 3) or (b
> 3). Am I using or/2 incorrectly in pilog?
>
>
> Here's that in swi-prolog for comparison:
>
> ~/prolog
> # cat t.pl
>
> a(3).
>
> b(3).
>
> foo(N) :- a(N) ; b(N).
>
>
>
> ~/prolog
> # swipl -f t.pl
> % /root/prolog/t.pl compiled 0.00 sec, 2,804 bytes
> Welcome to SWI-Prolog (Multi-threaded, 32 bits, Version
> 5.10.4)
> Copyright (c) 1990-2011 University of Amsterdam, VU
> Amsterdam
> SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free
> software,
> and you are welcome to redistribute it under certain
> conditions.
> Please visit http://wwwswi-prolog.org for details.
>
> For help, use ?- help(Topic). or ?- apropos(Word).
>
> ?- a(3).
> true.
>
> ?- foo(3).
> true .
>
> ?-
>
>
>
> --
> UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe
>
--
UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe