From: Mart Lubbers Date: Fri, 11 Mar 2016 10:49:58 +0000 (+0100) Subject: added stub for boxonbox thing X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=4211e0aeed639a9eb14488d456cd95bdffc16118;p=mc1516pa.git added stub for boxonbox thing --- diff --git a/code/SokobanObjectwise.icl b/code/SokobanObjectwise.icl index d51ee55..9dc09a1 100644 --- a/code/SokobanObjectwise.icl +++ b/code/SokobanObjectwise.icl @@ -56,6 +56,7 @@ encode p = join "\n" [ "INVAR (" <+ encodeGoalState (indexList boxes) targetPos <+ ") <-> movement = finished;", "INVAR " <+ encodeAgentNotOnBox (indexList boxes) <+ ";", + "INVAR " <+ encodeBoxesNotOnBox (indexList boxes), "TRANS next(agent.x) = agent.x + dx;", "TRANS next(agent.y) = agent.y + dy;", encodeBlockMovement (indexList boxes), @@ -120,6 +121,10 @@ encodeBlockMovement bs = join "\n" $ map ebm bs "\t\tTRUE: b" <+ i <+ ".y + dy;\n" <+ "\tesac;" +//TODO +encodeBoxesNotOnBox :: [Int] -> String +encodeBoxesNotOnBox _ = "TRUE;" + encodeAgentNotOnBox :: [Int] -> String encodeAgentNotOnBox bs = join " &\n\t" [ "(b" <+ i <+ ".x != agent.x & b" <+ i <+ ".y != agent.y)"\\i<-bs]