0

I am running the following program about transitive closure of z3:

from z3 import *

def main():
    A = DeclareSort('A')
    R = Function('R', A, A, BoolSort())
    TC_R = TransitiveClosure(R)
    # TRC_R = TransitiveReflexiveClosure(R)
    s = Solver()
    a, b, c = Consts('a b c', A)
    s.add(R(a, b))
    s.add(R(b, c))
    s.add(Not(TC_R(a, c)))

    print(s.check())


if __name__ == "__main__":
    main()

The output the above program on my computer is 'sat'. However, the documents says it should produce 'unsat' and I agree with this https://theory.stanford.edu/~nikolaj/programmingz3.html#sec-transitive-closure. But I don't know why my output is different? Here is the screenshot.

windkl
  • 13
  • 4

1 Answers1

0

This looks like a bug. Please report it at: https://github.com/Z3Prover/z3/issues

alias
  • 28,120
  • 2
  • 23
  • 40