```(It looks not so bad, once I studied golog_swi.pl a bit more. Some loose ends
still, but promising.  - Doug)```
```

#  translated from: http://www.cs.toronto.edu/cogrobo/Systems/golog_swi.pl

# do(E1 : E2,S,S1) :- do(E1,S,S2), do(E2,S2,S1).
(be do ((@E1 @E2) @S @S1) (do @E1 @S1 @S2) (do @E2 @S2 @S1))

# do(?(P),S,S) :- holds(P,S).
(be do ((? @P) @S @S) (holds @P @S)) # ??

# do(E1 # E2,S,S1) :- do(E1,S,S1) ; do(E2,S,S1).
(be do ((Amb @E1 @E2) @S @S1) (or (do @E1 @S @S1) (do @E2 @S2 @S1)))

# do(if(P,E1,E2),S,S1) :-
#    do( (?(P) : E1)
#        # (?(-P) : E2),
#          S,S1).
(be do ((if @P @E1 @E2) @S @S1)
(do (Amb (Seq (? @P) @E1)
(Seq (? (Neg @P)) @E2))
@S @S1))

# do(star(E),S,S1) :- S1 = S ; do(E : star(E),S,S1).
(be do ((star @E) @S @S1) (or (equal @S1 @S) (do (@E (star @E)) @S @S1)))

# do(while(P,E),S,S1):- do(star(?(P) : E) : ?(-P),S,S1).
(be do ((while @P @E) @S @S1)
(do (Seq (star (Seq (? @P) @E)) (? (Neg @P))) @S @S1))

# do(pi(V,E),S,S1) :- sub(V,_,E,E1), do(E1,S,S1).
(be do ((pi @V @E) @S @S1) (sub @V @ @E @E1) (do @E1 @S @S1))

# do(E,S,S1) :- proc(E,E1), do(E1,S,S1).
(be do (@E @S @S1) (proc @E @E1) (do @E1 @S @S1))

# do(E,S,do(E,S)) :- primitive_action(E), poss(E,S).
(be do (@E @S (do @E @S)) (primitive_action @E) (poss @E @S))

# sub(_,_,T1,T2) :- var(T1), T2 = T1.
(be sub (@ @ @T1 @T2) (var @T1) (equal @T2 @T1))

# sub(X1,X2,T1,T2) :- \+ var(T1), T1 = X1, T2 = X2.
(be sub (@X1 @X2 @T1 @T2) (not (var @T1))
(equal @T1 @X1)
(equal @T2 @X1))

# sub(X1,X2,T1,T2) :- \+ T1 = X1, T1 =..[F|L1], sub_list(X1,X2,L1,L2),
#                      T2 =..[F|L2].
(be sub (@X1 @X2 @T1 @T2) (not (equal @T1 @X1))
(append @F @L1 @T1)
(sub_list @X1 @X2 @L1 @L2)
(append @F @L2 @T2))

# sub_list(_,_,[],[])
(be sub_list (@ @ () ()))

# sub_list(X1,X2,[T1|L1],[T2|L2]) :- sub(X1,X2,T1,T2), sub_list(X1,X2,L1,L2).
(be sub_list (X1 @X2 (@T1 @L1) (@T2 @L2)) (sub @X1 @X2 @T1 @T2)
(sub_list @X1 @X2 @L1 @L2))

# holds(P & Q,S) :- holds(P,S), holds(Q,S).
(be holds ((And @P @Q) @S) (holds @P @S) (holds @Q @S))

# holds(P v Q,S) :- holds(P,S); holds(Q,S).
(be holds ((Or @P @Q) @S) (or (holds @P @S) (holds @Q @S)))

# holds(P => Q,S) :- holds(-P v Q,S)
(be holds ((If @P @Q) @S) (holds (Or (Neg @P) @Q) @S))

# holds(P <=> Q,S) :- holds((P => Q) & (Q => P),S).
(be holds ((Is @P @Q) @S) (holds (And (If @P @Q) (If @Q @P) @S)))

# holds(-(-P),S) :- holds(P,S).
(be holds ((Neg (Neg @P)) @S) (holds @P @S))

# holds(-(P & Q),S) :- holds(-P v -Q,S).
(be holds ((Neg (And @P @Q)) @S) (holds (Or (Neg @P) (Neg @Q)) @S))

# holds(-(P v Q),S) :- holds(-P & -Q,S).
(be holds ((Neg (Or @P @Q)) @S) (holds (And (Neg @P) (Neg @Q)) @S))

# holds(-(P => Q),S) :- holds(-(-P v Q),S).
(be holds ((Neg (If @P @Q)) @S) (holds (Neg (Or (Neg @P) @Q)) @S))

# holds(-(P <=> Q),S) :- holds(-((P => Q) & (Q => P)),S).
(be holds ((Neg (Is @P @Q)) @S) (holds (Neg (And (If @P @Q) (If @Q @P))) @S))

# holds(-all(V,P),S) :- holds(some(V,-P),S).
(be holds ((Neg (all @V @P)) @S) (holds (some @V (Neg @P)) @S))

# holds(-some(V,P),S) :- \+ holds(some(V,P),S).
(be holds ((Neg (some @V @P)) @S) (not (holds (some @V @P) @S)))

# holds(-P,S) :- isAtom(P), \+ holds(P,S).
(be holds ((Neg @P) @S) (isAtom @P) (not (holds @P @S)))

# holds(all(V,P),S) :- holds(-some(V,-P),S)
(be holds ((all @V @P) @S) (holds (Neg (some @V (Neg @P)) @S)))

# holds(some(V,P),S) :- sub(V,_,P,P1), holds(P1,S).
(be holds ((some @V @P) @S) (sub @V @ @P @P1) (holds @P1 @S))

# holds(A,S) :- restoreSitArg(A,S,F), F ;
#           \+ restoreSitArg(A,S,F), isAtom(A), A.

(be holds (@A @S)  (restoreSitArg @A @S @F)
@F # is naked var ok as pilog clause?
(not (restoreSitArg @A @S @F))
(isAtom @A)
@A)

# isAtom(A) :- \+ (A = -W ; A = (W1 & W2) ; A = (W1 => W2) ;
#     A = (W1 <=> W2) ; A = (W1 v W2) ; A = some(X,W) ; A = all(X,W)).

(be isAtom (@A) (not (equal @A (Neg @W)))
(or (equal @A (And @W1 @W2)))
(or (equal @A (If @W1 @W2)))
(or (equal @A (Is @W1 @W2)))
(or (equal @A (Or @W1 @W2)))
(or (equal @A (some @X @W)))
(or (equal @A (all @X @W))))

# %restoreSitArg(poss(A),S,poss(A,S)).
(prove (goal '(restoreSitArg (poss @A) @S (poss @A @S)))) # ?

--- On Fri, 6/17/11, Doug Snead <semaphore_2...@yahoo.com> wrote:

> To: picolisp@software-lab.de
> Date: Friday, June 17, 2011, 8:43 PM
>
> Yiorgos, Alexander:
>
> Thanks for the info. Unfortunately, not so straightforward
>
> Doug
>
>
>
> wrote:
>
> > To: picolisp@software-lab.de
> > Date: Friday, June 17, 2011, 3:07 AM
> > On Fri, Jun 17, 2011 at 10:37 AM,
> > Alexander Burger <a...@software-lab.de>
> > wrote:
> > >> Levesque, H. J, Reiter, R., Lespérance, Y.,
> Lin,
> > F., & Scherl, R. B.
> > >> (1997). GOLOG: A Logic Programming Language
> for
> > Dynamic Domains
> > >> Journal of Logic Programming, 31(1-3), 59-83
> > >
> > > Can this be found online somewhere?
> >
> > http://www.cs.toronto.edu/kr/publications/GOLOGlang.pdf
> >
> >
> > --