mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 00:55:31 +00:00
fix justification for implied equalities in special relations
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
ff6d703c05
commit
56ac3f86a5
3 changed files with 34 additions and 5 deletions
20
examples/python/union_sort.py
Normal file
20
examples/python/union_sort.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Copyright Microsoft Corporation 2019
|
||||
# This example illustrates the use of union types
|
||||
# from the Python API. It is given as an example
|
||||
# as response to #2215.
|
||||
|
||||
from z3 import *
|
||||
|
||||
u = Datatype('IntOrString')
|
||||
u.declare('IntV', ('int', IntSort()))
|
||||
u.declare('StringV', ('string', StringSort()))
|
||||
IntOrString = u.create()
|
||||
StringV = IntOrString.StringV
|
||||
IntV = IntOrString.IntV
|
||||
|
||||
print(IntV(1))
|
||||
print(StringV(StringVal("abc")))
|
||||
print(IntV(1).sort())
|
||||
print(IntV(1) == StringV(StringVal("abc")))
|
||||
s = String('s')
|
||||
print(simplify(IntV(1) == StringV(s)))
|
Loading…
Add table
Add a link
Reference in a new issue