mirror of
				https://github.com/RAIRLab/Spectra.git
				synced 2025-10-26 22:51:19 +00:00 
			
		
		
		
	Adding in the soda can challenge.
This commit is contained in:
		
							parent
							
								
									411e51dfc9
								
							
						
					
					
						commit
						6764c7faa4
					
				
					 2 changed files with 17 additions and 2 deletions
				
			
		|  | @ -42,11 +42,11 @@ public class Sandbox { | |||
| 
 | ||||
|     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(); | ||||
| 
 | ||||
|         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( | ||||
|  |  | |||
|  | @ -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))]} | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue