@Override public LexNameSet caseATypeDefinition(ATypeDefinition node, FreeVarInfo info) throws AnalysisException { LexNameSet names = new LexNameSet(); if (node.getType() instanceof ANamedInvariantType) { ANamedInvariantType nt = (ANamedInvariantType)node.getType(); names.addAll(nt.getType().apply(this, info)); } if (node.getInvdef() != null) { names.addAll(node.getInvdef().apply(this, info)); } return names; }
@Override public SDeclIR caseATypeDefinition(ATypeDefinition node, IRInfo question) throws AnalysisException { String access = node.getAccess().getAccess().toString(); PType type = node.getType(); SDeclIR declCg = type.apply(question.getDeclVisitor(), question); SDeclIR invCg = question.getSettings().generateInvariants() && node.getInvdef() != null ? node.getInvdef().apply(question.getDeclVisitor(), question) : null; ATypeDeclIR typeDecl = new ATypeDeclIR(); typeDecl.setAccess(access); typeDecl.setDecl(declCg); typeDecl.setInv(invCg); return typeDecl; }
@Override public IProofObligationList caseATypeDefinition(ATypeDefinition node, IPOContextStack question) throws AnalysisException { try { IProofObligationList list = new ProofObligationList(); AExplicitFunctionDefinition invDef = node.getInvdef(); if (invDef != null) { list.addAll(invDef.apply(mainVisitor, question)); list.add(new SatisfiabilityObligation(node, question, assistantFactory)); } if (node.getOrdRelation() != null) { list.addAll(node.getOrdRelation().getRelExp().apply(mainVisitor,question)); list.add(new StrictOrderRelationObligation(node, question, assistantFactory)); } if (node.getEqRelation() != null) { list.addAll(node.getEqRelation().getRelExp().apply(mainVisitor,question)); list.add(new EquivalenceRelationObligation(node,question,assistantFactory)); } return list; } catch (Exception e) { throw new POException(node, e.getMessage()); } }
Newquestion question) throws AnalysisException PDefinition invdef = node.getInvdef();
node.getInvType().setInvDef(node.getInvdef()); } else