/** * Called by the {@link AStarStarBinaryExp} node from {@link AStarStarBinaryExp#apply(IPOFAnalysis)}. * @param node the calling {@link AStarStarBinaryExp} node */ public void caseAStarStarBinaryExp(AStarStarBinaryExp node) throws AnalysisException { _visitedNodes.add(node); inAStarStarBinaryExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this); } if(node.getOp() != null ) { node.getOp().apply(this); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this); } outAStarStarBinaryExp(node); }
/** * Called by the {@link AStarStarBinaryExp} node from {@link AStarStarBinaryExp#apply(IAnalysis)}. * @param node the calling {@link AStarStarBinaryExp} node */ public void caseAStarStarBinaryExp(AStarStarBinaryExp node) throws AnalysisException { _visitedNodes.add(node); inAStarStarBinaryExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this); } if(node.getOp() != null ) { node.getOp().apply(this); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this); } outAStarStarBinaryExp(node); }
/** * Called by the {@link AStarStarBinaryExp} node from {@link AStarStarBinaryExp#apply(IAnalysis)}. * @param node the calling {@link AStarStarBinaryExp} node */ public void caseAStarStarBinaryExp(AStarStarBinaryExp node, Q question) throws AnalysisException { _visitedNodes.add(node); inAStarStarBinaryExp(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this, question); } if(node.getOp() != null ) { node.getOp().apply(this, question); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this, question); } outAStarStarBinaryExp(node, question); }
/** * Called by the {@link AStarStarBinaryExp} node from {@link AStarStarBinaryExp#apply(IAnalysis)}. * @param node the calling {@link AStarStarBinaryExp} node */ public A caseAStarStarBinaryExp(AStarStarBinaryExp node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAStarStarBinaryExp(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { mergeReturns(retVal,node.getLeft().apply(this)); } if(node.getOp() != null ) { mergeReturns(retVal,node.getOp().apply(this)); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { mergeReturns(retVal,node.getRight().apply(this)); } mergeReturns(retVal,outAStarStarBinaryExp(node)); return retVal; }
/** * Called by the {@link AStarStarBinaryExp} node from {@link AStarStarBinaryExp#apply(IAnalysis)}. * @param node the calling {@link AStarStarBinaryExp} node */ public A caseAStarStarBinaryExp(AStarStarBinaryExp node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAStarStarBinaryExp(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { mergeReturns(retVal,node.getLeft().apply(this, question)); } if(node.getOp() != null ) { mergeReturns(retVal,node.getOp().apply(this, question)); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { mergeReturns(retVal,node.getRight().apply(this, question)); } mergeReturns(retVal,outAStarStarBinaryExp(node, question)); return retVal; }
public FuncIterationObligation(AStarStarBinaryExp exp, ILexNameToken preName, IPOContextStack ctxt, IPogAssistantFactory assistantFactory) throws AnalysisException { super(exp, POType.FUNC_ITERATION, ctxt, exp.getLocation(), assistantFactory); // n > 1 AGreaterNumericBinaryExp gTExp = AstExpressionFactory.newAGreaterNumericBinaryExp(exp.getRight().clone(), getIntLiteral(1)); // forall n :T & P(X) AForAllExp forAllExp = new AForAllExp(); ILexNameToken arg = getUnique("arg"); List<PMultipleBind> bindList = getMultipleTypeBindList(assistantFactory.createPTypeAssistant().getNumeric(exp.getRight().getType().clone()), arg); forAllExp.setBindList(bindList); forAllExp.setPredicate(getPredicate(exp.clone(), preName.clone(), arg)); // n > 1 => forall n :T & P(X) AImpliesBooleanBinaryExp impliesExp = AstExpressionFactory.newAImpliesBooleanBinaryExp(gTExp, forAllExp); stitch = impliesExp.clone(); valuetree.setPredicate(ctxt.getPredWithContext(impliesExp)); }
node.getRight().apply(THIS, noConstraint); PType rtype = node.getRight().getType(); TypeCheckerErrors.report(3170, "Map iterator expects nat as right hand arg", node.getRight().getLocation(), rtype); if (!question.assistantFactory.createPTypeAssistant().isNumeric(rtype)) TypeCheckerErrors.report(3171, "Function iterator expects nat as right hand arg", node.getRight().getLocation(), rtype); if (!question.assistantFactory.createPTypeAssistant().isNumeric(rtype)) TypeCheckerErrors.report(3172, "'**' expects number as right hand arg", node.getRight().getLocation(), rtype);
Value rv = node.getRight().apply(VdmRuntime.getExpressionEvaluator(), ctxt);