MCPcopy Create free account
hub / github.com/Z3Prover/z3 / parserExample2

Method parserExample2

examples/java/JavaExample.java:1458–1472  ·  view source on GitHub ↗
(Context ctx)

Source from the content-addressed store, hash-verified

1456 // / Demonstrates how to initialize the parser symbol table.
1457
1458 public void parserExample2(Context ctx) throws TestFailedException
1459 {
1460 System.out.println("ParserExample2");
1461 Log.append("ParserExample2");
1462
1463 Symbol[] declNames = { ctx.mkSymbol("a"), ctx.mkSymbol("b") };
1464 FuncDecl a = ctx.mkConstDecl(declNames[0], ctx.mkIntSort());
1465 FuncDecl b = ctx.mkConstDecl(declNames[1], ctx.mkIntSort());
1466 FuncDecl[] decls = new FuncDecl[] { a, b };
1467
1468 BoolExpr f = ctx.parseSMTLIB2String("(assert (> a b))", null, null,
1469 declNames, decls)[0];
1470 System.out.println("formula: " + f);
1471 check(ctx, f, Status.SATISFIABLE);
1472 }
1473
1474 // / Demonstrates how to initialize the parser symbol table.
1475

Callers 1

mainMethod · 0.95

Calls 6

appendMethod · 0.95
checkMethod · 0.95
mkSymbolMethod · 0.80
mkConstDeclMethod · 0.80
mkIntSortMethod · 0.80
parseSMTLIB2StringMethod · 0.80

Tested by

no test coverage detected