From 2624b0c411fd1584e81ab1e3785f35ce9ff4fbbb Mon Sep 17 00:00:00 2001 From: Naveen Sundar Govindarajulu Date: Fri, 15 Jun 2018 14:55:57 -0700 Subject: [PATCH] Adding in the soda can challenge. --- .../naveensundarg/planner/problems/tora/sodacan.clj | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/resources/com/naveensundarg/planner/problems/tora/sodacan.clj b/src/main/resources/com/naveensundarg/planner/problems/tora/sodacan.clj index 1874555..3269e81 100644 --- a/src/main/resources/com/naveensundarg/planner/problems/tora/sodacan.clj +++ b/src/main/resources/com/naveensundarg/planner/problems/tora/sodacan.clj @@ -1,13 +1,19 @@ {:name "soda can challenge" - :background [(forall [?thing] (if (and (Checked ?thing) (Possible ?thing)) + :background [ ;; If all the possible things are checked, then the answer is known. + (forall [?thing] (if (and (Checked ?thing) (Possible ?thing)) (exists ?answer (Know ?answer))))] - :start [(Possible A) + :start [;; A, B, and C are possible + (Possible A) (Possible B) (Possible C) + ;;; A, B, and C are the only possibilities (forall [?u] (if (and (not (= ?u A)) (not (= ?u B)) (not (= ?u C))) (not (Possible ?u))))] - :actions [(define-action checkU [?q] + + + :actions [ ;;; Checking something that is possible + (define-action attend [?q] {:preconditions [(Possible ?q)] :additions [(Checked ?q)] :deletions []})]