2つのZ3変数 がでなく、が同じ名前であるという事実に頼る必要があります。 は 、その確かに私はz3/examples/cにtest_capi.cからtuple_example1()を使用してから、元のコードを変更しました:Z3のユニークな変数名
// some code before that ...
x = mk_real_var(ctx, "x");
y = mk_real_var(ctx, "x"); // but now both x and y are called "x"
// some code after that ...
と、(予想通り)出力はから変更:
// some code before that ...
x = mk_real_var(ctx, "x");
y = mk_real_var(ctx, "y"); // originally y is called "y"
// some code after that ...
へ:
tuple_example1
tuple_sort: (real, real)
prove: get_x(mk_pair(x, y)) = 1 implies x = 1
valid
disprove: get_x(mk_pair(x, y)) = 1 implies y = 1
invalid
counterexample:
y -> 0.0
x -> 1.0
へ:
tuple_example1
tuple_sort: (real, real)
prove: get_x(mk_pair(x, y)) = 1 implies x = 1
valid
disprove: get_x(mk_pair(x, y)) = 1 implies y = 1
valid
BUG: unexpected result.
しかし、私がもっと見ると、Z3は本当に失敗しなかったことが分かりました。コンソールに印刷するだけの単純なドライバです。 私は先に進んで、と同じテストを書いています.yは "x"と呼ばれるintソートです。彼らは異なる種類を持っていたときに私の驚きに、Z3は同じ名前を持つ2つの変数を扱うことができる :
tuple_example1
tuple_sort: (real, real)
prove: get_x(mk_pair(x, y)) = 1 implies x = 1
valid
disprove: get_x(mk_pair(x, y)) = 1 implies y = 1
invalid
counterexample:
x -> 1.0
x -> 0
が本当に何が起こっているということですか?それともちょうど偶然でしょうか? ご協力いただきありがとうございます!