@Override public PExp caseACallStm(ACallStm stm, Integer lineno) throws AnalysisException { return af.createPExpAssistant().findExpression(stm.getArgs(), lineno); }
public OpPostConditionContext(AExplicitFunctionDefinition postDef, ACallStm stm, SOperationDefinitionBase calledOp, IPogAssistantFactory af, IPOContextStack ctxt) { super(ctxt); this.gen = ctxt.getGenerator(); this.subs = new LinkedList<Substitution>(); this.forall_exp = getChangedVarsExp(postDef, calledOp); PExp inv = buildInvExp(calledOp, af); this.pred = spellCondition(postDef, af, stm.getArgs(), inv); this.visitor = af.getVarSubVisitor(); }
public OperationCallObligation(ACallStm stm, SOperationDefinitionBase def, IPOContextStack ctxt, IPogAssistantFactory af) throws AnalysisException { super(stm, POType.OP_CALL, ctxt, stm.getLocation(), af); // cannot quote pre-cond so we spell it out with rewritten arguments List<Substitution> subs = new LinkedList<Substitution>(); for (int i = 0; i < stm.getArgs().size(); i++) { PPattern orig = def.getPredef().getParamPatternList().get(0).get(i); ILexNameToken origName = af.createPPatternAssistant().getAllVariableNames(orig).get(0).clone(); PExp new_exp = stm.getArgs().get(0); subs.add(new Substitution(origName, new_exp)); } PExp pre_exp = def.getPrecondition().clone(); for (Substitution sub : subs) { pre_exp = pre_exp.clone().apply(af.getVarSubVisitor(), sub); } stitch = pre_exp; valuetree.setPredicate(ctxt.getPredWithContext(pre_exp)); }
@Override public LexNameSet caseACallStm(ACallStm node, FreeVarInfo info) throws AnalysisException { LexNameSet names = new LexNameSet(node.getName().getExplicit(true)); for (PExp arg: node.getArgs()) { names.addAll(arg.apply(this, info)); } return names; }
List<PExp> copy = new ArrayList<PExp>(node.getArgs()); for( PExp e : copy)
List<PExp> copy = new ArrayList<PExp>(node.getArgs()); for( PExp e : copy)
List<PExp> copy = new ArrayList<PExp>(node.getArgs()); for( PExp e : copy)
List<PExp> copy = new ArrayList<PExp>(node.getArgs()); for( PExp e : copy)
List<PExp> copy = new ArrayList<PExp>(node.getArgs()); for( PExp e : copy)
@Override public IProofObligationList caseACallStm(ACallStm node, IPOContextStack question) throws AnalysisException { try { IProofObligationList obligations = new ProofObligationList(); for (PExp exp : node.getArgs()) { obligations.addAll(exp.apply(rootVisitor, question)); } // stick possible op post_condition in the context SOperationDefinitionBase calledOp = node.apply(new GetOpCallVisitor()); if (calledOp != null) { if (calledOp.getPrecondition() != null) { obligations.add(new OperationCallObligation(node, calledOp, question, aF)); } question.push(new OpPostConditionContext(calledOp.getPostdef(), node, calledOp, aF, question)); } return obligations; } catch (Exception e) { throw new POException(node, e.getMessage()); } }
args = stmt.getArgs(); } else
LinkedList<PExp> args = node.getArgs();
throws AnalysisException List<PType> atypes = getArgTypes(node.getArgs(), THIS, question);