Hi Doug,

> Alex, would it be possible to give pilog an and/2 rule similar to the
> or/2 rule that pilog has now? Sometimes refactoring pilog around the
> lack of an and/2 is a pain. Here's an example, where a rule has a kind
> of a logical expression (with prolog backup):

As I wrote in my last mail, AND is implicit anyway.

> (be holds (@A @S) (or 
>                     (and 
>                       (restoreSitArg @A @S @F) 
>                       (@ solve (list (-> @F))))
>                     (and
>                      (not (restoreSitArg @A @S @F))
>                      (isAtom @A) 
>                      (@ solve (list (-> @A))) ) ) ) 

So this should be written as

   (be holds (@A @S)
      (or 
        ((restoreSitArg @A @S @F) (@ solve (list (-> @F))))
        ((not (restoreSitArg @A @S @F)) (isAtom @A) (@ solve (list (-> @A)))) ) 
)
      


> My solution so far is to make the parts of the conjunction be separate rules 
> to get the desired backtracking:
> 
> (be holds (@A @S) (or
>                    ((holdsRestoreSitArg @A @S @F)
>                     (holdsNotRestoreSitArg @A @S @F))))

This 'or' has no effect, as it has only a single argument.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to