up_SMT_engine.fluents.R2ExistsFluent

Classes

R2ExistsFluent(name, API_fluent)

R2ExistsFluent inherits methods from BaseFluent, it handles fluents for relaxed relaxed ThereExists parallelism.

class up_SMT_engine.fluents.R2ExistsFluent.R2ExistsFluent(name, API_fluent)[source]

Bases: BaseFluent

R2ExistsFluent inherits methods from BaseFluent, it handles fluents for relaxed relaxed ThereExists parallelism. This subclass extends BaseFluent by adding chained variables.

__check_action_is_affecting(action)

Check if an action affects this fluent according to the action_condition tuples list

Args:

action (BaseAction or BaseAction subclass): Action to check for

Returns:

Bool: True if affecting, false otherwise

init_chained_vars(ordered_actions)[source]

Create a chained variable for each affecting action, plus one initial chained var.

Args:

ordered_actions (List): Ordered list of actions

__get_chained_var_instance(name, timestep)

Method used internally to create/reference a chained variable

Args:

name (String): chained variable name timestep (int): current timestep

Returns:

z3 expression: z3 variable for chained variable at timestep ‘time’

get_chained_var(r2exists_tuple)[source]

Return chained variable corresponding to calling action. Returns previous chained variable if not for an effect

Args:

r2exists_tuple (Tuple): Tuple of values required for handling chained variables for relaxed relaxed ThereExists parallelism.

Returns:

z3 variable: Chained variable

__get_chained_vars_bound_constraints_at_t(timestep)

Returns chained variable bound constraints at t.

Args:

timestep (int): Current timestep

Returns:

z3 expression: z3 expressions for bound constraints at timestep t

get_chained_vars_bound_constraints_up_to_t(last_timestep)[source]

Method used to generate all bound constraints for chained variables up to time t, can be called if no constraints are needed

Args:

last_timestep (int): Final timestep

Returns:

List(z3 expression): List of z3 expressions for bound constraints up to timestep t

get_chained_vars_bound_constraints_at_t(timestep)[source]

Returns chained variable bound constraints at t. Used for incremental solving.

Args:

timestep (int): Current timestep

Returns:

z3 expression: z3 expressions for bound constraints at timestep t

__get_action_specific_action_condition_pairs(action)

Get action condition pairs corresponding to a specific action

Args:

action (BaseAction or BaseAction subclass): Action to search for in pairs

Returns:

List(Tuple(BaseAction or BaseAction subclass, condition)): List of pairs with matching actions

__assert_explanatory_axioms_at_t(timestep, fluents_list, actions_list)

Assert explanatory axioms at t (these replace frame axioms for r2ThereExists parallelism) over chained variables

Args:

timestep (int): Current timestep fluents_list (List(BaseFluent or BaseFluent subclass)): List of fluents actions_list (List(BaseAction or BaseAction subclass): List of actions

Returns:

z3 expression: z3 expression for explanatory axioms at t

generate_explanatory_axioms_up_to_t(timestep, fluents_list, actions_list)[source]

Assert explanatory axioms up to the final timestep (these replace frame axioms) over chained variables

Args:

timestep (int): Final timestep fluents_list (List(BaseFluent or BaseFluent subclass)): List of fluents actions_list (List(BaseAction or BaseAction subclass): List of actions

Returns:

List(z3 expression): List of z3 expressions for explanatory axioms up to timestep t

generate_explanatory_axioms_at_t(timestep, fluents_list, actions_list)[source]

Returns explanatory axioms at t. Used for incremental solving.

Args:

timestep (int): Current timestep fluents_list (List(BaseFluent or BaseFluent subclass)): List of fluents actions_list (List(BaseAction or BaseAction subclass): List of actions

Returns:

z3 expression: z3 expression for explanatory axioms at timestep t - 1

Assert initial and final chained variables are linked with major timestep variables Even if no actions affect this, because of the 0th chained variable independent of an affecting action this method is valid, and equivalent to current_state_var == next_state_var

Args:

timestep (int): Current timestep

Returns:

z3 expression: z3 expression for linking chained variables to major variables

Assert all initial and final chained variables are linked with major timestep variables.

Args:

timestep (int): Final timestep

Returns:

List(z3 expression): List of z3 expressions for linking chained variables to major variables

Returns constraints linking chained variables at t. Used for incremental solving.

Args:

timestep (int): Final timestep

Returns:

z3 expression: z3 expression for linking chained variables to major variables at time ‘timestep - 1’