Adding in the soda can challenge.

This commit is contained in:
Naveen Sundar Govindarajulu 2018-06-15 14:48:24 -07:00
parent 411e51dfc9
commit 6764c7faa4
2 changed files with 17 additions and 2 deletions

View file

@ -42,11 +42,11 @@ public class Sandbox {
public static void main(String[] args) throws com.naveensundarg.shadow.prover.utils.Reader.ParsingException { public static void main(String[] args) throws com.naveensundarg.shadow.prover.utils.Reader.ParsingException {
List<PlanningProblem> planningProblemList = (PlanningProblem.readFromFile(Sandbox.class.getResourceAsStream("../problems/learning/reasoning_5.clj"))); List<PlanningProblem> planningProblemList = (PlanningProblem.readFromFile(Sandbox.class.getResourceAsStream("../problems/tora/sodacan.clj")));
Planner depthFirstPlanner = new DepthFirstPlanner(); Planner depthFirstPlanner = new DepthFirstPlanner();
PlanningProblem planningProblem = planningProblemList.stream().filter(problem -> problem.getName().equals("learning")).findFirst().get(); PlanningProblem planningProblem = planningProblemList.stream().filter(problem -> problem.getName().equals("soda can challenge")).findFirst().get();
depthFirstPlanner.plan(planningProblem.getBackground(), planningProblem.getActions(), planningProblem.getStart(), planningProblem.getGoal()).ifPresent( depthFirstPlanner.plan(planningProblem.getBackground(), planningProblem.getActions(), planningProblem.getStart(), planningProblem.getGoal()).ifPresent(

View file

@ -0,0 +1,15 @@
{:name "soda can challenge"
:background [(forall [?thing] (if (and (Checked ?thing) (Possible ?thing))
(exists ?answer (Know ?answer))))]
:start [(Possible A)
(Possible B)
(Possible C)
(forall [?u] (if (and (not (= ?u A)) (not (= ?u B)) (not (= ?u C))) (not (Possible ?u))))]
:actions [(define-action checkU [?q]
{:preconditions [(Possible ?q)]
:additions [(Checked ?q)]
:deletions []})]
:goal [(exists ?answer (Know ?answer))]}