Update java examples using the new Java API (#7225)

This PRs updates java examples using the new Java API, by converting C++ examples to Java.
Examples CVC4Streams.java and PipedInput.java are removed since they are not longer supported by the API.
All examples are not included in the build which would be added in a future PR.
This commit is contained in:
mudathirmahgoub
2021-10-01 18:21:02 -05:00
committed by GitHub
parent 6405f082a8
commit 98e884a740
36 changed files with 1732 additions and 681 deletions

View File

@@ -10,19 +10,18 @@
* directory for licensing information.
* ****************************************************************************
*
* A very simple CVC4 tutorial example.
* A very simple CVC5 tutorial example.
*/
import edu.stanford.CVC4.*;
import cvc5.*;
public class HelloWorld {
public static void main(String[] args) {
System.loadLibrary("cvc4jni");
public class HelloWorld
{
public static void main(String[] args)
{
Solver slv = new Solver();
Term helloworld = slv.mkVar(slv.getBooleanSort(), "Hello World!");
ExprManager em = new ExprManager();
Expr helloworld = em.mkVar("Hello World!", em.booleanType());
SmtEngine smt = new SmtEngine(em);
System.out.println(helloworld + " is " + smt.checkEntailed(helloworld));
System.out.println(helloworld + " is " + slv.checkEntailed(helloworld));
}
}