up_SMT_engine.ProblemBuilder.BaseProblemBuilder

Classes

BaseProblemBuilder(actions, fluents, ...)

Class used to handle constructing the SMT problem for Z3 to solve Suitable for sequential planning

class up_SMT_engine.ProblemBuilder.BaseProblemBuilder.BaseProblemBuilder(actions, fluents, is_incremental, initial_values)[source]

Bases: object

Class used to handle constructing the SMT problem for Z3 to solve Suitable for sequential planning

get_mutex_count()[source]
__generate_parallelism_mutexes(plan_len)

Generate mutexes for sequential parallelism Use basic encoding requiring O(n^2) constraints per timestep Assert that, for every pair of actions at time t, only one can be true Assert that, for every action at time t at least one can be true (using OR)

Args:

plan_len (int): Plan length

Returns:

Array of constraint clauses: Array of constraint clauses. If using incremental solving this only covers the penultimate timestep. Otherwise the array covers the first to penultimate timesteps

add_mutexes(instance, mutex_array)[source]

Add mutex clauses to the solver while counting each mutex

Args:

instance (z3.Solver): Current Solver to which clauses can be added mutex_array (Array of constraint clauses): Array of mutex clauses to add

add_action_constraints(problem_instance, plan_len)[source]

For each action object generate all relevant constraints

Args:

problem_instance (z3.Solver): Current Solver to which clauses can be added plan_len (int): Plan length

add_fluent_constraints(problem_instance, plan_len)[source]

For each fluent object generate all relevant constraints

Args:

problem_instance (z3.Solver): Current Solver to which clauses can be added plan_len (int): Plan length

add_init(problem_instance, plan_len)[source]

Add initial values if not already present. If using incremental pop the previous goal clause

Args:

problem_instance (z3.Solver): The current solver to which clauses are added plan_len (int): The plan length

add_goal(problem_instance, goal_clause)[source]

Add the goal value to the solver, and create a checkpoint if using incremental solving

Args:

problem_instance (z3.Solver): The current solver to which clauses are added goal_clause (Clause): The clause representing all goal conditions

build(problem_instance, plan_len, goal_clause)[source]

Using clauses generated by actions and fluents build the problem in the z3 Solver

Args:

problem_instance (z3.Solver): The current solver to which clauses are added plan_len (int): The plan length goal_clause (Clause): The clause representing all goal conditions