/** * Called by the {@link AClassInvariantStm} node from {@link AClassInvariantStm#apply(IAnalysis)}. * @param node the calling {@link AClassInvariantStm} node */ public void caseAClassInvariantStm(AClassInvariantStm node, Q question) throws AnalysisException { _visitedNodes.add(node); inAClassInvariantStm(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getName() != null ) { node.getName().apply(this, question); } { List<PDefinition> copy = new ArrayList<PDefinition>(node.getInvDefs()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this, question); } } } outAClassInvariantStm(node, question); }
/** * Called by the {@link AClassInvariantStm} node from {@link AClassInvariantStm#apply(IAnalysis)}. * @param node the calling {@link AClassInvariantStm} node */ public void caseAClassInvariantStm(AClassInvariantStm node) throws AnalysisException { _visitedNodes.add(node); inAClassInvariantStm(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getName() != null ) { node.getName().apply(this); } { List<PDefinition> copy = new ArrayList<PDefinition>(node.getInvDefs()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } outAClassInvariantStm(node); }
/** * Called by the {@link AClassInvariantStm} node from {@link AClassInvariantStm#apply(IPOFAnalysis)}. * @param node the calling {@link AClassInvariantStm} node */ public void caseAClassInvariantStm(AClassInvariantStm node) throws AnalysisException { _visitedNodes.add(node); inAClassInvariantStm(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getName() != null ) { node.getName().apply(this); } { List<PDefinition> copy = new ArrayList<PDefinition>(node.getInvDefs()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } outAClassInvariantStm(node); }
for (PDefinition d : node.getInvDefs())
/** * Called by the {@link AClassInvariantStm} node from {@link AClassInvariantStm#apply(IAnalysis)}. * @param node the calling {@link AClassInvariantStm} node */ public A caseAClassInvariantStm(AClassInvariantStm node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAClassInvariantStm(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } if(node.getName() != null ) { mergeReturns(retVal,node.getName().apply(this, question)); } { List<PDefinition> copy = new ArrayList<PDefinition>(node.getInvDefs()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this, question)); } } } mergeReturns(retVal,outAClassInvariantStm(node, question)); return retVal; }
/** * Called by the {@link AClassInvariantStm} node from {@link AClassInvariantStm#apply(IAnalysis)}. * @param node the calling {@link AClassInvariantStm} node */ public A caseAClassInvariantStm(AClassInvariantStm node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAClassInvariantStm(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } if(node.getName() != null ) { mergeReturns(retVal,node.getName().apply(this)); } { List<PDefinition> copy = new ArrayList<PDefinition>(node.getInvDefs()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this)); } } } mergeReturns(retVal,outAClassInvariantStm(node)); return retVal; }
@Override public Value caseAClassInvariantStm(AClassInvariantStm node, Context ctxt) throws AnalysisException { for (PDefinition d : node.getInvDefs()) { AClassInvariantDefinition invdef = (AClassInvariantDefinition) d; try { if (!invdef.getExpression().apply(VdmRuntime.getStatementEvaluator(), ctxt).boolValue(ctxt)) { return new BooleanValue(false); } } catch (ValueException e) { VdmRuntimeError.abort(node.getLocation(), e); } } return new BooleanValue(true); }