Examples of Smt


Examples of statechum.analysis.learning.Smt

  protected final Smt solver;
 
  public SmtLearnerDecorator(Learner learner,LabelRepresentation labels) {
    super(learner);lbl=labels;
   
    Smt.loadLibrary();Smt.closeStdOut();solver = new Smt();
  }
View Full Code Here

Examples of statechum.analysis.learning.Smt

  public Smt getSolver()
  {
    if (smtSolver != null)
      return smtSolver;
    Smt.loadLibrary();Smt.closeStdOut();
    smtSolver = new Smt();
    if (usingLowLevelFunctions) smtSolver.loadData(knownTraces);
    return smtSolver;
  }
View Full Code Here

Examples of statechum.analysis.learning.Smt

  /** Checks if a path condition corresponding to an abstract state is satisfiable.
   * @return false if a path leading to the supplied state is not satisfiable.
   */
  protected boolean checkSatisfiability(String variableDeclarations,String condition)
  {
    Smt solver = getSolver();
    solver.pushContext();
    String whatToCheck = SmtLabelRepresentation.getAssertionFromVarAndAxiom(variableDeclarations,condition);
    //System.err.println("CHECK: "+whatToCheck);
    solver.loadData(whatToCheck);
    boolean outcome = solver.check();
    solver.popContext();return outcome;   
  }
View Full Code Here

Examples of statechum.analysis.learning.Smt

  public Smt getSolver()
  {
    if (smtSolver != null)
      return smtSolver;
    Smt.loadLibrary();Smt.closeStdOut();
    smtSolver = new Smt();
    if (usingLowLevelFunctions) smtSolver.loadData(knownTraces);
    return smtSolver;
  }
View Full Code Here

Examples of statechum.analysis.learning.Smt

  /** Checks if a path condition corresponding to an abstract state is satisfiable.
   * @return false if a path leading to the supplied state is not satisfiable.
   */
  protected boolean checkSatisfiability(String variableDeclarations,String condition)
  {
    Smt solver = getSolver();
    solver.pushContext();
    String whatToCheck = LabelRepresentation.getAssertionFromVarAndAxiom(variableDeclarations,condition);
    //System.err.println("CHECK: "+whatToCheck);
    solver.loadData(whatToCheck);
    boolean outcome = solver.check();
    solver.popContext();return outcome;   
  }
View Full Code Here

Examples of statechum.analysis.learning.Smt

 
  /** Simple test, using multiple finalize. */
  @Test
  public void testYices1()
  {
    Smt smt = new Smt();
   
    smt.loadData("(define x::int)\n(assert (> x 1))");
    Assert.assertTrue(smt.check());
    smt.finalize();
    smt.finalize();
  }
View Full Code Here

Examples of statechum.analysis.learning.Smt

  /** Push/pop. */
  @Test
  public void testYices2()
  {
    Smt smt = new Smt();
   
    smt.loadData("(define x::int)\n(assert (> x 1))");
    Assert.assertTrue(smt.check());
    smt.pushContext();
    smt.loadData("(assert (< x 0))");
    Assert.assertFalse(smt.check());
    smt.popContext();
    Assert.assertTrue(smt.check());
    smt.finalize();
  }
View Full Code Here

Examples of statechum.analysis.learning.Smt

  /** Multiple contexts. */
  @Test
  public void testYices3()
  {
    Smt.closeStdOut();
    Smt smtA = new Smt();
   
    smtA.loadData("(define x::int)\n(assert (> x 1))");
    Assert.assertTrue(smtA.check());
    smtA.pushContext();
    smtA.loadData("(assert (< x 0))");
   
    Smt smtB = new Smt();
    smtB.loadData("(define x::int)\n(define y::int)\n(assert (< y 0))");
    Assert.assertTrue(smtB.check());
    Assert.assertFalse(smtA.check());
    Assert.assertTrue(smtB.check());
    smtA.popContext();
    smtB.loadData("(assert (> y 4))");
    Assert.assertTrue(smtA.check());
    Assert.assertFalse(smtB.check());
    smtA.finalize();
    Smt.reopenStdOut();
  }
View Full Code Here

Examples of statechum.analysis.learning.Smt

  @Test
  public void testYices_error1()
  {
   
    checkForCorrectException(new whatToRun() { public @Override void run() throws NumberFormatException {
      Smt smt = new Smt();smt.loadData("(define x::int)\n(assert (A> x 1))");
    }}, IllegalArgumentException.class,"Undefined name \"A>\"");
  }
View Full Code Here

Examples of statechum.analysis.learning.Smt

  /** Checks that if type checking is not enabled, the error goes undetected. */
  @Test
  public void testYices_error2_not_reported()
  {
    Smt.configureYices(-1, false);
    Smt smt = new Smt();smt.loadData("(define x::bool)\n(assert (> x 1))");
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.