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

Method parserExample3

examples/java/JavaGenericExample.java:1261–1278  ·  view source on GitHub ↗
(Context ctx)

Source from the content-addressed store, hash-verified

1259 // / Demonstrates how to initialize the parser symbol table.
1260
1261 public void parserExample3(Context ctx) throws Exception
1262 {
1263 System.out.println("ParserExample3");
1264 Log.append("ParserExample3");
1265
1266 /* declare function g */
1267 IntSort I = ctx.mkIntSort();
1268 FuncDecl<IntSort> g = ctx.mkFuncDecl("g", new Sort[] { I, I }, I);
1269
1270 BoolExpr ca = commAxiom(ctx, g);
1271
1272 BoolExpr thm = ctx.parseSMTLIB2String(
1273 "(declare-fun (Int Int) Int) (assert (forall ((x Int) (y Int)) (=> (= x y) (= (gg x 0) (gg 0 y)))))",
1274 null, null, new Symbol[] { ctx.mkSymbol("gg") },
1275 new FuncDecl[] { g })[0];
1276 System.out.printf("formula: %s%n", thm);
1277 prove(ctx, thm, false, ca);
1278 }
1279
1280
1281 // / 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