1111"""
1212cvc5 is an SMT solver.
1313
14- This is its (as much as possible) Z3-compatible python interface .
14+ This is its pythonic API that is (as much as possible) Z3-compatible.
1515
1616Several online tutorials for Z3Py are available at:
1717http://rise4fun.com/Z3Py/tutorial/guide
6868 * as expected
6969 * Some pretty printing
7070"""
71- from .z3printer import *
71+ from .cvc5_pythonic_printer import *
7272from fractions import Fraction
7373from decimal import Decimal
7474import ctypes
@@ -7060,7 +7060,7 @@ def fpToFP(a1, a2=None, a3=None, ctx=None):
70607060 elif is_fprm (a1 ) and is_bv (a2 ) and is_fp_sort (a3 ):
70617061 return fpSignedToFP (a1 , a2 , a3 , ctx )
70627062 else :
7063- raise Z3Exception ("Unsupported combination of arguments for conversion to floating-point term." )
7063+ raise SMTException ("Unsupported combination of arguments for conversion to floating-point term." )
70647064
70657065
70667066def fpBVToFP (v , sort , ctx = None ):
@@ -7250,13 +7250,13 @@ def _valid_accessor(acc):
72507250
72517251
72527252class Datatype :
7253- """Helper class for declaring Z3 datatypes.
7253+ """Helper class for declaring datatypes.
72547254
72557255 >>> List = Datatype('List')
72567256 >>> List.declare('cons', ('car', IntSort()), ('cdr', List))
72577257 >>> List.declare('nil')
72587258 >>> List = List.create()
7259- >>> # List is now a Z3 declaration
7259+ >>> # List is now a declaration
72607260 >>> List.nil
72617261 nil
72627262 >>> List.cons(10, List.nil)
@@ -7413,7 +7413,7 @@ def CreateDatatypes(*ds):
74137413 ftype = uninterp_sorts [ftype .name ]
74147414 else :
74157415 if debugging ():
7416- _assert (is_sort (ftype ), "Z3 sort expected" )
7416+ _assert (is_sort (ftype ), "sort expected" )
74177417 ftype = ftype .ast
74187418 con .addSelector (fname , ftype )
74197419 decl .addConstructor (con )
@@ -7447,13 +7447,13 @@ def __init__(self, ast, ctx=None):
74477447 self .dt = ast .getDatatype ()
74487448
74497449 def num_constructors (self ):
7450- """Return the number of constructors in the given Z3 datatype.
7450+ """Return the number of constructors in the given datatype.
74517451
74527452 >>> List = Datatype('List')
74537453 >>> List.declare('cons', ('car', IntSort()), ('cdr', List))
74547454 >>> List.declare('nil')
74557455 >>> List = List.create()
7456- >>> # List is now a Z3 declaration
7456+ >>> # List is now a declaration
74577457 >>> List.num_constructors()
74587458 2
74597459 """
@@ -7466,7 +7466,7 @@ def constructor(self, idx):
74667466 >>> List.declare('cons', ('car', IntSort()), ('cdr', List))
74677467 >>> List.declare('nil')
74687468 >>> List = List.create()
7469- >>> # List is now a Z3 declaration
7469+ >>> # List is now a declaration
74707470 >>> List.num_constructors()
74717471 2
74727472 >>> List.constructor(0)
@@ -7703,7 +7703,7 @@ class DatatypeRef(ExprRef):
77037703
77047704 def sort (self ):
77057705 """Return the datatype sort of the datatype expression `self`."""
7706- return DatatypeSortRef (self .as_ast (), self .ctx )
7706+ return DatatypeSortRef (self .as_ast (). getSort () , self .ctx )
77077707
77087708
77097709def TupleSort (name , sorts , ctx = None ):
0 commit comments