up_SMT_engine.actions.BaseAction

Classes

BaseAction(grounded_action)

Simple action class, used to handle all methods for sequential plans

class up_SMT_engine.actions.BaseAction.BaseAction(grounded_action)[source]

Bases: object

Simple action class, used to handle all methods for sequential plans

get_name()[source]

Return action basename

Returns:

String: action basename

check_name_match(other_action_name)[source]

Check if the action basename matches this action’s basename

Args:

other_action_name (String): other action’s Basename

Returns:

Bool: True if matching, False otherwise

get_action_at_t(timestep)[source]

Method used to create an action at timestep t

Args:

timestep (int): Current timestep

Returns:

z3 Bool: z3 variable representing whether an action is executed at timstep t

__get_effects_at_t(timestep)

Each effect has three FNODE structures, the condition (optional, makes effect conditional), fluent (the stated variable to be changed) and the value (the new fluent value). These are separately converted into Z3, and returned as Implies(condition, (fluent == value)) These statements are And’d together, as the set of effects of the action. n.b. The fluents in the ‘fluent’ part of the effect are in the next state (time + 1), because they are the result of the current action, while all other fluents are in the current state

Args:

timestep (int): Current timestep

Returns:

List(z3 expression): A list of z3 expressions representing the effects of this action at timestep t

__get_causal_axioms_at_t(timestep)

The causal axioms assert the effects, given the action occurs

Args:

timestep (int): Current timestep

Returns:

z3 expression: A z3 expression representing the causal axioms of this action at timestep t

get_causal_axioms_up_to_t(timestep)[source]

Generate the list of causal axioms for a problem of length up to timestep t

Args:

timestep (int): Final timestep

Returns:

List(z3 expression): A list of z3 expressions representing the causal axioms of this action up to timestep t

get_causal_axioms_at_t(timestep)[source]

Get causal axioms for the final timestep

Args:

timestep (int): Final timestep

Returns:

z3 expression: A z3 expression representing the causal axioms of this action at timestep t

__get_precondition_constraints_at_t(timestep)

Generate the precondition constraints for this action at timestep t Precondition constraint is: action occuring at timestep t implies preconditions are true at timestep t

Args:

timestep (int): Current timestep

Returns:

z3 expression: A z3 expression representing the precondition constraints for this action at timestep t

get_precondition_constraints_up_to_t(timestep)[source]

Generate the list of precondition constraints for a problem of length up to timestep t

Args:

timestep (int): Final timestep

Returns:

List(z3 expression): A list of z3 expressions representing the precondition constraints of this action up to timestep t

get_precondition_constraints_at_t(timestep)[source]

Get precondition constraints for the final timestep

Args:

timestep (int): Final timestep

Returns:

z3 expression: A z3 expression representing the precondition constraints of this action at timestep t

get_effected_fluent_basename_condition_tuples()[source]

Method used to get a list of all effected fluents, and the conditions for the effect This is part of the process for sharing the information ‘which actions affect which fluents’ with fluent objects

Returns:

Tuple(String, FNODE): A tuple of a fluent basename, and a FNODE expressing the condition for that fluent being affected

deliver_effect_tuples_to_Fluents(fluents_list)[source]

Method used to deliver effect-fluent tupes for frame-axioms to the appropriate Fluent object. Should only be called once

Args:

fluents_list (List(BaseFluent or BaseFluent subclass)): List of fluents

Raises:

Exception: Raise an exception if an unknown fluent is affected by an action