144bae0818af

More grounding
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Thu, 13 Oct 2016 12:36:28 +0000
parents 90dd275f6e81
children af5f6401a5c7
branches/tags (none)
files gdl/hanoi.gdl gdl/pick-small.gdl src/grounders/fluxplayer.lisp

Changes

--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gdl/hanoi.gdl	Thu Oct 13 12:36:28 2016 +0000
@@ -0,0 +1,111 @@
+(role player)
+(init (on disc5 pillar1))
+(init (on disc4 disc5))
+(init (on disc3 disc4))
+(init (on disc2 disc3))
+(init (on disc1 disc2))
+(init (clear disc1))
+(init (clear pillar2))
+(init (clear pillar3))
+(init (step s0))
+(<= (legal player (puton ?x ?y))
+    (true (clear ?x))
+    (true (clear ?y))
+    (smallerdisc ?x ?y))
+(<= (next (step ?y))
+    (true (step ?x))
+    (successor ?x ?y))
+(<= (next (on ?x ?y))
+    (does player (puton ?x ?y)))
+(<= (next (on ?x ?y))
+    (true (on ?x ?y))
+    (not (put_on_any ?x)))
+(<= (next (clear ?y))
+    (true (on ?x ?y))
+	(put_on_any ?x))
+(<= (next (clear ?y))
+    (true (clear ?y))
+    (not (put_any_on ?y)))
+
+(<= (put_on_any ?x)
+    (does player (puton ?x ?y)))
+(<= (put_any_on ?y)
+    (does player (puton ?x ?y)))
+
+(<= (goal player 100)
+    (tower pillar3 s5))
+(<= (goal player 80)
+    (tower pillar3 s4))
+(<= (goal player 60)
+    (tower pillar3 s3))
+(<= (goal player 40)
+    (tower pillar3 s2))
+(<= (goal player 0)
+    (tower pillar3 ?height)
+    (smaller ?height s2))
+(<= terminal
+    (true (step s31)))
+(<= (tower ?x s0)
+    (true (clear ?x)))
+(<= (tower ?x ?height)
+    (true (on ?y ?x))
+    (disc_or_pillar ?y)
+    (tower ?y ?height1)
+    (successor ?height1 ?height))
+(pillar pillar1)
+(pillar pillar2)
+(pillar pillar3)
+(nextsize disc1 disc2)
+(nextsize disc2 disc3)
+(nextsize disc3 disc4)
+(nextsize disc4 disc5)
+(disc_or_pillar disc1)
+(disc_or_pillar disc2)
+(disc_or_pillar disc3)
+(disc_or_pillar disc4)
+(disc_or_pillar disc5)
+(<= (disc_or_pillar ?p)
+	(pillar ?p))
+(<= (nextsize disc5 ?pillar)
+    (pillar ?pillar))
+(<= (smallerdisc ?a ?b)
+    (nextsize ?a ?b))
+(<= (smallerdisc ?a ?b)
+    (nextsize ?a ?c)
+    (smallerdisc ?c ?b))
+(successor s0 s1)
+(successor s1 s2)
+(successor s2 s3)
+(successor s3 s4)
+(successor s4 s5)
+(successor s5 s6)
+(successor s6 s7)
+(successor s7 s8)
+(successor s8 s9)
+(successor s9 s10)
+(successor s10 s11)
+(successor s11 s12)
+(successor s12 s13)
+(successor s13 s14)
+(successor s14 s15)
+(successor s15 s16)
+(successor s16 s17)
+(successor s17 s18)
+(successor s18 s19)
+(successor s19 s20)
+(successor s20 s21)
+(successor s21 s22)
+(successor s22 s23)
+(successor s23 s24)
+(successor s24 s25)
+(successor s25 s26)
+(successor s26 s27)
+(successor s27 s28)
+(successor s28 s29)
+(successor s29 s30)
+(successor s30 s31)
+(<= (smaller ?x ?y)
+    (successor ?x ?y))
+(<= (smaller ?x ?y)
+    (successor ?x ?z)
+    (smaller ?z ?y))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gdl/pick-small.gdl	Thu Oct 13 12:36:28 2016 +0000
@@ -0,0 +1,35 @@
+(role p)
+
+(legal p 1)
+(legal p 2)
+(legal p 3)
+(legal p 4)
+(legal p 5)
+
+(succ 1 2)
+(succ 2 3)
+(succ 3 4)
+(succ 4 5)
+
+(<= (smaller ?x ?y)
+  (succ ?x ?y))
+
+(<= (smaller ?x ?y)
+  (succ ?x ?sx)
+  (smaller ?sx ?y))
+
+(<= (next done))
+
+(<= (next (picked ?n))
+  (does p ?n))
+
+(<= (goal p 100)
+  (true (picked ?n))
+  (smaller ?n 3))
+
+(<= (goal p 0)
+  (true (picked ?n))
+  (not (smaller ?n 3)))
+
+(<= terminal
+  (true (picked ?anything)))
--- a/src/grounders/fluxplayer.lisp	Tue Oct 04 12:43:20 2016 +0000
+++ b/src/grounders/fluxplayer.lisp	Thu Oct 13 12:36:28 2016 +0000
@@ -150,5 +150,6 @@
 ; (dump-grounded "8puzzle")
 ; (dump-grounded "tictactoe")
 ; (dump-grounded "roshambo2")
+; (dump-grounded "hanoi")