Manage interactive session with gr1c.
Given lists of environment and system variable names determine the
order of values in state vectors for communication with the gr1c process.
Eventually there may be code to infer this directly from the spec
file.
Please compile it that way if you are using this class. (Otherwise,
GNU Readline will echo commands and make interaction with gr1c more
difficult.)
The argument `prompt` is the string printed by gr1c to indicate it is
ready for the next command. The default value is a good guess.
Unless otherwise indicated, command methods return True on success,
False if error.
|
__init__(self,
spec_filename,
sys_vars,
env_vars=[ ] ,
prompt=' >>> ' ) |
|
|
|
iswinning(self,
state)
Return True if given state is in winning set, False otherwise. |
|
|
|
getindex(self,
state,
goal_mode) |
|
|
|
env_next(self,
state)
Return list of possible next environment moves, given current state. |
|
|
|
sys_nextfeas(self,
state,
env_move,
goal_mode)
Return list of next system moves consistent with some strategy. |
|
|
|
sys_nexta(self,
state,
env_move)
Return list of possible next system moves, whether or not winning. |
|
|
|
getvars(self)
Return string of environment and system variable names in order. |
|
|
|
|
|
reset(self,
spec_filename=None)
Quit and start anew, reading spec from file with given name. |
|
|
|
close(self)
End session, and kill gr1c child process. |
|
|