def reverse_update_concrete_clauses(state,clauses=None): """ Reverse an update concretely (compute concrete pre). If unsat, throw UnsatCoreWithInterpolant. """ assert(state.pred != None and state.update != None) # can't reverse if no predecessor if clauses == None: clauses = state.clauses axioms = state.domain.background_theory(state.in_scope) fi = forward_interpolant(state.pred.clauses,state.update,clauses,state.domain.functions) if fi: raise UnsatCoreWithInterpolant(*fi) return and_clauses(reverse_image(clauses,state.update), axioms)
def reverse_update_concrete_clauses(state,clauses=None): """ Reverse an update concretely (compute concrete pre). If unsat, throw UnsatCoreWithInterpolant. """ assert(state.pred != None and state.update != None) # can't reverse if no predecessor if clauses == None: clauses = state.clauses axioms = state.domain.background_theory(state.in_scope) fi = forward_interpolant(state.pred.clauses,state.update,clauses,axioms,state.domain.functions) if fi: raise UnsatCoreWithInterpolant(*fi) return and_clauses(reverse_image(clauses,axioms,state.update), axioms)
def refine_or_reverse(goal): preds, action = arg_get_preds_action(goal.node) assert action != "join" assert len(preds) == 1 pred = preds[0] axioms = _ivy_interp.background_theory() # import IPython # IPython.embed() print "calling ivy_transrel.forward_interpolant" x = ivy_transrel.forward_interpolant(pred.clauses, action.update(_ivy_interp, None), goal.formula, axioms, None) print " got: {!r}".format(x) if x is None: bi = backward_image(goal.formula, action) return False, goal_at_arg_node(bi, pred) else: return True, x[1]
def refine_or_reverse(goal): preds, action = arg_get_preds_action(goal.node) assert action != 'join' assert len(preds) == 1 pred = preds[0] axioms = _ivy_interp.background_theory() #import IPython #IPython.embed() print "calling ivy_transrel.forward_interpolant" x = ivy_transrel.forward_interpolant( pred.clauses, action.update(_ivy_interp, None), goal.formula, axioms, None, ) print " got: {!r}".format(x) if x is None: bi = backward_image(goal.formula, action) return False, goal_at_arg_node(bi, pred) else: return True, x[1]