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

Method parserExample2

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

Source from the content-addressed store, hash-verified

1242 // / Demonstrates how to initialize the parser symbol table.
1243
1244 public void parserExample2(Context ctx) throws TestFailedException
1245 {
1246 System.out.println("ParserExample2");
1247 Log.append("ParserExample2");
1248
1249 Symbol[] declNames = { ctx.mkSymbol("a"), ctx.mkSymbol("b") };
1250 FuncDecl<IntSort> a = ctx.mkConstDecl(declNames[0], ctx.mkIntSort());
1251 FuncDecl<IntSort> b = ctx.mkConstDecl(declNames[1], ctx.mkIntSort());
1252 FuncDecl[] decls = new FuncDecl[] { a, b };
1253
1254 BoolExpr f = ctx.parseSMTLIB2String("(assert (> a b))", null, null, declNames, decls)[0];
1255 System.out.printf("formula: %s%n", f);
1256 check(ctx, f, Status.SATISFIABLE);
1257 }
1258
1259 // / Demonstrates how to initialize the parser symbol table.
1260

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