Beispiel #1
0
 public boolean runTest(IEnv env) {
   try {
     TermSystem general = TermWare.getInstance().getRoot().resolveSystem("general");
     Term t = TermWare.getInstance().getTermFactory().createParsedTerm("neq(p(x),p(x))");
     Term r = general.reduce(t);
     if (!(r.isBoolean() && r.getBoolean() == false)) {
       System.out.println("r1=" + TermHelper.termToString(r));
       return false;
     }
     t = TermWare.getInstance().getTermFactory().createParsedTerm("neq(p(\"x\"),p(\"x\"))");
     r = general.reduce(t);
     if (r.isBoolean()) {
       if (r.getBoolean() == false) {
         return true;
       } else {
         return false;
       }
     } else {
       System.out.println("r2=" + TermHelper.termToString(r));
       return false;
     }
   } catch (TermWareException ex) {
     ex.printStackTrace();
     return false;
   }
 }
Beispiel #2
0
 /** @param args the command line arguments */
 public static void main(String[] args) {
   APIGen app = new APIGen();
   try {
     app.init(args);
   } catch (TermWareException ex) {
     System.err.println("exception during initialization:" + ex.getMessage());
     ex.printStackTrace();
     return;
   }
   try {
     app.process();
   } catch (IOException ex) {
     System.err.println("exception:" + ex.getMessage());
     ex.printStackTrace();
   } catch (TermWareException ex) {
     System.err.println("exception:" + ex.getMessage());
     ex.printStackTrace();
   }
 }