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.