domschrei / lilotane

Lifted Logic for Task Networks: SAT-driven Planning for Totally-ordered Hierarchical Task Networks (HTN)
GNU General Public License v3.0
28 stars 8 forks source link

Lilotane doesn't stop very fast in case of "no Plan was found" #10

Closed bhomaidan1990 closed 2 years ago

bhomaidan1990 commented 2 years ago

Hi, In the case where there is no plan, Lilotane is taking a long time to signal that no plan was found, compared to other planners such as TFD/PDDL4J which was able to stop and signal that there is no plan after half a second!,

Is there any way to solve this issue? thanks in advance.

Here are my domain and problem for test purposes:

Domain

;-------------------------------------------------
; Specification in HDDL of the Legos domain
;-------------------------------------------------
(define (domain Legos_in_depth)
;-------------------------------------------------------------------------
;                       Description                                      |
;------------------------------------------------------------------------|
; This File contains:                                                    |
; # 1. Predicates, that describes properties of the world.               |
; # 2. Operators(Actions), that describes the way in which the state     |
;      can change, These operators are limited to the agent capabilities.|
; # 1. Tasks(fully or partially ordered).                                |
; # 4. Methods to decompose the non-premitive tasks into subtasks        |
;-------------------------------------------------------------------------
;-------------------
;   Requirements
;-------------------
(:requirements 
  :strips ; add delete effects.
  :typing ; add types.
  :hierarchy ; add tasks - subtasks ... etc.
  :method-preconditions ; add preconditions to the methods.
  :negative-preconditions ; add negative preconditions.
)
;----------------
;   Types       |
;----------------
(:types
  Pos - object ; Workspace Point
  Block_2x2 - Block ; Block 2x2
  Block_2x4 - Block ; Block 2x4
  Block_2x6 - Block ; Block 2x6
  Block - object
  Direction - object ; direction of the lego pick  H: ==  V: ||
  Gripper - object ; holds at most 1 Block, only 1 Gripper per Location
)
;-------------------------------------------------------------------------
;                          Predicates                                    |
;-------------------------------------------------------------------------
(:predicates
  ;; Legos Construction Directions
  (x_plus  ?l1 - Pos ?l2 - Pos); Location l1.x = (l2.x+1)
  (x_minus ?l1 - Pos ?l2 - Pos); Location l1.x = (l2.x-1)
  (y_plus  ?l1 - Pos ?l2 - Pos); Location l1.y = (l2.y+1)
  (y_minus ?l1 - Pos ?l2 - Pos); Location l1.y = (l2.y-1)
  (z_plus  ?l1 - Pos ?l2 - Pos); Location l1.z = (l2.z+1)
  (z_minus ?l1 - Pos ?l2 - Pos); Location l1.z = (l2.z-1)

  ; Empty Location
  (empty_location ?l - Pos)

  ; Lego Holding Point
  (held_from_left   ?x - Block); if the block is held from left side (y-).
  (held_from_right  ?x - Block); if the block is held from right side (y+).
  (held_from_middle ?x - Block); if the block is held from the middle.
  (held_from_up     ?x - Block); if the block is held from top side (x-).
  (held_from_down   ?x - Block); if the block is held from bottom side (x+).

  ; Hold Direction to be passed to pick actions
    ; holding direction
  (no_dir ?d - Direction)
  (left_direction ?d - Direction)
  (right_direction ?d - Direction)
  (middle_direction ?d - Direction)
  (top_direction ?d - Direction)
  (bottom_direction ?d - Direction) 

  ; Orientation of the Gripper
  (gripper_vertical ?g - Gripper); Gripper g mode is vertical(movement is in x direction).
  (unloaded ?g - Gripper); Gripper g is unloaded
  (loaded ?g - Gripper ?x - Block); Gripper g is loaded with Lego block.

  ; Used Bolcks
  (used ?x - Block)

)
;-------------------------------------------------------------------------
;                               Tasks                                    |
;-------------------------------------------------------------------------
; 1. The task of picking a Lego.
(:task PICK
  :parameters (?g - Gripper ?x - Block ?d - Direction)
)
; 2. The task of placing a Lego.
(:task PLACE
  :parameters (?g - Gripper ?x - Block ?pos - Pos)
)
;-------------------------------------------------------------------------
;                        Operators(Actions)                              |
;-------------------------------------------------------------------------

; ======================================
; 1. Gripper Rotation Group of Actions |
; ======================================
; -------------------------------------------------
; Note: All the Rotations are meant to be on Air, |
;    No collosion detection or neighboring        |
;        position assertion is done here!         |
; -------------------------------------------------
; 1.1 action of rotating the 2x2_loaded Gripper V2H
;  ||
; -----          -----
; | y |  --->  =>| x |<= --- y-axis
; -----          -----
;  ||
(:action rotate_2x2_loaded_gripper_V2H
  :parameters (?g - Gripper ?x - Block_2x2)
  :precondition 
  (and
    (loaded ?g ?x)
    (gripper_vertical ?g)
  )
  :effect
  (and 
    (not (gripper_vertical ?g))
  )
)
; 1.2 action of rotating the 2x2_loaded Gripper H2V
;                  ||
;   -----         -----
; =>| x |<=  ---> | y | --- y-axis
;   -----         -----
;                  ||
(:action rotate_2x2_loaded_gripper_H2V
  :parameters (?g - Gripper ?x - Block_2x2)
  :precondition 
  (and
    (loaded ?g ?x)
    (not(gripper_vertical ?g))
  )
  :effect
  (and 
    (gripper_vertical ?g)
  )
)
; 1.3 action of rotating the left held 2x4_loaded Gripper V2H clockwise
;  ||               -----
; ---------       =>| x |<= --- y-axis
; | x | y |  --->   -----
; ---------         | y |
;  ||               -----
(:action rotate_2x4_left_loaded_gripper_V2H_clk
    :parameters (?g - Gripper ?x - Block_2x4)
    :precondition 
    (and 
      (loaded ?g ?x)
      (gripper_vertical ?g)
      (held_from_left ?x)

    )
    :effect 
    (and
      (not (gripper_vertical ?g))
      (not (held_from_left ?x))
      (held_from_up ?x)
    )
)
; 1.4 action of rotating the left held 2x4_loaded Gripper V2H Anti-clockwise
;  ||               -----
; ---------         | y |
; | x | y |  --->   -----
; ---------       =>| x |<= --- y-axis
;  ||               -----
(:action rotate_2x4_left_loaded_gripper_V2H_Anticlk
    :parameters (?g - Gripper ?x - Block_2x4)
    :precondition 
    (and 
      (loaded ?g ?x)
      (gripper_vertical ?g)
      (held_from_left ?x)
    )
    :effect 
    (and
      (not (gripper_vertical ?g))
      (not (held_from_left ?x))
      (held_from_down ?x)
    )
)
; 1.5 action of rotating the right held 2x4_loaded Gripper V2H clockwise
;       ||          -----
; ---------         | y |
; | y | x |  --->   -----
; ---------       =>| x |<= --- y-axis
;       ||          -----
(:action rotate_2x4_right_loaded_gripper_V2H_clk
    :parameters (?g - Gripper ?x - Block_2x4)
    :precondition 
    (and 
      (loaded ?g ?x)
      (gripper_vertical ?g)
      (held_from_right ?x)
    )
    :effect 
    (and
      (not (gripper_vertical ?g))
      (not (held_from_right ?x))
      (held_from_down ?x)
    )
)
; 1.6 action of rotating the right held 2x4_loaded Gripper V2H Anti-clockwise
;       ||          -----
; ---------       =>| x |<= --- y-axis
; | y | x |  --->   -----
; ---------         | y |
;       ||          -----
(:action rotate_2x4_right_loaded_gripper_V2H_Anticlk
    :parameters (?g - Gripper ?x - Block_2x4)
    :precondition 
    (and 
      (loaded ?g ?x)
      (gripper_vertical ?g)
      (held_from_right ?x)
    )
    :effect 
    (and
      (not (gripper_vertical ?g))
      (not (held_from_right ?x))
      (held_from_up ?x)
    )
)
; 1.7 action of rotating the upper held 4x2_loaded Gripper H2V clockwise
;   -----              ||
; =>| x |<=      ---------
;   -----   ---> | y | x |  --- y-axis
;   | y |        ---------
;   -----              ||
(:action rotate_4x2_upper_loaded_gripper_H2V_clk
    :parameters (?g - Gripper ?x - Block_2x4)
    :precondition 
    (and 
      (loaded ?g ?x)
      (not(gripper_vertical ?g))
      (held_from_up ?x)
    )
    :effect 
    (and
      (gripper_vertical ?g)
      (not (held_from_up ?x))
      (held_from_right ?x)
    )
)
; 1.8 action of rotating the upper held 4x2_loaded Gripper H2V Anti-clockwise
;   -----         ||
; =>| x |<=      ---------
;   -----   ---> | x | y |  --- y-axis
;   | y |        ---------
;   -----         ||
(:action rotate_4x2_upper_loaded_gripper_H2V_Anticlk
    :parameters (?g - Gripper ?x - Block_2x4)
    :precondition 
    (and 
      (loaded ?g ?x)
      (not(gripper_vertical ?g))
      (held_from_up ?x)
    )
    :effect 
    (and
      (gripper_vertical ?g)
      (not (held_from_up ?x))
      (held_from_left ?x)
    )
)
; 1.9 action of rotating the lower held 4x2_loaded Gripper H2V clockwise
;   -----         ||
;   | y |        ---------
;   -----   ---> | x | y |  --- y-axis
; =>| x |<=      ---------
;   -----         ||
(:action rotate_4x2_lower_loaded_gripper_H2V_clk
    :parameters (?g - Gripper ?x - Block_2x4)
    :precondition 
    (and 
      (loaded ?g ?x)
      (not(gripper_vertical ?g))
      (held_from_down ?x)
    )
    :effect 
    (and
      (gripper_vertical ?g)
      (not (held_from_down ?x))
      (held_from_left ?x)
    )
)
; 1.10 action of rotating the lower held 4x2_loaded Gripper H2V Anti-clockwise
;   -----              ||
;   | y |        ---------
;   -----   ---> | y | x |  --- y-axis
; =>| x |<=      ---------
;   -----              ||
(:action rotate_4x2_lower_loaded_gripper_H2V_Anticlk
    :parameters (?g - Gripper ?x - Block_2x4)
    :precondition 
    (and 
      (loaded ?g ?x)
      (not(gripper_vertical ?g))
      (held_from_down ?x)
    )
    :effect 
    (and
      (gripper_vertical ?g)
      (not (held_from_down ?x))
      (held_from_right ?x)
    )
)
; 1.11 action of rotating the left held 2x6_loaded Gripper V2H clockwise
;                       -----
;  ||                 =>| x |<= --- y-axis
; -------------         -----
; | x | y | z | --->    | y |
; -------------         -----
;  ||                   | z |
;                       -----
(:action rotate_2x6_left_loaded_gripper_V2H_clk
    :parameters (?g - Gripper ?x - Block_2x6)
    :precondition 
    (and 
      (loaded ?g ?x)
      (gripper_vertical ?g)
      (held_from_left ?x)
    )
    :effect 
    (and
      (not (gripper_vertical ?g))
      (not (held_from_left ?x))
      (held_from_up ?x)
    )
)
; 1.12 action of rotating the left held 2x6_loaded Gripper V2H Anticlockwise
;                       -----
;  ||                   | z |
; -------------         -----
; | x | y | z | --->    | y |
; -------------         -----
;  ||                 =>| x |<= --- y-axis
;                       -----
(:action rotate_2x6_left_loaded_gripper_V2H_Anticlk
    :parameters (?g - Gripper ?x - Block_2x6)
    :precondition 
    (and 
      (loaded ?g ?x)
      (gripper_vertical ?g)
      (held_from_left ?x)
    )
    :effect 
    (and
      (not (gripper_vertical ?g))
      (not (held_from_left ?x))
      (held_from_down ?x)
    )
)
; 1.13 action of rotating the middle held 2x6_loaded Gripper V2H
;                       -----
;      ||               | z |
; -------------         -----
; | y | x | z | --->  =>| x |<= --- y-axis
; -------------         -----
;      ||               | y |
;                       -----
(:action rotate_2x6_middle_loaded_gripper_V2H
    :parameters (?g - Gripper ?x - Block_2x6)
    :precondition 
    (and 
      (loaded ?g ?x)
      (gripper_vertical ?g)
      (held_from_middle ?x)
    )
    :effect 
    (and
      (not (gripper_vertical ?g))
    )
)
; 1.14 action of rotating the right held 2x6_loaded Gripper V2H clockwise
;                       -----
;           ||          | z |
; -------------         -----
; | z | y | x | --->    | y |
; -------------         -----
;           ||        =>| x |<= --- y-axis
;                       -----
(:action rotate_2x6_right_loaded_gripper_V2H_clk
    :parameters (?g - Gripper ?x - Block_2x6)
    :precondition 
    (and 
      (loaded ?g ?x)
      (gripper_vertical ?g)
      (held_from_right ?x)
    )
    :effect 
    (and
      (not (gripper_vertical ?g))
      (not (held_from_right ?x))
      (held_from_down ?x)
    )
)
; 1.15 action of rotating the right held 2x6_loaded Gripper V2H Anticlockwise
;                       -----
;           ||        =>| x |<= --- y-axis
; -------------         -----
; | z | y | x | --->    | y |
; -------------         -----
;           ||          | z |
;                       -----
(:action rotate_2x6_right_loaded_gripper_V2H_Anticlk
    :parameters (?g - Gripper ?x - Block_2x6)
    :precondition 
    (and 
      (loaded ?g ?x)
      (gripper_vertical ?g)
      (held_from_right ?x)
    )
    :effect 
    (and
      (not (gripper_vertical ?g))
      (not (held_from_right ?x))
      (held_from_up ?x)
    )
)
; 1.16 action of rotating the upper held 6x2_loaded Gripper H2V clockwise
;   -----
; =>| x |<=               ||
;   -----       -------------
;   | y |  ---> | z | y | x | --- y-axis
;   -----       -------------
;   | z |                 ||
;   -----
(:action rotate_6x2_upper_loaded_gripper_H2V_clk
    :parameters (?g - Gripper ?x - Block_2x6)
    :precondition 
    (and 
      (not (gripper_vertical ?g))
      (held_from_up ?x)
    )
    :effect 
    (and
      (gripper_vertical ?g)
      (not (held_from_up ?x))
      (held_from_right ?x)
    )
)
; 1.17 action of rotating the upper held 6x2_loaded Gripper H2V Anticlockwise
;   -----
; =>| x |<=      ||
;   -----       -------------
;   | y |  ---> | x | y | z | --- y-axis
;   -----       -------------
;   | z |        ||
;   -----
(:action rotate_6x2_upper_loaded_gripper_H2V_Anticlk
    :parameters (?g - Gripper ?x - Block_2x6)
    :precondition 
    (and 
      (loaded ?g ?x)
      (not (gripper_vertical ?g))
      (held_from_up ?x)
    )
    :effect 
    (and
      (gripper_vertical ?g)
      (not (held_from_up ?x))
      (held_from_left ?x)
    )
)
; 1.18 action of rotating the middle held 6x2_loaded Gripper H2V clockwise
;   -----
;   | y |               ||
;   -----         -------------
; =>| x |<=  ---> | z | x | y | --- y-axis
;   -----         -------------
;   | z |               ||
;   -----
(:action rotate_6x2_middle_loaded_gripper_H2V
    :parameters (?g - Gripper ?x - Block_2x6)
    :precondition 
    (and 
      (loaded ?g ?x)
      (not (gripper_vertical ?g))
      (held_from_middle ?x)
    )
    :effect 
    (and
      (gripper_vertical ?g)
    )
)
; 1.19 action of rotating the lower held 6x2_loaded Gripper H2V clockwise
;   -----
;   | z |        ||
;   -----       -------------
;   | y |  ---> | x | y | z | --- y-axis
;   -----       -------------
; =>| x |<=      ||
;   -----
(:action rotate_6x2_lower_loaded_gripper_H2V_clk
    :parameters (?g - Gripper ?x - Block_2x6)
    :precondition 
    (and 
      (loaded ?g ?x)
      (not (gripper_vertical ?g))
      (held_from_down ?x)
    )
    :effect 
    (and
      (gripper_vertical ?g)
      (not (held_from_down ?x))
      (held_from_left ?x)
    )
)
; 1.20 action of rotating the lower held 6x2_loaded Gripper H2V Anticlockwise
;   -----
;   | z |                 ||
;   -----       -------------
;   | y |  ---> | z | y | x | --- y-axis
;   -----       -------------
; =>| x |<=               ||
;   -----
(:action rotate_6x2_lower_loaded_gripper_H2V_Anticlk
    :parameters (?g - Gripper ?x - Block_2x6)
    :precondition 
    (and 
      (loaded ?g ?x)
      (not (gripper_vertical ?g))
      (held_from_down ?x)
    )
    :effect 
    (and
      (gripper_vertical ?g)
      (not (held_from_down ?x))
      (held_from_right ?x)
    )
)
;================
; 2. Get Action |
;================
; --------------------------------------------------
; Note1: For the sake of simplicity we will set the|
; robot's stock in <--y--> direction only!         |
; Note2: All directions left, right, etc. are from |
; the robot point of view.                         |
; --------------------------------------------------
; 2.1 action of Getting 2x2 Lego.
;  ||
; -----
; | y |
; -----
;  ||
(:action get_2x2
  :parameters (?g - Gripper ?x - Block_2x2)
  :precondition 
  (and
    (gripper_vertical ?g)
    (unloaded ?g)
  )
  :effect 
  (and 
    (used ?x)
    (loaded ?g ?x)
  )
)
; 2.2 action of Getting 2x4 Lego from right position (y-).
;  ||
; ----------
; | y- | y |
; ----------
;  ||
(:action get_2x4_right
  :parameters (?g - Gripper ?x - Block_2x4)
  :precondition 
  (and
    (gripper_vertical ?g)
    (unloaded ?g)
  )
  :effect 
  (and 
    (used ?x)
    (loaded ?g ?x)
    (held_from_right ?x)
  )
)
; 2.3 action of Getting 2x4 Lego from left position (y+).
;       ||
; ----------
; | y | y+ |
; ----------
;       ||
(:action get_2x4_left
  :parameters (?g - Gripper ?x - Block_2x4)
  :precondition 
  (and
    (gripper_vertical ?g)
    (unloaded ?g)
  )
  :effect
  (and 
    (used ?x)
    (loaded ?g ?x)
    (held_from_left ?x)
  )
)
; 2.4 action of Getting 2x6 Lego from right position (y-).
;  ||
; ---------------
; | y- | y | y+ |
; ---------------
;  ||
(:action get_2x6_right
  :parameters (?g - Gripper ?x - Block_2x6)
  :precondition 
  (and
    (gripper_vertical ?g)
    (unloaded ?g)
  )
  :effect 
  (and 
    (used ?x)
    (loaded ?g ?x)
    (held_from_right ?x)
  )
)
; 2.5 action of Getting 2x6 Lego from center position (0).
;      ||
; ---------------
; | y- | y | y+ |
; ---------------
;      ||
(:action get_2x6_middle
  :parameters (?g - Gripper ?x - Block_2x6)
  :precondition 
  (and
    (gripper_vertical ?g)
    (unloaded ?g)
  )
  :effect 
  (and 
    (used ?x)
    (loaded ?g ?x)
    (held_from_middle ?x)
  )
)
; 2.6 action of Getting 2x6 Lego from left position (y+).
;           ||
; ---------------
; | y- | y | y+ |
; ---------------
;           ||
(:action get_2x6_left
  :parameters (?g - Gripper ?x - Block_2x6)
  :precondition 
  (and
    (gripper_vertical ?g)
    (unloaded ?g)
  )
  :effect 
  (and 
    (used ?x)
    (loaded ?g ?x)
    (held_from_left ?x)
  )
)
;==========================
; 3. Group of Put Actions |
;==========================
; -----
; | B |
; -----
(:action put_2x2
  :parameters (?g - Gripper ?x - Block_2x2 ?p - Pos)
  :precondition 
  (and
    (empty_location ?p)
  )
  :effect 
  (and 
    (not (empty_location ?p))
    (unloaded ?g)
    (gripper_vertical ?g)
  )
)
; ---------
; | B | B |
; ---------
(:action put_2x4
  :parameters (?g - Gripper ?x - Block_2x4 ?p1 ?p2 - Pos)
  :precondition 
  (and
    (empty_location ?p1)
    (empty_location ?p2)
  )
  :effect 
  (and 
    (not (empty_location ?p1))
    (not (empty_location ?p2))
    (unloaded ?g)
    (gripper_vertical ?g)
  )
)
; -------------
; | B | B | B |
; -------------
(:action put_2x6
  :parameters (?g - Gripper ?x - Block_2x6 ?p1 ?p2 ?p3 - Pos)
  :precondition 
  (and
    (empty_location ?p1)
    (empty_location ?p2)
    (empty_location ?p3)
  )
  :effect 
  (and 
    (not (empty_location ?p1))
    (not (empty_location ?p2))
    (not (empty_location ?p3))
    (unloaded ?g)
    (gripper_vertical ?g)
  )
)
; -------------------------------------------------------------------------
;                                Methods                                  |
; -------------------------------------------------------------------------
;=======================
; 1. Task Pick Methods |
;=======================
;------------------------------------------------------------
; Note: All pick-up methods assumes vertical gripper, and   |
;       horizontal placed Legos, since we have full control |
;       on the stock direction.                             |
;       Also Rotations if needed are done before placement  |
;       Separately                                          |
;------------------------------------------------------------
; 1.1 Method to pick-up 2x2 block
;  ||
; -----
; | y |
; -----
;  ||
(:method pick_2x2
  :parameters (?g - Gripper ?x - Block_2x2 ?d - Direction)
  :task (PICK ?g ?x ?d)
  :precondition 
  (and
    (no_dir ?d)
    (not (used ?x))
  )
  :ordered-subtasks 
  (and
    (get_2x2 ?g ?x)
  )
)
; 1.2 Method to pick-up a 2x4 block from left
;   ||
;  ---------
; | y | y+ |
;  ---------
;   ||
(:method pick_left_2x4
  :parameters (?g - Gripper ?x - Block_2x4 ?d - Direction)
  :task (PICK ?g ?x ?d)
  :precondition 
  (and
    (left_direction ?d)
    (not (used ?x))
  )
  :ordered-subtasks 
  (and
    (get_2x4_left ?g ?x)
  )
)
; 1.3 Method to pick-up a 2x6 block from left
;  ||
; ----------------
; | y | y+ | y++ |
; ----------------
;  ||
(:method pick_left_2x6
  :parameters (?g - Gripper ?x - Block_2x6 ?d - Direction)
  :task (PICK ?g ?x ?d)
  :precondition 
  (and
    (left_direction ?d)
    (not (used ?x))
  )
  :ordered-subtasks 
  (and
    (get_2x6_left ?g ?x)
  )
)
; 1.4 Method to pick-up a 2x4 block from right
;       ||
;  ---------
; | y- | y |
;  ---------
;       ||
(:method pick_right_2x4
  :parameters (?g - Gripper ?x - Block_2x4 ?d - Direction)
  :task (PICK ?g ?x ?d)
  :precondition 
  (and
    (right_direction ?d)
    (not (used ?x))
  )
  :ordered-subtasks 
  (and
    (get_2x4_right ?g ?x)
  )
)
; 1.5 Method to pick-up a 2x6 block from right
;             ||
; ----------------
; | y-- | y- | y |
; ----------------
;             ||
(:method pick_right_2x6
  :parameters (?g - Gripper ?x - Block_2x6 ?d - Direction)
  :task (PICK ?g ?x ?d)
  :precondition 
  (and
    (right_direction ?d)
    (not (used ?x))
  )
  :ordered-subtasks 
  (and
    (get_2x6_right ?g ?x)
  )
)
; 1.6 Method to pick-up a 2x6 block from middle
;        ||
; ---------------
; | y- | y | y+ |
; ---------------
;        ||
(:method pick_middle
  :parameters (?g - Gripper ?x - Block_2x6 ?d - Direction)
  :task (PICK ?g ?x ?d)
  :precondition 
  (and
    (middle_direction ?d)
    (not (used ?x))
  )
  :ordered-subtasks 
  (and
    (get_2x6_middle ?g ?x)
  )
)
;========================
; 2. Task Place Methods |
;========================
; 4.1 Method to place_down 2x2 block held with vertical gripper
;   ||
;  -----
;  | y |
;  -----
;   ||
(:method place_2x2_v
  :parameters (?g - Gripper ?x - Block_2x2 ?p ?p_x_minus ?p_x_plus ?p_z_minus - Pos)
  :task (PLACE ?g ?x ?p)
  :precondition 
  (and
    (gripper_vertical ?g)
    ; robot fingers
    (x_plus ?p_x_plus ?p)
    (x_plus ?p ?p_x_minus)
    (x_minus ?p_x_minus ?p)
    (x_minus ?p ?p_x_plus)
    (empty_location ?p_x_minus)
    (empty_location ?p_x_plus)
    ; beneath block
    (z_plus ?p ?p_z_minus)
    (z_minus ?p_z_minus ?p)
    (not (empty_location ?p_z_minus))
  )
  :ordered-subtasks 
  (and
    (rotate_2x2_loaded_gripper_V2H ?g ?x)
    (put_2x2 ?g ?x ?p)
  )
)
; 4.2 Method to place_down 2x2 block held with horizontal gripper
;    -----
;  =>| x |<= 
;    -----
(:method place_2x2_h
  :parameters (?g - Gripper ?x - Block_2x2 ?p ?p_y_minus ?p_y_plus ?p_z_minus - Pos)
  :task (PLACE ?g ?x ?p)
  :precondition 
  (and
    (not (gripper_vertical ?g))
    ; robot fingers
    (y_plus ?p_y_plus ?p)
    (y_plus ?p ?p_y_minus)
    (y_minus ?p_y_minus ?p)
    (y_minus ?p ?p_y_plus)
    (empty_location ?p_y_minus)
    (empty_location ?p_y_plus)
    ; beneath block
    (z_plus ?p ?p_z_minus)
    (z_minus ?p_z_minus ?p)
    (not (empty_location ?p_z_minus))
  )
  :ordered-subtasks 
  (and
    (rotate_2x2_loaded_gripper_V2H ?g ?x)
    (put_2x2 ?g ?x ?p)
  )
)
; 4.3 Method to place_down 2x4 block held from left with vertical gripper
;   ||
;  ----------
;  | y | y+ |
;  ----------
;   ||
(:method place_left_2x4
  :parameters (?g - Gripper ?x - Block_2x4 ?p ?p_x_minus ?p_x_plus ?p_y_plus ?p_z_minus - Pos)
  :task (PLACE ?g ?x ?p)
  :precondition 
  (and
    (gripper_vertical ?g)
    (held_from_left ?x)
    ; robot fingers
    (x_plus ?p_x_plus ?p)
    (x_plus ?p ?p_x_minus)
    (x_minus ?p_x_minus ?p)
    (x_minus ?p ?p_x_plus)
    (empty_location ?p_x_minus)
    (empty_location ?p_x_plus)
    ; block extension
    (y_plus ?p_y_plus ?p)
    (y_minus ?p ?p_y_plus)
    ; beneath block
    (z_plus ?p ?p_z_minus)
    (z_minus ?p_z_minus ?p)
    (not (empty_location ?p_z_minus))
  )
  :ordered-subtasks 
  (and
    (put_2x4 ?g ?x ?p ?p_y_plus)
  )
)
; 4.4 Method to place_down 2x4 block held from right with vertical gripper
;         ||
;  ----------
;  | y- | y |
;  ----------
;         ||
(:method place_right_2x4
  :parameters (?g - Gripper ?x - Block_2x4 ?p ?p_x_minus ?p_x_plus ?p_y_minus ?p_z_minus - Pos)
  :task (PLACE ?g ?x ?p)
  :precondition 
  (and
    (gripper_vertical ?g)
    (held_from_right ?x)
    ; robot fingers
    (x_plus ?p_x_plus ?p)
    (x_plus ?p ?p_x_minus)
    (x_minus ?p_x_minus ?p)
    (x_minus ?p ?p_x_plus)
    (empty_location ?p_x_minus)
    (empty_location ?p_x_plus)
    ; block extension
    (y_plus ?p ?p_y_minus)
    (y_minus ?p_y_minus ?p)
    ; beneath block
    (z_plus ?p ?p_z_minus)
    (z_minus ?p_z_minus ?p)
    (not (empty_location ?p_z_minus))
  )
  :ordered-subtasks 
  (and
    (put_2x4 ?g ?x ?p ?p_y_minus)
  )
)
; 4.5 Method to place_down 4x2 block held from top with horizontal gripper
;   ------
; =>| x  |<=
;   ------
;   | x+ |
;   ------
(:method place_up_2x4
  :parameters (?g - Gripper ?x - Block_2x4 ?p ?p_y_minus ?p_y_plus ?p_x_plus ?p_z_minus - Pos)
  :task (PLACE ?g ?x ?p)
  :precondition 
  (and
    (not (gripper_vertical ?g))
    (held_from_up ?x)
    ; robot fingers
    (y_plus ?p_y_plus ?p)
    (y_plus ?p ?p_y_minus)
    (y_minus ?p_y_minus ?p)
    (y_minus ?p ?p_y_plus)
    (empty_location ?p_y_minus)
    (empty_location ?p_y_plus)
    ; block extension
    (x_plus ?p_x_plus ?p)
    (x_minus ?p ?p_x_plus)
    ; beneath block
    (z_plus ?p ?p_z_minus)
    (z_minus ?p_z_minus ?p)
    (not (empty_location ?p_z_minus))
  )
  :ordered-subtasks 
  (and
    (put_2x4 ?g ?x ?p ?p_x_plus)
  )
)
; 4.6 Method to place_down 4x2 block held from top with horizontal gripper
;   ------
;   | x- |
;   ------
; =>| x  |<=
;   ------
(:method place_down_2x4
  :parameters (?g - Gripper ?x - Block_2x4 ?p ?p_y_minus ?p_y_plus ?p_x_minus ?p_z_minus - Pos)
  :task (PLACE ?g ?x ?p)
  :precondition 
  (and
    (not (gripper_vertical ?g))
    (held_from_down ?x)
    ; robot fingers
    (y_plus ?p_y_plus ?p)
    (y_plus ?p ?p_y_minus)
    (y_minus ?p_y_minus ?p)
    (y_minus ?p ?p_y_plus)
    (empty_location ?p_y_minus)
    (empty_location ?p_y_plus)
    ; block extension
    (x_plus ?p ?p_x_minus)
    (x_minus ?p_x_minus ?p)
    ; beneath block
    (z_plus ?p ?p_z_minus)
    (z_minus ?p_z_minus ?p)
    (not (empty_location ?p_z_minus))
  )
  :ordered-subtasks 
  (and
    (put_2x4 ?g ?x ?p ?p_x_minus)
  )
)
; 4.7 Method to place_down 2x6 block held from left with vertical gripper
;  ||
; ----------------
; | y | y+ | y++ |
; ----------------
;  ||
(:method place_left_2x6
  :parameters (?g - Gripper ?x - Block_2x6 ?p ?p_x_minus ?p_x_plus ?p_y_plus ?p_y_plus_plus ?p_z_minus - Pos)
  :task (PLACE ?g ?x ?p)
  :precondition 
  (and
    (gripper_vertical ?g)
    (held_from_left ?x)
    ; robot fingers
    (x_plus ?p_x_plus ?p)
    (x_plus ?p ?p_x_minus)
    (x_minus ?p_x_minus ?p)
    (x_minus ?p ?p_x_plus)
    (empty_location ?p_x_minus)
    (empty_location ?p_x_plus)
    ; block extension
    (y_plus ?p_y_plus_plus ?p_y_plus)
    (y_minus ?p_y_plus ?p_y_plus_plus)
    (y_plus ?p_y_plus ?p)
    (y_minus ?p ?p_y_plus)
    ; beneath block
    (z_plus ?p ?p_z_minus)
    (z_minus ?p_z_minus ?p)
    (not (empty_location ?p_z_minus))
  )
  :ordered-subtasks 
  (and
    (put_2x6 ?g ?x ?p ?p_y_plus ?p_y_plus_plus)
  )
)
; 4.8 Method to place_down 2x6 block held from middle with vertical gripper
;      ||
; ---------------
; | y- | y | y+ |
; ---------------
;      ||
(:method place_middle_v_2x6
  :parameters (?g - Gripper ?x - Block_2x6 ?p ?p_x_minus ?p_x_plus ?p_y_minus ?p_y_plus ?p_z_minus - Pos)
  :task (PLACE ?g ?x ?p)
  :precondition 
  (and
    (gripper_vertical ?g)
    (held_from_middle ?x)
    ; robot fingers
    (x_plus ?p_x_plus ?p)
    (x_plus ?p ?p_x_minus)
    (x_minus ?p_x_minus ?p)
    (x_minus ?p ?p_x_plus)
    (empty_location ?p_x_minus)
    (empty_location ?p_x_plus)
    ; block extension
    (y_plus ?p_y_plus ?p)
    (y_minus ?p ?p_y_plus)
    (y_plus ?p ?p_y_minus)
    (y_minus ?p_y_minus ?p)
    ; beneath block
    (z_plus ?p ?p_z_minus)
    (z_minus ?p_z_minus ?p)
    (not (empty_location ?p_z_minus))
  )
  :ordered-subtasks 
  (and
    (put_2x6 ?g ?x ?p ?p_y_minus ?p_y_plus)
  )
)
; 4.9 Method to place_down 2x6 block held from right with vertical gripper
;              ||
; ----------------
; | y-- | y- | y |
; ----------------
;              ||
(:method place_right_2x6
  :parameters (?g - Gripper ?x - Block_2x6 ?p ?p_x_minus ?p_x_plus ?p_y_minus ?p_y_minus_minus ?p_z_minus - Pos)
  :task (PLACE ?g ?x ?p)
  :precondition
  (and
    (gripper_vertical ?g)
    (held_from_right ?x)
    ; robot fingers
    (x_plus ?p_x_plus ?p)
    (x_plus ?p ?p_x_minus)
    (x_minus ?p_x_minus ?p)
    (x_minus ?p ?p_x_plus)
    (empty_location ?p_x_minus)
    (empty_location ?p_x_plus)
    ; block extension
    (y_plus ?p ?p_y_minus)
    (y_minus ?p_y_minus ?p)
    (y_plus ?p_y_minus ?p_y_minus_minus)
    (y_minus ?p_y_minus_minus ?p)
    ; beneath block
    (z_plus ?p ?p_z_minus)
    (z_minus ?p_z_minus ?p)
    (not (empty_location ?p_z_minus))
  )
  :ordered-subtasks 
  (and
    (put_2x6 ?g ?x ?p ?p_y_minus ?p_y_minus_minus)
  )
)
; 4.10 Method to place_down 6x2 block held from top with horizontal gripper
;   -----
; =>| x |<=
;   -----
;   |x+ |
;   -----
;   |x++|
;   -----
(:method place_up_2x6
  :parameters (?g - Gripper ?x - Block_2x6 ?p ?p_y_minus ?p_y_plus ?p_x_plus ?p_x_plus_plus ?p_z_minus - Pos)
  :task (PLACE ?g ?x ?p)
  :precondition
  (and
    (not (gripper_vertical ?g))
    (held_from_up ?x)
    ; robot fingers
    (y_plus ?p_y_plus ?p)
    (y_plus ?p ?p_y_minus)
    (y_minus ?p_y_minus ?p)
    (y_minus ?p ?p_y_plus)
    (empty_location ?p_y_minus)
    (empty_location ?p_y_plus)
    ; block extension
    (x_plus ?p_x_plus_plus ?p_x_plus)
    (x_minus ?p_x_plus ?p_x_plus_plus)
    (x_plus ?p_x_plus ?p)
    (x_minus ?p ?p_x_plus)
    ; beneath block
    (z_plus ?p ?p_z_minus)
    (z_minus ?p_z_minus ?p)
    (not (empty_location ?p_z_minus))
  )
  :ordered-subtasks 
  (and
    (put_2x6 ?g ?x ?p ?p_x_plus ?p_x_plus_plus)
  )
)
; 4.11 Method to place_down 6x2 block held from middle with horizontal gripper
;   -----
;   |x- |
;   -----
; =>| x |<=
;   -----
;   |x+ |
;   -----
(:method place_middle_h_2x6
  :parameters (?g - Gripper ?x - Block_2x6 ?p ?p_y_minus ?p_y_plus ?p_x_minus ?p_x_plus ?p_z_minus - Pos)
  :task (PLACE ?g ?x ?p)
  :precondition
  (and
    (not (gripper_vertical ?g))
    (held_from_middle ?x)
    ; robot fingers
    (y_plus ?p_y_plus ?p)
    (y_plus ?p ?p_y_minus)
    (y_minus ?p_y_minus ?p)
    (y_minus ?p ?p_y_plus)
    (empty_location ?p_y_minus)
    (empty_location ?p_y_plus)
    ; block extension
    (x_plus ?p_x_plus ?p)
    (x_minus ?p ?p_x_plus)
    (x_plus ?p ?p_x_minus)
    (x_minus ?p_x_minus ?p)
    ; beneath block
    (z_plus ?p ?p_z_minus)
    (z_minus ?p_z_minus ?p)
    (not (empty_location ?p_z_minus))
  )
  :ordered-subtasks 
  (and
    (put_2x6 ?g ?x ?p ?p_x_minus ?p_x_plus)
  )
)
; 4.12 Method to place_down 6x2 block held from bottom with horizontal gripper
;   -----
;   |x--|
;   -----
;   |x- |
;   -----
; =>| x |<=
;   -----
(:method place_down_h_2x6
  :parameters (?g - Gripper ?x - Block_2x6 ?p ?p_y_minus ?p_y_plus ?p_x_minus ?p_x_minus_minus ?p_z_minus - Pos)
  :task (PLACE ?g ?x ?p)
  :precondition
  (and
    (not (gripper_vertical ?g))
    (held_from_down ?x)
    ; robot fingers
    (y_plus ?p_y_plus ?p)
    (y_plus ?p ?p_y_minus)
    (y_minus ?p_y_minus ?p)
    (y_minus ?p ?p_y_plus)
    (empty_location ?p_y_minus)
    (empty_location ?p_y_plus)
    ; block extension
    (x_plus ?p ?p_x_minus)
    (x_minus ?p_x_minus ?p)
    (x_plus ?p_x_minus ?p_x_minus_minus)
    (x_minus ?p_x_minus_minus ?p_x_minus)
    ; beneath block
    (z_plus ?p ?p_z_minus)
    (z_minus ?p_z_minus ?p)
    (not (empty_location ?p_z_minus))
  )
  :ordered-subtasks 
  (and
    (put_2x6 ?g ?x ?p ?p_x_minus ?p_x_minus_minus)
  )
)
)

