@Override
  public CmlProofObligationList caseAModuleModules(AModuleModules node, IPOContextStack question)
      throws AnalysisException {
    IProofObligationList ovtpos =
        assistantFactory
            .createPDefinitionAssistant()
            .getProofObligations(node.getDefs(), this.declAndDefVisitor, question);
    CmlProofObligationList cmlpos = new CmlProofObligationList();
    cmlpos.addAll(ovtpos);

    return cmlpos;
  }
  @Override
  public CmlProofObligationList caseAMapSeqStateDesignator(
      AMapSeqStateDesignator node, IPOContextStack question) throws AnalysisException {

    CmlProofObligationList list = new CmlProofObligationList();

    if (node.getSeqType() != null) {
      list.add(new SeqApplyObligation(node.getMapseq(), node.getExp(), question, assistantFactory));
    }

    // Maps are OK, as you can create new map domain entries

    return list;
  }
  @Override
  public CmlProofObligationList caseACaseAlternative(
      ACaseAlternative node, IPOContextStack question) throws AnalysisException {

    CmlProofObligationList obligations = new CmlProofObligationList();

    question.push(
        new POCaseContext(node.getPattern(), node.getType(), node.getCexp(), assistantFactory));
    obligations.addAll(node.getResult().apply(this.expressionVisitor, question));
    question.pop();
    question.push(
        new PONotCaseContext(node.getPattern(), node.getType(), node.getCexp(), assistantFactory));

    return obligations;
  }
  @Override
  public CmlProofObligationList caseATixeStmtAlternative(
      ATixeStmtAlternative node, IPOContextStack question) throws AnalysisException {

    CmlProofObligationList list = new CmlProofObligationList();

    if (node.getPatternBind().getPattern() != null) {
      // Nothing to do
    } else if (node.getPatternBind().getBind() instanceof ATypeBind) {
      // Nothing to do
    } else if (node.getPatternBind().getBind() instanceof ASetBind) {
      ASetBind bind = (ASetBind) node.getPatternBind().getBind();
      list.addAll(bind.getSet().apply(this.expressionVisitor, question));
    }

    list.addAll(node.getStatement().apply(this.statementVisitor, question));
    return list;
  }
  /**
   * Run the proof obligation generator. The POs are placed in the return value but we may
   * eventually want to switch them over to the registry
   *
   * @param sources The list of definition to generate obligations for
   * @return - Returns CMLProofObligation list. This may need to change.
   */
  public CmlProofObligationList generatePOs(List<PDefinition> sources) throws AnalysisException {
    this.initialize();
    CmlProofObligationList obligations = new CmlProofObligationList();
    IPOContextStack ctxt = new POContextStack();

    // for each CML paragraph
    for (PDefinition paragraph : sources) {
      try {

        // process paragraph:
        obligations.addAll(paragraph.apply(this, ctxt));
        // obligations.addAll(paragraph.apply(overturePog, ctxt));

      } catch (AnalysisException ae) {
        // unexpected pog crash
        throw ae;
      }
    }

    obligations.renumber();
    return obligations;
  }