def int_update(self,domain,pvars): update = null_update() axioms = domain.background_theory(pvars) for op in self.args: thing = op.int_update(domain,pvars); # print "op: {}, thing: {}".format(op,thing) update = compose_updates(update,thing) return update
def int_update(self, domain, pvars): update = null_update() axioms = domain.background_theory(pvars) for op in self.args: thing = op.int_update(domain, pvars) # print "op: {}, thing: {}".format(op,thing) update = compose_updates(update, thing) return update
def __init__(self,ast,action_name,action,state,clauses): super(IvyActionFailedError,self).__init__(ast,'precondition of "{}" failed'.format(action_name)) err_state = state.domain.new_state(clauses) err_state.pred = state err_state.action = action err_state.action_name = action_name err_state.update = null_update() # print "err_state.clauses: {}".format(err_state.clauses) self.error_state = err_state
def __init__(self,ast,action_name,action,state,clauses,trans): super(IvyActionFailedError,self).__init__(ast,'precondition of "{}" failed'.format(action_name)) err_state = state.domain.new_state(clauses) err_state.pred = state err_state.action = action err_state.action_name = action_name err_state.update = null_update() # print "err_state.clauses: {}".format(err_state.clauses) self.error_state = err_state self.conc = (trans[0],action_name,action,trans[1])
def get_update_axioms(self,updated,action): # print "get_update_axioms: {}, {}".format(map(str,updated),action) for x in updated: if x in self.dependencies.symbols: updated = updated + [y for y in self.defines.symbols if y not in updated] try: precond,postcond = next(y for y in (p.match(action) for p in self.patterns.args) if y != None) except StopIteration: raise IvyError(action,'No matching update axiom for ' + str(x)) postcond = state_to_action(SemStateValue(updated,postcond,precond)) # print "update axioms: {}, {}, {}".format(map(str,postcond[0]),postcond[1],postcond[2]) return SemActionValue(updated,postcond.trans,precond) return null_update()
def get_update_axioms(self, updated, action): # print "get_update_axioms: {}, {}".format(map(str,updated),action) for x in updated: if x in self.dependencies.symbols: updated = updated + [ y for y in self.defines.symbols if y not in updated ] try: precond, postcond = next( y for y in (p.match(action) for p in self.patterns.args) if y != None) except StopIteration: raise IvyError(action, 'No matching update axiom for ' + str(x)) postcond = state_to_action( SemStateValue(updated, postcond, precond)) # print "update axioms: {}, {}, {}".format(map(str,postcond[0]),postcond[1],postcond[2]) return SemActionValue(updated, postcond.trans, precond) return null_update()
def get(self, x): return null_update()