Problem

(define (problem main)
    (:domain Legos_in_depth)
    (:objects
        ; Gripper
        g - Gripper
        ; Workspace Points, and Neighbouring points.
        ;                       ------------------------------------      
        ;  ===== g2             |             y_plus               |
        ; ||                    |                                  |
        ; YuMi  p_xx_yy_zz      | x_minus    p_xx_yy_zz    x_plus  |
        ; ||                    |                                  |
        ;  ===== g1             |             y_minus              |
        ;                       ------------------------------------
        ;-----------------------------------------------------------------------------------------------------------------------------
        ; =================================================( Shape )==================================================================
                                 p_02_08_b  p_02_09_b  p_02_10_b  p_02_11_b
                                                       p_03_10_b  p_03_11_b
                                                                  p_04_11_b  p_04_12_b
                                                                  p_05_11_b  p_05_12_b  p_05_13_b  p_05_14_b
                                                                                        p_06_13_b                       ; base
        ;             p_xx_07_z  p_xx_08_z  p_xx_09_z  p_xx_10_z  p_xx_11_z  p_xx_12_z  p_xx_13_z  p_xx_14_z  p_xx_15_z
        ; p_01_yy_z
                                 p_01_08_0  p_01_09_0  p_01_10_0  p_01_11_0  
        ; p_02_yy_z  
                      p_02_07_0  p_02_08_0  p_02_09_0  p_02_10_0  p_02_11_0  p_02_12_0                                                     
        ; p_03_yy_z  
                                 p_03_08_0  p_03_09_0  p_03_10_0  p_03_11_0  p_03_12_0                                          
        ; p_04_yy_z  
                                                       p_04_10_0  p_04_11_0  p_04_12_0  p_04_13_0  p_04_14_0                                       
        ; p_05_yy_z  
                                                       p_05_10_0  p_05_11_0  p_05_12_0  p_05_13_0  p_05_14_0  p_05_15_0     
        ; p_06_yy_z  
                                                                  p_06_11_0  p_06_12_0  p_06_13_0  p_06_14_0        
        ; p_07_yy_z  
                                                                                        p_07_13_0                        ; Level 0
        ;-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
        ;             p_xx_07_z  p_xx_08_z  p_xx_09_z  p_xx_10_z  p_xx_11_z  p_xx_12_z  p_xx_13_z  p_xx_14_z  p_xx_15_z
        ; p_01_yy_z
                                            p_01_09_1  p_01_10_1  p_01_11_1  
        ; p_02_yy_z  
                                 p_02_08_1  p_02_09_1  p_02_10_1  p_02_11_1  p_02_12_1                                                     
        ; p_03_yy_z  
                                            p_03_09_1  p_03_10_1  p_03_11_1                                                     
        ; p_04_yy_z  
                                                                             p_04_12_1  p_04_13_1  p_04_14_1                                       
        ; p_05_yy_z  
                                                                  p_05_11_1  p_05_12_1  p_05_13_1  p_05_14_1  p_05_15_1     
        ; p_06_yy_z  
                                                                             p_06_12_1  p_06_13_1  p_06_14_1        
        ; p_07_yy_z  
                                                                                        p_07_13_1                        ; Level 1
        ;-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
        ;             p_xx_07_z  p_xx_08_z  p_xx_09_z  p_xx_10_z  p_xx_11_z  p_xx_12_z  p_xx_13_z  p_xx_14_z  p_xx_15_z
        ; p_01_yy_z
                                            p_01_09_2  p_01_10_2  p_01_11_2
        ; p_02_yy_z  
                                 p_02_08_2  p_02_09_2  p_02_10_2  p_02_11_2  p_02_12_2
        ; p_03_yy_z  
                                            p_03_09_2  p_03_10_2  p_03_11_2
        ; p_04_yy_z  
                                                                             p_04_12_2  p_04_13_2
        ; p_05_yy_z  
                                                                  p_05_11_2  p_05_12_2  p_05_13_2  p_05_14_2
        ; p_06_yy_z  
                                                                             p_06_12_2  p_06_13_2                        ; Level 2
        ;-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
        ;             p_xx_07_z  p_xx_08_z  p_xx_09_z  p_xx_10_z  p_xx_11_z  p_xx_12_z  p_xx_13_z  p_xx_14_z  p_xx_15_z
        ; p_01_yy_z
                                                       p_01_10_3  p_01_11_3
        ; p_02_yy_z  
                                            p_02_09_3  p_02_10_3  p_02_11_3  p_02_12_3
        ; p_03_yy_z  
                                                       p_03_10_3  p_03_11_3
        ; p_04_yy_z  
                                                                                        p_04_13_3
        ; p_05_yy_z  
                                                                             p_05_12_3  p_05_13_3  p_05_14_3
        ; p_06_yy_z  
                                                                                        p_06_13_3                        ; Level 3
        ;-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
        ;             p_xx_07_z  p_xx_08_z  p_xx_09_z  p_xx_10_z  p_xx_11_z 
        ; p_01_yy_z
                                                       p_01_10_4            
        ; p_02_yy_z  
                                            p_02_09_4  p_02_10_4  p_02_11_4            
        ; p_03_yy_z  
                                                       p_03_10_4            - Pos                                        ; Level 4
        ;------------------------------------------------------------------------------------------------------------------------------------
        ; -------
        ; | 2x2 |
        ; -------
        ; Human Stock
        w_2x2_3 ; human stock
        w_2x2_4 ; human stock
        r_2x2_3 ; human stock
        r_2x2_4 ; human stock
        l_2x2_3 ; human stock
        l_2x2_4 ; human stock
        y_2x2_3 ; human stock

        ; Left Gripper Stock
        w_2x2_1 ; left  gripper stock
        r_2x2_1 ; left  gripper stock
        b_2x2_1 ; left  gripper stock
        o_2x2_1 ; left  gripper stock
        ; Right Gripper Stock
        w_2x2_2 ; right gripper stock
        r_2x2_2 ; right gripper stock
        b_2x2_2 ; right gripper stock
        o_2x2_2 ; right gripper stock
        - Block_2x2

        ; -------
        ; | 2x4 |
        ; -------
        ; Human Stock
        r_2x4_3 ; human stock
        y_2x4_3 ; human stock
        ; Left Gripper Stock
        y_2x4_1 ; left  gripper stock
        b_2x4_1 ; left  gripper stock
        ; Right Gripper Stock
        y_2x4_2 ; right gripper stock
        b_2x4_2 ; right gripper stock
        - Block_2x4
        ; -------------
        ; | Directions|
        ; -------------  
        y_minus y_plus no_d - Direction
        ;---------------------------------------------------------------------
        ; 129 objects in Total: 1 grippers, 104 Pos, 22 Blocks, 3 Directions |
        ;---------------------------------------------------------------------
    )
    (:htn
        :ordered-subtasks
        (and
            (t7 (PICK g y_2x4_1 y_minus))
            (t8 (rotate_2x4_right_loaded_gripper_V2H_clk g y_2x4_1))

        )
    )

    (:init
        ;;--------------------
        ;; Gripper Relations |
        ;;--------------------
        ;; vertical gripper
        (gripper_vertical g)
        ;; unloaded gripper
        ( unloaded g )
        ;;-------------
        ;; directions |
        ;;-------------
        (no_dir no_d)
        (left_direction y_minus)
        (right_direction y_plus)

        ;;------------------
        ;; Empty Locations |
        ;;------------------
        ;; Workspace |
        ;;------------                                                     
        ;; Level 0
        ( empty_location p_02_08_0 )
        ( empty_location p_02_09_0 )
        ( empty_location p_02_10_0 )
        ( empty_location p_02_11_0 )
        ( empty_location p_03_11_0 )
        ( empty_location p_04_11_0 )
        ( empty_location p_05_11_0 )
        ( empty_location p_05_12_0 )
        ( empty_location p_05_13_0 )
        ( empty_location p_05_14_0 )
        ( empty_location p_06_13_0 )
        ;; Level 1
        ( empty_location p_02_09_1 )
        ( empty_location p_02_10_1 )
        ( empty_location p_02_11_1 )
        ( empty_location p_05_12_1 )
        ( empty_location p_05_13_1 )
        ( empty_location p_05_14_1 )
        ( empty_location p_06_13_1 )
        ;; Level 2
        ( empty_location p_02_09_2 )
        ( empty_location p_02_10_2 )
        ( empty_location p_02_11_2 )
        ( empty_location p_05_12_2 )
        ( empty_location p_05_13_2 )
        ;; Level 3
        ( empty_location p_02_10_3 )
        ( empty_location p_02_11_3 )
        ( empty_location p_05_13_3 )
        ;; Level4
        ( empty_location p_02_10_4 )
        ;;--------
        ;; Fixed |
        ;;--------
        ;; Level 0
        ( empty_location p_01_08_0 )
        ( empty_location p_01_09_0 )
        ( empty_location p_01_10_0 )
        ( empty_location p_01_11_0 )
        ( empty_location p_02_07_0 )
        ( empty_location p_02_12_0 )
        ( empty_location p_03_08_0 )
        ( empty_location p_03_09_0 )
        ( empty_location p_03_10_0 )
        ( empty_location p_03_12_0 )
        ( empty_location p_04_10_0 )
        ( empty_location p_04_12_0 )
        ( empty_location p_04_13_0 )
        ( empty_location p_04_14_0 )
        ( empty_location p_05_10_0 )
        ( empty_location p_05_15_0 )
        ( empty_location p_06_11_0 )
        ( empty_location p_06_12_0 )
        ( empty_location p_06_14_0 )
        ( empty_location p_07_13_0 )
        ;; Level 1
        ( empty_location p_01_09_1 )
        ( empty_location p_01_10_1 )
        ( empty_location p_01_11_1 )
        ( empty_location p_02_08_1 )
        ( empty_location p_02_12_1 )
        ( empty_location p_03_09_1 )
        ( empty_location p_03_10_1 )
        ( empty_location p_03_11_1 )
        ( empty_location p_04_12_1 )
        ( empty_location p_04_13_1 )
        ( empty_location p_04_14_1 )
        ( empty_location p_05_11_1 )
        ( empty_location p_05_15_1 )
        ( empty_location p_06_12_1 )
        ( empty_location p_06_14_1 )
        ( empty_location p_07_13_1 )
        ;; Level 2
        ( empty_location p_01_09_2 )
        ( empty_location p_01_10_2 )
        ( empty_location p_01_11_2 )
        ( empty_location p_02_08_2 )
        ( empty_location p_02_12_2 )
        ( empty_location p_03_09_2 )
        ( empty_location p_03_10_2 )
        ( empty_location p_03_11_2 )
        ( empty_location p_04_12_2 )
        ( empty_location p_04_13_2 )
        ( empty_location p_05_11_2 )
        ( empty_location p_05_14_2 )
        ( empty_location p_06_12_2 )
        ( empty_location p_06_13_2 )
        ;; Level 3
        ( empty_location p_01_10_3 )
        ( empty_location p_01_11_3 )
        ( empty_location p_02_09_3 )
        ( empty_location p_02_12_3 )
        ( empty_location p_03_10_3 )
        ( empty_location p_03_11_3 )
        ( empty_location p_04_13_3 )
        ( empty_location p_05_12_3 )
        ( empty_location p_05_14_3 )
        ( empty_location p_06_13_3 )
        ;; Level 4
        ( empty_location p_01_10_4 )
        ( empty_location p_02_09_4 )
        ( empty_location p_02_11_4 )
        ( empty_location p_03_10_4 )
        ;;-------------
        ;; Directions |
        ;;-------------
        ;; x_plus +x
        ;; Level 0
        ( x_plus p_03_08_0 p_02_08_0 )
        ( x_plus p_02_08_0 p_01_08_0 )
        ( x_plus p_03_09_0 p_02_09_0 )
        ( x_plus p_02_09_0 p_01_09_0 )
        ( x_plus p_05_10_0 p_04_10_0 )
        ( x_plus p_04_10_0 p_03_10_0 )
        ( x_plus p_03_10_0 p_02_10_0 )
        ( x_plus p_02_10_0 p_01_10_0 )
        ( x_plus p_06_11_0 p_05_11_0 )
        ( x_plus p_05_11_0 p_04_11_0 )
        ( x_plus p_04_11_0 p_03_11_0 )
        ( x_plus p_03_11_0 p_02_11_0 )
        ( x_plus p_02_11_0 p_01_11_0 )
        ( x_plus p_06_12_0 p_05_12_0 )
        ( x_plus p_05_12_0 p_04_12_0 )
        ( x_plus p_04_12_0 p_03_12_0 )
        ( x_plus p_03_12_0 p_02_12_0 )
        ( x_plus p_07_13_0 p_06_13_0 )
        ( x_plus p_06_13_0 p_05_13_0 )
        ( x_plus p_05_13_0 p_04_13_0 )
        ( x_plus p_06_14_0 p_05_14_0 )
        ( x_plus p_05_14_0 p_04_14_0 )
        ;; Level 1
        ( x_plus p_03_09_1 p_02_09_1 )
        ( x_plus p_02_09_1 p_01_09_1 )
        ( x_plus p_03_10_1 p_02_10_1 )
        ( x_plus p_02_10_1 p_01_10_1 )
        ( x_plus p_03_11_1 p_02_11_1 )
        ( x_plus p_02_11_1 p_01_11_1 )
        ( x_plus p_06_12_1 p_05_12_1 )
        ( x_plus p_05_12_1 p_04_12_1 )
        ( x_plus p_07_13_1 p_06_13_1 )
        ( x_plus p_06_13_1 p_05_13_1 )
        ( x_plus p_05_13_1 p_04_13_1 )
        ( x_plus p_06_14_1 p_05_14_1 )
        ( x_plus p_05_14_1 p_04_14_1 )
        ;; Level 2
        ( x_plus p_03_09_2 p_02_09_2 )
        ( x_plus p_02_09_2 p_01_09_2 )
        ( x_plus p_03_10_2 p_02_10_2 )
        ( x_plus p_02_10_2 p_01_10_2 )
        ( x_plus p_03_11_2 p_02_11_2 )
        ( x_plus p_02_11_2 p_01_11_2 )
        ( x_plus p_06_12_2 p_05_12_2 )
        ( x_plus p_05_12_2 p_04_12_2 )
        ( x_plus p_06_13_2 p_05_13_2 )
        ( x_plus p_05_13_2 p_04_13_2 )
        ;; Level 3
        ( x_plus p_03_10_3 p_02_10_3 )
        ( x_plus p_02_10_3 p_01_10_3 )
        ( x_plus p_03_11_3 p_02_11_3 )
        ( x_plus p_02_11_3 p_01_11_3 )
        ( x_plus p_06_13_3 p_05_13_3 )
        ( x_plus p_05_13_3 p_04_13_3 )
        ;; Level 4
        ( x_plus p_03_10_4 p_02_10_4 )
        ( x_plus p_02_10_4 p_01_10_4 )
        ;;-------------
        ;; x_minus -x |
        ;;-------------
        ;; Level 0
        ( x_minus p_02_08_0 p_03_08_0 )
        ( x_minus p_01_08_0 p_02_08_0 )
        ( x_minus p_02_09_0 p_03_09_0 )
        ( x_minus p_01_09_0 p_02_09_0 )
        ( x_minus p_04_10_0 p_05_10_0 )
        ( x_minus p_03_10_0 p_04_10_0 )
        ( x_minus p_02_10_0 p_03_10_0 )
        ( x_minus p_01_10_0 p_02_10_0 )
        ( x_minus p_05_11_0 p_06_11_0 )
        ( x_minus p_04_11_0 p_05_11_0 )
        ( x_minus p_03_11_0 p_04_11_0 )
        ( x_minus p_02_11_0 p_03_11_0 )
        ( x_minus p_01_11_0 p_02_11_0 )
        ( x_minus p_05_12_0 p_06_12_0 )
        ( x_minus p_04_12_0 p_05_12_0 )
        ( x_minus p_03_12_0 p_04_12_0 )
        ( x_minus p_02_12_0 p_03_12_0 )
        ( x_minus p_06_13_0 p_07_13_0 )
        ( x_minus p_05_13_0 p_06_13_0 )
        ( x_minus p_04_13_0 p_05_13_0 )
        ( x_minus p_05_14_0 p_06_14_0 )
        ( x_minus p_04_14_0 p_05_14_0 )
        ;; Level 1
        ( x_minus p_02_09_1 p_03_09_1 )
        ( x_minus p_01_09_1 p_02_09_1 )
        ( x_minus p_02_10_1 p_03_10_1 )
        ( x_minus p_01_10_1 p_02_10_1 )
        ( x_minus p_02_11_1 p_03_11_1 )
        ( x_minus p_01_11_1 p_02_11_1 )
        ( x_minus p_05_12_1 p_06_12_1 )
        ( x_minus p_04_12_1 p_05_12_1 )
        ( x_minus p_05_13_1 p_06_13_1 )
        ( x_minus p_04_13_1 p_05_13_1 )
        ( x_minus p_06_13_1 p_07_13_1 )
        ( x_minus p_05_14_1 p_06_14_1 )
        ( x_minus p_04_14_1 p_05_14_1 )
        ;; Level 2
        ( x_minus p_02_09_2 p_03_09_2 )
        ( x_minus p_01_09_2 p_02_09_2 )
        ( x_minus p_02_10_2 p_03_10_2 )
        ( x_minus p_01_10_2 p_02_10_2 )
        ( x_minus p_02_11_2 p_03_11_2 )
        ( x_minus p_01_11_2 p_02_11_2 )
        ( x_minus p_05_12_2 p_06_12_2 )
        ( x_minus p_04_12_2 p_05_12_2 )
        ( x_minus p_05_13_2 p_06_13_2 )
        ( x_minus p_04_13_2 p_05_13_2 )
        ;; Level 3
        ( x_minus p_02_10_3 p_03_10_3 )
        ( x_minus p_01_10_3 p_02_10_3 )
        ( x_minus p_02_11_3 p_03_11_3 )
        ( x_minus p_01_11_3 p_02_11_3 )
        ( x_minus p_05_13_3 p_06_13_3 )
        ( x_minus p_04_13_3 p_05_13_3 )
        ;; Level 4
        ( x_minus p_02_10_4 p_03_10_4 )
        ( x_minus p_01_10_4 p_02_10_4 )
        ;;------------
        ;; y_plus +y |
        ;;------------
        ;; Level 0
        ( y_plus p_01_09_0 p_01_08_0 )
        ( y_plus p_01_10_0 p_01_09_0 )
        ( y_plus p_01_11_0 p_01_10_0 )
        ( y_plus p_02_08_0 p_02_07_0 )
        ( y_plus p_02_09_0 p_02_08_0 )
        ( y_plus p_02_10_0 p_02_09_0 )
        ( y_plus p_02_11_0 p_02_10_0 )
        ( y_plus p_02_12_0 p_02_11_0 )
        ( y_plus p_03_09_0 p_03_08_0 )
        ( y_plus p_03_10_0 p_03_09_0 )
        ( y_plus p_03_11_0 p_03_10_0 )
        ( y_plus p_03_12_0 p_03_11_0 )
        ( y_plus p_04_11_0 p_04_10_0 )
        ( y_plus p_04_12_0 p_04_11_0 )
        ( y_plus p_04_13_0 p_04_12_0 )
        ( y_plus p_04_14_0 p_04_13_0 )
        ( y_plus p_05_11_0 p_05_10_0 )
        ( y_plus p_05_12_0 p_05_11_0 )
        ( y_plus p_05_13_0 p_05_12_0 )
        ( y_plus p_05_14_0 p_05_13_0 )
        ( y_plus p_05_15_0 p_05_14_0 )
        ( y_plus p_06_12_0 p_06_11_0 )
        ( y_plus p_06_13_0 p_06_12_0 )
        ( y_plus p_06_14_0 p_06_13_0 )
        ;; Level 1
        ( y_plus p_01_10_1 p_01_09_1 )
        ( y_plus p_01_11_1 p_01_10_1 )
        ( y_plus p_02_09_1 p_02_08_1 )
        ( y_plus p_02_10_1 p_02_09_1 )
        ( y_plus p_02_11_1 p_02_10_1 )
        ( y_plus p_02_12_1 p_02_11_1 )
        ( y_plus p_03_10_1 p_03_09_1 )
        ( y_plus p_03_11_1 p_03_10_1 )
        ( y_plus p_04_13_1 p_04_12_1 )
        ( y_plus p_04_14_1 p_04_13_1 )
        ( y_plus p_05_12_1 p_05_11_1 )
        ( y_plus p_05_13_1 p_05_12_1 )
        ( y_plus p_05_14_1 p_05_13_1 )
        ( y_plus p_05_15_1 p_05_14_1 )
        ( y_plus p_06_13_1 p_06_12_1 )
        ( y_plus p_06_14_1 p_06_13_1 )
        ;; Level 2
        ( y_plus p_01_10_2 p_01_09_2 )
        ( y_plus p_01_11_2 p_01_10_2 )
        ( y_plus p_02_09_2 p_02_08_2 )
        ( y_plus p_02_10_2 p_02_09_2 )
        ( y_plus p_02_11_2 p_02_10_2 )
        ( y_plus p_02_12_2 p_02_11_2 )
        ( y_plus p_03_10_2 p_03_09_2 )
        ( y_plus p_03_11_2 p_03_10_2 )
        ( y_plus p_04_13_2 p_04_12_2 )
        ( y_plus p_05_12_2 p_05_11_2 )
        ( y_plus p_05_13_2 p_05_12_2 )
        ( y_plus p_05_14_2 p_05_13_2 )
        ( y_plus p_06_13_2 p_06_12_2 )
        ;; Level 3
        ( y_plus p_01_11_3 p_01_10_3 )
        ( y_plus p_02_10_3 p_02_09_3 )
        ( y_plus p_02_11_3 p_02_10_3 )
        ( y_plus p_02_12_3 p_02_11_3 )
        ( y_plus p_03_11_3 p_03_10_3 )
        ( y_plus p_05_13_3 p_05_12_3 )
        ( y_plus p_05_14_3 p_05_13_3 )
        ;; Level 4
        ( y_plus p_02_10_4 p_02_09_4 )
        ( y_plus p_02_11_4 p_02_10_4 )
        ;;-------------
        ;; y_minus -y |
        ;;-------------
        ;; Level 0
        ( y_minus p_01_08_0 p_01_09_0 )
        ( y_minus p_01_09_0 p_01_10_0 )
        ( y_minus p_01_10_0 p_01_11_0 )
        ( y_minus p_02_07_0 p_02_08_0 )
        ( y_minus p_02_08_0 p_02_09_0 )
        ( y_minus p_02_09_0 p_02_10_0 )
        ( y_minus p_02_10_0 p_02_11_0 )
        ( y_minus p_02_11_0 p_02_12_0 )
        ( y_minus p_03_08_0 p_03_09_0 )
        ( y_minus p_03_09_0 p_03_10_0 )
        ( y_minus p_03_10_0 p_03_11_0 )
        ( y_minus p_03_11_0 p_03_12_0 )
        ( y_minus p_04_10_0 p_04_11_0 )
        ( y_minus p_04_11_0 p_04_12_0 )
        ( y_minus p_04_12_0 p_04_13_0 )
        ( y_minus p_04_13_0 p_04_14_0 )
        ( y_minus p_05_10_0 p_05_11_0 )
        ( y_minus p_05_11_0 p_05_12_0 )
        ( y_minus p_05_12_0 p_05_13_0 )
        ( y_minus p_05_13_0 p_05_14_0 )
        ( y_minus p_05_14_0 p_05_15_0 )
        ( y_minus p_06_11_0 p_06_12_0 )
        ( y_minus p_06_12_0 p_06_13_0 )
        ( y_minus p_06_13_0 p_06_14_0 )
        ;; Level 1
        ( y_minus p_01_09_1 p_01_10_1 )
        ( y_minus p_01_10_1 p_01_11_1 )
        ( y_minus p_02_08_1 p_02_09_1 )
        ( y_minus p_02_09_1 p_02_10_1 )
        ( y_minus p_02_10_1 p_02_11_1 )
        ( y_minus p_02_11_1 p_02_12_1 )
        ( y_minus p_03_09_1 p_03_10_1 )
        ( y_minus p_03_10_1 p_03_11_1 )
        ( y_minus p_04_12_1 p_04_13_1 )
        ( y_minus p_04_13_1 p_04_14_1 )
        ( y_minus p_05_11_1 p_05_12_1 )
        ( y_minus p_05_12_1 p_05_13_1 )
        ( y_minus p_05_13_1 p_05_14_1 )
        ( y_minus p_05_14_1 p_05_15_1 )
        ( y_minus p_06_12_1 p_06_13_1 )
        ( y_minus p_06_13_1 p_06_14_1 )
        ;; Level 2
        ( y_minus p_01_09_2 p_01_10_2 )
        ( y_minus p_01_10_2 p_01_11_2 )
        ( y_minus p_02_08_2 p_02_09_2 )
        ( y_minus p_02_09_2 p_02_10_2 )
        ( y_minus p_02_10_2 p_02_11_2 )
        ( y_minus p_02_11_2 p_02_12_2 )
        ( y_minus p_03_09_2 p_03_10_2 )
        ( y_minus p_03_10_2 p_03_11_2 )
        ( y_minus p_04_12_2 p_04_13_2 )
        ( y_minus p_05_11_2 p_05_12_2 )
        ( y_minus p_05_12_2 p_05_13_2 )
        ( y_minus p_05_13_2 p_05_14_2 )
        ( y_minus p_06_12_2 p_06_13_2 )
        ;; Level 3
        ( y_minus p_01_10_3 p_01_11_3 )
        ( y_minus p_02_09_3 p_02_10_3 )
        ( y_minus p_02_10_3 p_02_11_3 )
        ( y_minus p_02_11_3 p_02_12_3 )
        ( y_minus p_03_10_3 p_03_11_3 )
        ( y_minus p_05_12_3 p_05_13_3 )
        ( y_minus p_05_13_3 p_05_14_3 )
        ;; Level 4
        ( y_minus p_02_09_4 p_02_10_4 )
        ( y_minus p_02_10_4 p_02_11_4 )
        ;;----------
        ;; down -z |
        ;;----------
        ( z_minus p_02_08_b p_02_08_0 )
        ( z_minus p_02_08_0 p_02_08_1 )
        ( z_minus p_02_08_1 p_02_08_2 )
        ( z_minus p_02_09_b p_02_09_0 )
        ( z_minus p_02_09_0 p_02_09_1 )
        ( z_minus p_02_09_1 p_02_09_2 )
        ( z_minus p_02_09_2 p_02_09_3 )
        ( z_minus p_02_09_3 p_02_09_4 )
        ( z_minus p_02_10_b p_02_10_0 )
        ( z_minus p_02_10_0 p_02_10_1 )
        ( z_minus p_02_10_1 p_02_10_2 )
        ( z_minus p_02_10_2 p_02_10_3 )
        ( z_minus p_02_10_3 p_02_10_4 )
        ( z_minus p_02_11_b p_02_11_0 )
        ( z_minus p_02_11_0 p_02_11_1 )
        ( z_minus p_02_11_1 p_02_11_2 )
        ( z_minus p_02_11_2 p_02_11_3 )
        ( z_minus p_02_11_3 p_02_11_4 )
        ( z_minus p_03_10_b p_03_10_0 )
        ( z_minus p_03_10_0 p_03_10_1 )
        ( z_minus p_03_10_1 p_03_10_2 )
        ( z_minus p_03_10_2 p_03_10_3 )
        ( z_minus p_03_10_3 p_03_10_4 )
        ( z_minus p_03_11_b p_03_11_0 )
        ( z_minus p_03_11_0 p_03_11_1 )
        ( z_minus p_03_11_1 p_03_11_2 )
        ( z_minus p_03_11_2 p_03_11_3 )
        ( z_minus p_04_11_b p_04_11_0 )
        ( z_minus p_04_12_b p_04_12_0 )
        ( z_minus p_04_12_0 p_04_12_1 )
        ( z_minus p_04_12_1 p_04_12_2 )
        ( z_minus p_05_11_b p_05_11_0 )
        ( z_minus p_05_11_0 p_05_11_1 )
        ( z_minus p_05_11_1 p_05_11_2 )
        ( z_minus p_05_12_b p_05_12_0 )
        ( z_minus p_05_12_0 p_05_12_1 )
        ( z_minus p_05_12_1 p_05_12_2 )
        ( z_minus p_05_12_2 p_05_12_3 )
        ( z_minus p_05_13_b p_05_13_0 )
        ( z_minus p_05_13_0 p_05_13_1 )
        ( z_minus p_05_13_1 p_05_13_2 )
        ( z_minus p_05_13_2 p_05_13_3 )
        ( z_minus p_05_14_b p_05_14_0 )
        ( z_minus p_05_14_0 p_05_14_1 )
        ( z_minus p_05_14_1 p_05_14_2 )
        ( z_minus p_05_14_2 p_05_14_3 )
        ( z_minus p_06_13_b p_06_13_0 )
        ( z_minus p_06_13_0 p_06_13_1 )
        ( z_minus p_06_13_1 p_06_13_2 )
        ( z_minus p_06_13_2 p_06_13_3 )
        ;;--------
        ;; up +z |
        ;;--------
        ( z_plus p_02_08_0 p_02_08_b )
        ( z_plus p_02_08_1 p_02_08_0 )
        ( z_plus p_02_08_2 p_02_08_1 )
        ( z_plus p_02_09_0 p_02_09_b )
        ( z_plus p_02_09_1 p_02_09_0 )
        ( z_plus p_02_09_2 p_02_09_1 )
        ( z_plus p_02_09_3 p_02_09_2 )
        ( z_plus p_02_09_4 p_02_09_3 )
        ( z_plus p_02_10_0 p_02_10_b )
        ( z_plus p_02_10_1 p_02_10_0 )
        ( z_plus p_02_10_2 p_02_10_1 )
        ( z_plus p_02_10_3 p_02_10_2 )
        ( z_plus p_02_10_4 p_02_10_3 )
        ( z_plus p_02_11_0 p_02_11_b )
        ( z_plus p_02_11_1 p_02_11_0 )
        ( z_plus p_02_11_2 p_02_11_1 )
        ( z_plus p_02_11_3 p_02_11_2 )
        ( z_plus p_02_11_4 p_02_11_3 )
        ( z_plus p_03_10_0 p_03_10_b )
        ( z_plus p_03_10_1 p_03_10_0 )
        ( z_plus p_03_10_2 p_03_10_1 )
        ( z_plus p_03_10_3 p_03_10_2 )
        ( z_plus p_03_10_4 p_03_10_3 )
        ( z_plus p_03_11_0 p_03_11_b )
        ( z_plus p_03_11_1 p_03_11_0 )
        ( z_plus p_03_11_2 p_03_11_1 )
        ( z_plus p_03_11_3 p_03_11_2 )
        ( z_plus p_04_11_0 p_04_11_b )
        ( z_plus p_04_12_0 p_04_12_b )
        ( z_plus p_04_12_1 p_04_12_0 )
        ( z_plus p_04_12_2 p_04_12_1 )
        ( z_plus p_05_11_0 p_05_11_b )
        ( z_plus p_05_11_1 p_05_11_0 )
        ( z_plus p_05_11_2 p_05_11_1 )
        ( z_plus p_05_12_0 p_05_12_b )
        ( z_plus p_05_12_1 p_05_12_0 )
        ( z_plus p_05_12_2 p_05_12_1 )
        ( z_plus p_05_12_3 p_05_12_2 )
        ( z_plus p_05_13_0 p_05_13_b )
        ( z_plus p_05_13_1 p_05_13_0 )
        ( z_plus p_05_13_2 p_05_13_1 )
        ( z_plus p_05_13_3 p_05_13_2 )
        ( z_plus p_05_14_0 p_05_14_b )
        ( z_plus p_05_14_1 p_05_14_0 )
        ( z_plus p_05_14_2 p_05_14_1 )
        ( z_plus p_05_14_3 p_05_14_2 )
        ( z_plus p_06_13_0 p_06_13_b )
        ( z_plus p_06_13_1 p_06_13_0 )
        ( z_plus p_06_13_2 p_06_13_1 )
        ( z_plus p_06_13_3 p_06_13_2 )
        ;;-----------
        ;; Attached |
        ;;-----------
        ;; -------
        ;; | 2x2 |
        ;; -------
        ;; Human Stock
        ( used w_2x2_3 ); human stock
        ( used w_2x2_4 ); human stock
        ( used r_2x2_3 ); human stock
        ( used y_2x2_3 ); human stock
        ( used l_2x2_3 ); human stock
        ( used l_2x2_4 ); human stock
        ( used r_2x2_4 ); human stock
        ;; Left Gripper Stock
        ; ( used w_2x2_1 ) ; left  gripper stock
        ; ( used r_2x2_1 ) ; left  gripper stock
        ; ( used b_2x2_1 ) ; left  gripper stock
        ; ( used o_2x2_1 ) ; left  gripper stock
        ;; Right Gripper Stock
        ; ( used w_2x2_2 ) ; right gripper stock
        ; ( used r_2x2_2 ) ; right gripper stock
        ; ( used b_2x2_2 ) ; right gripper stock
        ; ( used o_2x2_2 ) ; right gripper stock
        ;; -------
        ;; | 2x4 |
        ;; -------
        ;; Human Stock
        ( used r_2x4_3 ); human stock
        ( used y_2x4_3 ); human stock
        ;; Left Gripper Stock
        ; ( used y_2x4_1 ) ; left  gripper stock
        ; ( used b_2x4_1 ) ; left  gripper stock
        ;; Right Gripper Stock
        ; ( used y_2x4_2 ) ; right gripper stock
        ; ( used b_2x4_2 ) ; right gripper stock
    )
)
domschrei commented 2 years ago

