public StateInvariantObligation(AImplicitOperationDefinition def, IPOContextStack ctxt, IPogAssistantFactory af) throws AnalysisException { super(def, POType.STATE_INV, ctxt, def.getLocation(), af); assistantFactory = af; if (def.getClassDefinition() == null) { stitch = invDefs(def.getClassDefinition()); } else { stitch = invDefs(def.getStateDefinition()); } valuetree.setPredicate(ctxt.getPredWithContext(stitch)); // valuetree.setContext(ctxt.getContextNodeList()); }
private OperationValue(AImplicitOperationDefinition def, FunctionValue precondition, FunctionValue postcondition, AStateDefinition state, boolean async) { this.impldef = def; this.expldef = null; this.name = def.getName(); this.type = (AOperationType) def.getType(); this.paramPatterns = new Vector<PPattern>(); for (APatternListTypePair ptp : def.getParameterPatterns()) { paramPatterns.addAll(ptp.getPatterns()); } this.body = def.getBody(); this.precondition = precondition; this.postcondition = postcondition; this.state = state; this.classdef = def.getClassDefinition(); this.isAsync = async; traceRT = Settings.dialect == Dialect.VDM_RT && classdef != null && !(classdef instanceof ASystemClassDefinition) && !classdef.getName().getName().equals("CPU") && !classdef.getName().getName().equals("BUS") && !name.getName().equals("thread"); }
if(node.getClassDefinition() != null && !_visitedNodes.contains(node.getClassDefinition())) node.getClassDefinition().apply(this);
if(node.getClassDefinition() != null && !_visitedNodes.contains(node.getClassDefinition())) node.getClassDefinition().apply(this);
if(node.getClassDefinition() != null && !_visitedNodes.contains(node.getClassDefinition())) node.getClassDefinition().apply(this, question);
@SuppressWarnings("unchecked") public AExplicitFunctionDefinition getPreDefinition( AImplicitOperationDefinition d, Environment base) { List<List<PPattern>> parameters = new Vector<List<PPattern>>(); List<PPattern> plist = new Vector<PPattern>(); for (APatternListTypePair pl : (LinkedList<APatternListTypePair>) d.getParameterPatterns()) { plist.addAll((Collection<PPattern>) pl.getPatterns().clone()); } AStateDefinition state = d.getState(); if (state != null) { plist.add(AstFactory.newAIdentifierPattern(state.getName().clone())); } else if (base.isVDMPP() && !af.createPAccessSpecifierAssistant().isStatic(d.getAccess())) { plist.add(AstFactory.newAIdentifierPattern(d.getName().getSelfName())); } parameters.add(plist); PExp preop = AstFactory.newAPreOpExp(d.getName().clone(), d.getPrecondition(), d.getErrors(), d.getState()); AExplicitFunctionDefinition def = AstFactory.newAExplicitFunctionDefinition(d.getName().getPreName(d.getPrecondition().getLocation()), NameScope.GLOBAL, null, af.createAOperationTypeAssistant().getPreType((AOperationType) d.getType(), state, d.getClassDefinition(), af.createPAccessSpecifierAssistant().isStatic(d.getAccess())), parameters, preop, null, null, false, null); // Operation precondition functions are effectively not static as // their expression can directly refer to instance variables, even // though at runtime these are passed via a "self" parameter. def.setAccess(af.createPAccessSpecifierAssistant().getStatic(d, false)); def.setClassDefinition(d.getClassDefinition()); return def; }
PExp postop = AstFactory.newAPostOpExp(d.getName().clone(), d.getPrecondition(), d.getPostcondition(), d.getErrors(), d.getState()); AExplicitFunctionDefinition def = AstFactory.newAExplicitFunctionDefinition(d.getName().getPostName(d.getPostcondition().getLocation()), NameScope.GLOBAL, null, af.createAOperationTypeAssistant().getPostType((AOperationType) d.getType(), state, d.getClassDefinition(), af.createPAccessSpecifierAssistant().isStatic(d.getAccess())), parameters, postop, null, null, false, null); def.setClassDefinition(d.getClassDefinition()); return def;
if(node.getClassDefinition() != null && !_visitedNodes.contains(node.getClassDefinition())) mergeReturns(retVal,node.getClassDefinition().apply(this));
if(node.getClassDefinition() != null && !_visitedNodes.contains(node.getClassDefinition())) mergeReturns(retVal,node.getClassDefinition().apply(this, question));
if (node.getName().getName().equals(node.getClassDefinition().getName().getName())) node.getClassDefinition().setHasContructors(true);
&& node.getClassDefinition() != null && node.getClassDefinition().getInvariant() != null)
&& node.getName().getName().equals(node.getClassDefinition().getName().getName())) if (ctype.getClassdef() != node.getClassDefinition()) + node.getClassDefinition().getName().getName(), node.getLocation(), node); + node.getClassDefinition().getName().getName(), node.getLocation(), node); if (node.getClassDefinition() != null && !question.assistantFactory.createPAccessSpecifierAssistant().isStatic(node.getAccess()))