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

Method findModelExample1

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

Source from the content-addressed store, hash-verified

1137 // / Find a model for <code>x xor y</code>.
1138
1139 public void findModelExample1(Context ctx) throws TestFailedException
1140 {
1141 System.out.println("FindModelExample1");
1142 Log.append("FindModelExample1");
1143
1144 BoolExpr x = ctx.mkBoolConst("x");
1145 BoolExpr y = ctx.mkBoolConst("y");
1146 BoolExpr x_xor_y = ctx.mkXor(x, y);
1147
1148 Model model = check(ctx, x_xor_y, Status.SATISFIABLE);
1149 System.out.println("x = " + model.evaluate(x, false) + ", y = "
1150 + model.evaluate(y, false));
1151 }
1152
1153 // / Find a model for <tt>x < y + 1, x > 2</tt>.
1154 // / Then, assert <tt>not(x = y)</tt>, and find another model.

Callers 1

mainMethod · 0.95

Calls 5

appendMethod · 0.95
checkMethod · 0.95
evaluateMethod · 0.95
mkBoolConstMethod · 0.80
mkXorMethod · 0.80

Tested by

no test coverage detected