-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check to make sure that call
and eval
terms are permitted as sub-terms
#102
Comments
I have looked into the history more deeply, and it's clear that call and eval terms were added before we took over this code from Dana's group at Maryland. In prolog you have to use the special operator So I'm really not sure what is the use case for So I am pondering simply removing them from the language. Or possibly there's something wrong with the term/expression distinction in the SHOP language. |
Looking further, I don't see where either |
@ko56 I extended your example, and it seems that (in-package :shop-user)
;; (defdomain tst
;; (
;; (:op (!mkalist)
;; :precond
;; (and
;; (setof (eval (cons ?x ?y)) (and (oper ?x) (area ?y)) ?al)
;; )
;; :add ((op-area-spec ?al))
;; )
;; )
;; )
(defdomain tst
(
(:op (!mkalist)
:precond
(and
(setof ?z (and (oper ?x) (area ?y) (assign ?z (cons '?x '?y))) ?al)
)
:add ((op-area-spec ?al))
)
)
)
(defdomain tst
(
(:op (!mkalist)
:precond
(and
(setof (?x . ?y) (and (oper ?x) (area ?y)) ?al)
)
:add ((op-area-spec ?al))
)
)
)
(defproblem check tst
(
(area north) (area south) (area east) (area west)
(oper opA) (oper opB) (oper opC)
)
((!mkalist))
)
(shop-trace :operators :states)
(find-plans 'check)
(defdomain tst2
(
(:op (!mkalist)
:precond (= 22 (eval (+ 1 21)))
)
(:- (= ?x ?x) ())))
(defdomain tst3
(
(:op (!mkalist)
:precond (= 22 22)
)
(:- (= ?x ?x) ())))
(defproblem check2
()
((!mkalist))
)
(format t "~&This should succeed if eval terms are evaluated:~%")
(if (find-plans 'check :domain 'tst2)
(format t "~&Unexpected success.~%")
(format t "~&Failed as expected.~%"))
(format t "~&This should succeed to show that the problem is not the equality predicate:~%")
(if (find-plans 'check :domain 'tst3)
(format t "~&Succeeded as expected.~%")
(format t "~&Unexpected failure.~%")) |
@ukuter -- Do you remember anything about |
OK, so it looks like Lastly, as I noted in paragraph 4 of #104, there is an example in the manual that contributes to this confusion, and seems like it has been taken from actual code (!) |
The manual suggests that this works, but I don't think I have ever seen a domain where this construct appears, so I don't know if it actually functions as advertised.
The text was updated successfully, but these errors were encountered: