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

Method parserExample3

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

Source from the content-addressed store, hash-verified

1474 // / Demonstrates how to initialize the parser symbol table.
1475
1476 public void parserExample3(Context ctx) throws Exception
1477 {
1478 System.out.println("ParserExample3");
1479 Log.append("ParserExample3");
1480
1481 /* declare function g */
1482 Sort I = ctx.mkIntSort();
1483 FuncDecl g = ctx.mkFuncDecl("g", new Sort[] { I, I }, I);
1484
1485 BoolExpr ca = commAxiom(ctx, g);
1486
1487 BoolExpr thm = ctx.parseSMTLIB2String(
1488 "(declare-fun (Int Int) Int) (assert (forall ((x Int) (y Int)) (=> (= x y) (= (gg x 0) (gg 0 y)))))",
1489 null, null, new Symbol[] { ctx.mkSymbol("gg") },
1490 new FuncDecl[] { g })[0];
1491 System.out.println("formula: " + thm);
1492 prove(ctx, thm, false, ca);
1493 }
1494
1495
1496 // / Demonstrates how to handle parser errors using Z3 error handling

Callers

nothing calls this directly

Calls 7

appendMethod · 0.95
commAxiomMethod · 0.95
proveMethod · 0.95
mkIntSortMethod · 0.80
mkFuncDeclMethod · 0.80
parseSMTLIB2StringMethod · 0.80
mkSymbolMethod · 0.80

Tested by

no test coverage detected