Specification module
GRSpec class for specifying a GR[1] specification of the form:
(env_init & []env_safety & []<>env_prog) -> (sys_init & []sys_safety & []<>sys_prog)
A GRSpec object contains the following fields:
- C{env_vars}: a list of variables (names given as strings) that are determined by the environment.
- C{env_init}: a string or a list of string that specifies the assumption about the initial state of the environment.
- C{env_safety}: a string or a list of string that specifies the assumption about the evolution of the environment state.
- C{env_prog}: a string or a list of string that specifies the justice assumption on the environment.
- C{sys_vars}: a list of variables (names given as strings) that are controlled by the system.
- C{sys_init}: a string or a list of string that specifies the requirement on the initial state of the system.
- C{sys_safety}: a string or a list of string that specifies the safety requirement.
- C{sys_prog}: a string or a list of string that specifies the progress requirement.
An empty list for any formula (e.g., if env_init = []) is marked as “True” in the specification. This corresponds to the constant Boolean function, which usually means that subformula has no effect (is non-restrictive) on the spec.
Append results of discretization (abstraction) to specification.
disc_dynamics is an instance of PropPreservingPartition, such as returned by the function discretize in module discretize.
- The cell names are not mangled, in contrast to the approach taken in the createProbFromDiscDynamics method of the SynthesisProb class.
- Any name in disc_dynamics.list_prop_symbol matching a system variable is removed from sys_vars, and its occurrences in the specification are replaced by a disjunction of corresponding cells.
- gr1c does not (yet) support variable domains beyond Boolean, so we treat each cell as a separate Boolean variable and explicitly enforce mutual exclusion.
Append specification describing a gridworld.
Basically, call the spec method of the given GridWorld object and merge with its output. See documentation about the L{spec<gridworld.GridWorld.spec>} method of L{GridWorld<gridworld.GridWorld>} class for details.
@type gworld: L{GridWorld}
RHTLPProb class for specifying a receding horizon temporal logic planning problem.
A RHTLPProb object contains the following fields:
Constructor:
RHTLPProb ([ shprobs = [][, Phi = ‘True’[, discretize = False[, file = ‘’]]]]): construct this SynthesisProb object from file.
RHTLPProb ([ shprobs = [][, Phi = ‘True’[, discretize = False[, env_vars = {}[, ` sys_disc_vars` = {}[, disc_props = {}[, disc_dynamics = None[, spec = GRSpec()]]]]]]]])
RHTLPProb ([ shprobs = [][, Phi = ‘True’[, discretize = False[, env_vars = {}[, sys_disc_vars = {}[, disc_props = {}[, cont_state_space = None[, cont_props = {}[, sys_dyn = None[, spec = GRSpec()]]]]]]])
Check whether the disjunction of all the W’s covers the entire state space.
Compute Phi for this RHTLPProb object. Return a boolean that indicates whether a valid Phi exists.
Construct the graph for W’s. There is an edge in this graph from Wi to Wj if F(Wi) = Wj.
ShortHorizonProb class for specifying a short horizon problem for receding horizon temporal logic planning.
A ShortHorizonProb object contains the following fields:
Constructor:
ShortHorizonProb ([ W = ‘’[, FW = [][, Phi = ‘’[, global_prob = SynthesisProb()[, file = ‘’]]]]])
ShortHorizonProb ([ W = ‘’[, FW = [][, Phi = ‘’[, global_prob = SynthesisProb()[, env_vars = {}[, sys_disc_vars = {}[, disc_props = {}[, disc_dynamics = None]]]]]]]])
ShortHorizonProb ([ W = ‘’[, FW = [][, Phi = ‘’[, global_prob = SynthesisProb()[, env_vars = {}[, sys_disc_vars = {}[, disc_props = {}[, cont_state_space = None[, cont_props = {}[, sys_dyn = None]]]]]]]]]])
Compute the local Phi for this ShortHorizonProb object. Return a boolean that indicates whether the local Phi gets updated. If the current prob is realizable, then the local Phi is not updated and this function will return False. Otherwise, the local Phi will get updated and this function wil return True.
Return the local invariant Phi of this short horizon problem.
SynthesisProb class for specifying a planner synthesis problem.
A SynthesisProb object contains the following fields:
Constructor:
SynthesisProb ([ file = ‘’[, verbose = 0]]): construct this SynthesisProb object from file
SynthesisProb ([ env_vars = {}[, sys_disc_vars = {}[, disc_props = {}[, disc_dynamics = None[, spec = GRSpec()[, verbose = 0]]]]]])
SynthesisProb ([ env_vars = {}[, sys_disc_vars = {}[, disc_props = {}[, cont_state_space = None[, cont_props = {}[, sys_dyn = None[, spec = GRSpec()[, verbose = 0]]]]]]]])
Determine whether this SynthesisProb is realizable without extracting an automaton.
Input:
Construct SynthesisProb from continuous dynamics.
Input:
Construct SynthesisProb from discretized continuous dynamics.
Input:
Return a list of dictionary representing a state starting from which the system cannot satisfy the spec.
Return the discrete propositions as a dictionary whose key is the symbol of the proposition and whose value is the actual formula of the proposition.
Return the environment variables of this object as a dictionary whose key is the name of the variable and whose value is the possible values that the variable can take.
Return the name of JTLV files. The smv, spc and aut files are appended by .smv, .spc and .aut, respectively.
Return the system discrete variables of this object as a dictionary whose key is the name of the variable and whose value is the possible values that the variable can take.
Return the system (discrete and discretized continuous) variables of this object as a dictionary whose key is the name of the variable and whose value is the possible values that the variable can take.
Compute a planner automaton for this SynthesisProb.
If this SynthesisProb is realizable, this function returns an Automaton object. Otherwise, it returns a list of dictionary that represents the state starting from which there exists no strategy for the system to satisfy the spec.
Input:
Generate JTLV input files: smv_file and spc_file for this SynthesisProb.
Input: