@@ -77,78 +77,118 @@ def __init__(self, name: str, datatype: T, distribution: rv_generic = None, hidd
77
77
def __repr__ (self ):
78
78
return f"{ self .typestring ()} : { self .name } ::{ self .datatype .__name__ } "
79
79
80
- def __ge__ (self , other : Any ) -> BoolRef :
81
- """Create the Z3 expression `other >= self`.
80
+ # Thin wrapper for Z1 functions
81
+
82
+ def __add__ (self , other : Any ) -> BoolRef :
83
+ """Create the Z3 expression `self + other`.
82
84
83
85
:param any other: The object to compare against.
84
- :return: The Z3 expression `other >= self `.
86
+ :return: The Z3 expression `self + other `.
85
87
:rtype: BoolRef
86
88
"""
87
- return self .z3 .__ge__ (_coerce (other ))
89
+ return self .z3 .__add__ (_coerce (other ))
88
90
89
- def __le__ (self , other : Any ) -> BoolRef :
90
- """Create the Z3 expression `other <= self `.
91
+ def __ge__ (self , other : Any ) -> BoolRef :
92
+ """Create the Z3 expression `self >= other `.
91
93
92
94
:param any other: The object to compare against.
93
- :return: The Z3 expression `other >= self `.
95
+ :return: The Z3 expression `self >= other `.
94
96
:rtype: BoolRef
95
97
"""
96
- return self .z3 .__le__ (_coerce (other ))
98
+ return self .z3 .__ge__ (_coerce (other ))
97
99
98
100
def __gt__ (self , other : Any ) -> BoolRef :
99
- """Create the Z3 expression `other > self `.
101
+ """Create the Z3 expression `self > other `.
100
102
101
103
:param any other: The object to compare against.
102
- :return: The Z3 expression `other >= self `.
104
+ :return: The Z3 expression `self > other `.
103
105
:rtype: BoolRef
104
106
"""
105
107
return self .z3 .__gt__ (_coerce (other ))
106
108
109
+ def __le__ (self , other : Any ) -> BoolRef :
110
+ """Create the Z3 expression `self <= other`.
111
+
112
+ :param any other: The object to compare against.
113
+ :return: The Z3 expression `self <= other`.
114
+ :rtype: BoolRef
115
+ """
116
+ return self .z3 .__le__ (_coerce (other ))
117
+
107
118
def __lt__ (self , other : Any ) -> BoolRef :
108
- """Create the Z3 expression `other < self `.
119
+ """Create the Z3 expression `self < other `.
109
120
110
121
:param any other: The object to compare against.
111
- :return: The Z3 expression `other >= self `.
122
+ :return: The Z3 expression `self < other `.
112
123
:rtype: BoolRef
113
124
"""
114
125
return self .z3 .__lt__ (_coerce (other ))
115
126
127
+ def __mod__ (self , other : Any ) -> BoolRef :
128
+ """Create the Z3 expression `self % other`.
129
+
130
+ :param any other: The object to compare against.
131
+ :return: The Z3 expression `self % other`.
132
+ :rtype: BoolRef
133
+ """
134
+ return self .z3 .__mod__ (_coerce (other ))
135
+
116
136
def __mul__ (self , other : Any ) -> BoolRef :
117
- """Create the Z3 expression `other * self `.
137
+ """Create the Z3 expression `self * other `.
118
138
119
139
:param any other: The object to compare against.
120
- :return: The Z3 expression `other >= self `.
140
+ :return: The Z3 expression `self * other `.
121
141
:rtype: BoolRef
122
142
"""
123
143
return self .z3 .__mul__ (_coerce (other ))
124
144
125
- def __sub__ (self , other : Any ) -> BoolRef :
126
- """Create the Z3 expression `other * self `.
145
+ def __ne__ (self , other : Any ) -> BoolRef :
146
+ """Create the Z3 expression `self != other `.
127
147
128
148
:param any other: The object to compare against.
129
- :return: The Z3 expression `other >= self `.
149
+ :return: The Z3 expression `self != other `.
130
150
:rtype: BoolRef
131
151
"""
132
- return self .z3 .__sub__ (_coerce (other ))
152
+ return self .z3 .__ne__ (_coerce (other ))
133
153
134
- def __add__ (self , other : Any ) -> BoolRef :
135
- """Create the Z3 expression `other * self`.
154
+ def __neg__ (self ) -> BoolRef :
155
+ """Create the Z3 expression `- self`.
136
156
137
157
:param any other: The object to compare against.
138
- :return: The Z3 expression `other >= self`.
158
+ :return: The Z3 expression `- self`.
139
159
:rtype: BoolRef
140
160
"""
141
- return self .z3 .__add__ (_coerce (other ))
161
+ return self .z3 .__neg__ ()
162
+
163
+ def __pow__ (self , other : Any ) -> BoolRef :
164
+ """Create the Z3 expression `self ^ other`.
165
+
166
+ :param any other: The object to compare against.
167
+ :return: The Z3 expression `self ^ other`.
168
+ :rtype: BoolRef
169
+ """
170
+ return self .z3 .__pow__ (_coerce (other ))
171
+
172
+ def __sub__ (self , other : Any ) -> BoolRef :
173
+ """Create the Z3 expression `self - other`.
174
+
175
+ :param any other: The object to compare against.
176
+ :return: The Z3 expression `self - other`.
177
+ :rtype: BoolRef
178
+ """
179
+ return self .z3 .__sub__ (_coerce (other ))
142
180
143
181
def __truediv__ (self , other : Any ) -> BoolRef :
144
- """Create the Z3 expression `other * self `.
182
+ """Create the Z3 expression `self / other `.
145
183
146
184
:param any other: The object to compare against.
147
- :return: The Z3 expression `other >= self `.
185
+ :return: The Z3 expression `self / other `.
148
186
:rtype: BoolRef
149
187
"""
150
188
return self .z3 .__truediv__ (_coerce (other ))
151
189
190
+ # End thin wrapper
191
+
152
192
def cast (self , val : Any ) -> T :
153
193
"""Cast the supplied value to the datatype T of the variable.
154
194
0 commit comments