Python Forum
model interpretation for automated theorem proving with Z3
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
model interpretation for automated theorem proving with Z3
#1
Hi, does someone know how the model output of Z3 automated theorem prover from Microsoft is interpreted?
The model output (s.model()) contains the following cryptical function description. It is not clear to me what this means. Thanks a lot for any help.

    connected = [else ->
              Or(And(If(Var(0) == Type!val!2,
                        Type!val!2,
                        If(Var(0) == Type!val!0,
                           Type!val!0,
                           Type!val!1)) ==
                     Type!val!0,
                     If(Var(1) == Type!val!2,
                        Type!val!2,
                        If(Var(1) == Type!val!0,
                           Type!val!0,
                           Type!val!1)) ==
                     Type!val!0),
                 And(If(Var(0) == Type!val!2,
                        Type!val!2,
                        If(Var(0) == Type!val!0,
                           Type!val!0,
                           Type!val!1)) ==
                     Type!val!1,
                     If(Var(1) == Type!val!2,
                        Type!val!2,
                        If(Var(1) == Type!val!0,
                           Type!val!0,
                           Type!val!1)) ==
                     Type!val!1),
                 And(If(Var(0) == Type!val!2,
                        Type!val!2,
                        If(Var(0) == Type!val!0,
                           Type!val!0,
                           Type!val!1)) ==
                     Type!val!1,
                     If(Var(1) == Type!val!2,
                        Type!val!2,
                        If(Var(1) == Type!val!0,
                           Type!val!0,
                           Type!val!1)) ==
                     Type!val!2),
                 And(If(Var(0) == Type!val!2,
                        Type!val!2,
                        If(Var(0) == Type!val!0,
                           Type!val!0,
                           Type!val!1)) ==
                     Type!val!2,
                     If(Var(1) == Type!val!2,
                        Type!val!2,
                        If(Var(1) == Type!val!0,
                           Type!val!0,
                           Type!val!1)) ==
                     Type!val!2),
                 And(If(Var(0) == Type!val!2,
                        Type!val!2,
                        If(Var(0) == Type!val!0,
                           Type!val!0,
                           Type!val!1)) ==
                     Type!val!2,
                     If(Var(1) == Type!val!2,
                        Type!val!2,
                        If(Var(1) == Type!val!0,
                           Type!val!0,
                           Type!val!1)) ==
                     Type!val!1))],
The associated code is given here:

    from z3 import *
    s=Solver()
    Type=DeclareSort("Type")
    connected=Function("connected",Type,Type,BoolSort())
    r1=Const("r1",Type)
    r2=Const("r2",Type)
    r3=Const("r3",Type)
    r4=Const("r4",Type)
    x=Const("x",Type)
    y=Const("y",Type)

    w=Function("w",Type,BoolSort())
    o=Function("o",Type,BoolSort())
        
    axioms2=w(r1),o(r2),o(r3),ForAll([x,y],
    Implies(And(w(x),w(y)),connected(x,y))),
    ForAll([x,y],Implies(And(o(x),o(y)),connected(x,y)))]
    s2=Solver()
    s2.add(axioms2)
    s2.check()
    print ("MODEL")<br>
    print (s2.model())<br>
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Cubic spline Graph Interpretation how? GREEN369 1 109 Apr-15-2024, 08:24 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020