Hi Belal, first of all, please note that Lilotane was not designed for unsolvable planning. In general, I could imagine that PDDL4J's grounding is able to find out more global information on the problem than Lilotane, which keeps the problem lifted and only does a lookahead one hierarchical layer at a time. Still, there are some scenarios where Lilotane can find unsolvability, e.g., if a goal atom is more or less trivially unsatisfiable, of if some position in the hierarchy features no reachable operation at all after pruning. But these conditions are not necessary for a planning problem to be unsolvable. Secondly, you can use switch -cs ("check solvability") to check the general solvability of the problem with an additional SAT solver call after each UNSAT layer. This essentially checks for a consistent task network on the logical layer without the assertion of a finished network, so in some cases this can reveal unsolvability where the normal approach runs indefinitely. In your case, I tried out Lilotane on the current master branch with -cs and pretty much immediately (<0.02s) get the output Unsolvable at layer 1 even without assumptions! No success. Exiting.. So I hope that solves your problem for that case at least. Please let me know if the issue has been solved for you.

bhomaidan1990 commented 2 years ago

@domschrei thanks for your rapid reply, the -cs option has solved the problem.


On the other hand I tried to build the current master branch, but after the make instruction I have got this error:

Scanning dependencies of target parser
Fetching pandaPIparser ...
Cloning into 'pandaPIparser'...
remote: Enumerating objects: 1288, done.
remote: Counting objects: 100% (362/362), done.
remote: Compressing objects: 100% (223/223), done.
remote: Total 1288 (delta 250), reused 240 (delta 139), pack-reused 926
Receiving objects: 100% (1288/1288), 358.65 KiB | 1.45 MiB/s, done.
Resolving deltas: 100% (879/879), done.
HEAD is now at 95bbe29 make verifier more resilient
"src/hddl.y", line 23: junk after `%%' in definition section
"src/hddl.y", line 23: no input grammar
make[3]: *** [makefile:46: build/hddl.cpp] Segmentation fault (core dumped)
make[2]: *** [CMakeFiles/parser.dir/build.make:57: CMakeFiles/parser] Error 2
make[1]: *** [CMakeFiles/Makefile2:136: CMakeFiles/parser.dir/all] Error 2
make: *** [Makefile:95: all] Erro

If you please can tell me how to overcome this issue so I can use the current version of lilotane, thanks in advance.

domschrei commented 2 years ago

Could you retry this with a clean repository state? Seems very weird to me that the grammar compilation segfaults ...

bhomaidan1990 commented 2 years ago

clean repository state

I have followed this order:

mkdir Lilotane && cd Lilotane && git clone https://github.com/domschrei/lilotane.git
mv lilotane/* .
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DIPASIRSOLVER=glucose4
make

and got again the upper error, I'm not sure what should I do more!

P.S I'm using bison++ Version 1.21.9-1

domschrei commented 2 years ago

Unfortunately, I cannot reproduce this. It works fine for me and I think I haven't made any parser-related changes for a long period. So odds are that this is a problem with one of your current packages on your system, and that you will experience the same error on any other branch or version of Lilotane. But feel free to correct me.

bhomaidan1990 commented 2 years ago

@domschrei I have removed bison++ and reinstalled bison, and reinstalled flex sudo apt install --reinstall flex, then the problem was solved, thanks for your kind support.