Beispiel #1
0
  /**
   * Builds a list of <code>TheoremEntry</code>s representing all available theorems for Theories
   * currently in scope of the "target file".
   *
   * <p>TODO : Currently this will not include theorems included in theories referenced from
   * included theories. That is, if the target file lists Set_Theory in its "uses" clause, and
   * Set_Theory lists Boolean_Theory in its "uses" clause, only the theorems from Set_Theory will be
   * included.
   *
   * @return The list of Theorems.
   */
  private void buildTheories() {
    myTheorems.clear();
    myPExpTheorems.clear();

    File targetFileName = myInstanceEnvironment.getTargetFile();
    ModuleID targetFileID = myInstanceEnvironment.getModuleID(targetFileName);
    List<ModuleID> availableTheories = myInstanceEnvironment.getTheories(targetFileID);
    Exp curTheorem;

    // Add local axioms to the library
    ModuleDec targetDec = myInstanceEnvironment.getModuleDec(targetFileID);
    addLocalAxioms(targetDec);

    // Add any kind of mathematical assertions from any included library
    SymbolTable curSymbolTable;
    ModuleScope bindingsInScope;
    List<Symbol> symbolsInScope;
    for (ModuleID curModule : availableTheories) {
      curSymbolTable = myInstanceEnvironment.getSymbolTable(curModule);
      bindingsInScope = curSymbolTable.getModuleScope();
      symbolsInScope = bindingsInScope.getLocalTheoremNames();

      for (Symbol s : symbolsInScope) {

        curTheorem = bindingsInScope.getLocalTheorem(s).getValue();
        addTheoremToLibrary(s.getName(), curTheorem);
      }
    }
  }
Beispiel #2
0
  private String getProofFileName() {
    File file = myInstanceEnvironment.getTargetFile();
    ModuleID cid = myInstanceEnvironment.getModuleID(file);
    file = myInstanceEnvironment.getFile(cid);
    String filename = file.toString();
    int temp = filename.indexOf(".");
    String tempfile = filename.substring(0, temp);
    String mainFileName;

    mainFileName = tempfile + ".proof";

    return mainFileName;
  }
Beispiel #3
0
 private static void printModuleDec(File file, CompileEnvironment env) {
   if (env.contains(file)) {
     ModuleDec dec = env.getModuleDec(env.getModuleID(file));
     System.out.println(dec.asString(0, 2));
   }
 }