Class: Z3::FloatExpr
Instance Attribute Summary
Attributes inherited from Expr
Attributes inherited from AST
Class Method Summary collapse
- .Add(a, b, m) ⇒ Object
- .coerce_to_mode_sort(m) ⇒ Object
- .coerce_to_same_float_sort(*args) ⇒ Object
- .Div(a, b, m) ⇒ Object
- .Eq(a, b) ⇒ Object
- .Ge(a, b) ⇒ Object
- .Gt(a, b) ⇒ Object
- .Le(a, b) ⇒ Object
- .Lt(a, b) ⇒ Object
-
.Max(a, b) ⇒ Object
In older versons, this dies when trying to calll Z3_get_ast_kind, min works on same call Works in 4.6.
- .Min(a, b) ⇒ Object
- .Mul(a, b, m) ⇒ Object
- .Ne(a, b) ⇒ Object
- .Rem(a, b) ⇒ Object
- .Sub(a, b, m) ⇒ Object
Instance Method Summary collapse
- #!=(other) ⇒ Object
- #-@ ⇒ Object
- #<(other) ⇒ Object
- #<=(other) ⇒ Object
- #==(other) ⇒ Object
- #>(other) ⇒ Object
- #>=(other) ⇒ Object
- #abs ⇒ Object
- #add(other, mode) ⇒ Object
- #div(other, mode) ⇒ Object
- #exponent_string(biased) ⇒ Object
- #infinite? ⇒ Boolean
- #max(other) ⇒ Object
- #min(other) ⇒ Object
- #mul(other, mode) ⇒ Object
- #nan? ⇒ Boolean
- #negative? ⇒ Boolean
- #nonzero? ⇒ Boolean
- #normal? ⇒ Boolean
- #positive? ⇒ Boolean
- #rem(other) ⇒ Object
- #significand_string ⇒ Object
- #sub(other, mode) ⇒ Object
- #subnormal? ⇒ Boolean
- #zero? ⇒ Boolean
Methods inherited from Expr
And, Distinct, Or, Xor, coerce_to_same_sort, #initialize, #inspect, new_from_pointer, sort_for_const
Methods inherited from AST
#arguments, #ast_kind, #eql?, #func_decl, #hash, #initialize, #sexpr, #simplify, #to_s
Constructor Details
This class inherits a constructor from Z3::Expr
Class Method Details
permalink .Add(a, b, m) ⇒ Object
[View source]
147 148 149 150 151 |
# File 'lib/z3/expr/float_expr.rb', line 147 def Add(a, b, m) a, b = coerce_to_same_float_sort(a, b) m = coerce_to_mode_sort(m) a.sort.new(LowLevel.mk_fpa_add(m, a, b)) end |
permalink .coerce_to_mode_sort(m) ⇒ Object
113 114 115 116 |
# File 'lib/z3/expr/float_expr.rb', line 113 def coerce_to_mode_sort(m) raise Z3::Exception, "Mode expected" unless m.is_a?(RoundingModeExpr) m end |
permalink .coerce_to_same_float_sort(*args) ⇒ Object
107 108 109 110 111 |
# File 'lib/z3/expr/float_expr.rb', line 107 def coerce_to_same_float_sort(*args) args = coerce_to_same_sort(*args) raise Z3::Exception, "Float value with same sizes expected" unless args[0].is_a?(FloatExpr) args end |
permalink .Div(a, b, m) ⇒ Object
[View source]
165 166 167 168 169 |
# File 'lib/z3/expr/float_expr.rb', line 165 def Div(a, b, m) a, b = coerce_to_same_float_sort(a, b) m = coerce_to_mode_sort(m) a.sort.new(LowLevel.mk_fpa_div(m, a, b)) end |
permalink .Eq(a, b) ⇒ Object
[View source]
118 119 120 121 |
# File 'lib/z3/expr/float_expr.rb', line 118 def Eq(a, b) a, b = coerce_to_same_float_sort(a, b) BoolSort.new.new(LowLevel.mk_fpa_eq(a, b)) end |
permalink .Ge(a, b) ⇒ Object
[View source]
137 138 139 140 |
# File 'lib/z3/expr/float_expr.rb', line 137 def Ge(a, b) a, b = coerce_to_same_float_sort(a, b) BoolSort.new.new(LowLevel.mk_fpa_geq(a, b)) end |
permalink .Gt(a, b) ⇒ Object
[View source]
127 128 129 130 |
# File 'lib/z3/expr/float_expr.rb', line 127 def Gt(a, b) a, b = coerce_to_same_float_sort(a, b) BoolSort.new.new(LowLevel.mk_fpa_gt(a, b)) end |
permalink .Le(a, b) ⇒ Object
[View source]
142 143 144 145 |
# File 'lib/z3/expr/float_expr.rb', line 142 def Le(a, b) a, b = coerce_to_same_float_sort(a, b) BoolSort.new.new(LowLevel.mk_fpa_leq(a, b)) end |
permalink .Lt(a, b) ⇒ Object
[View source]
132 133 134 135 |
# File 'lib/z3/expr/float_expr.rb', line 132 def Lt(a, b) a, b = coerce_to_same_float_sort(a, b) BoolSort.new.new(LowLevel.mk_fpa_lt(a, b)) end |
permalink .Max(a, b) ⇒ Object
In older versons, this dies when trying to calll Z3_get_ast_kind, min works on same call Works in 4.6
178 179 180 181 |
# File 'lib/z3/expr/float_expr.rb', line 178 def Max(a, b) a, b = coerce_to_same_float_sort(a, b) a.sort.new(LowLevel.mk_fpa_max(a, b)) end |
permalink .Min(a, b) ⇒ Object
[View source]
183 184 185 186 |
# File 'lib/z3/expr/float_expr.rb', line 183 def Min(a, b) a, b = coerce_to_same_float_sort(a, b) a.sort.new(LowLevel.mk_fpa_min(a, b)) end |
permalink .Mul(a, b, m) ⇒ Object
[View source]
159 160 161 162 163 |
# File 'lib/z3/expr/float_expr.rb', line 159 def Mul(a, b, m) a, b = coerce_to_same_float_sort(a, b) m = coerce_to_mode_sort(m) a.sort.new(LowLevel.mk_fpa_mul(m, a, b)) end |
permalink .Ne(a, b) ⇒ Object
[View source]
123 124 125 |
# File 'lib/z3/expr/float_expr.rb', line 123 def Ne(a, b) ~Eq(a,b) end |
permalink .Rem(a, b) ⇒ Object
[View source]
171 172 173 174 |
# File 'lib/z3/expr/float_expr.rb', line 171 def Rem(a, b) a, b = coerce_to_same_float_sort(a, b) a.sort.new(LowLevel.mk_fpa_rem(a, b)) end |
permalink .Sub(a, b, m) ⇒ Object
[View source]
153 154 155 156 157 |
# File 'lib/z3/expr/float_expr.rb', line 153 def Sub(a, b, m) a, b = coerce_to_same_float_sort(a, b) m = coerce_to_mode_sort(m) a.sort.new(LowLevel.mk_fpa_sub(m, a, b)) end |
Instance Method Details
permalink #!=(other) ⇒ Object
[View source]
8 9 10 |
# File 'lib/z3/expr/float_expr.rb', line 8 def !=(other) FloatExpr.Ne(self, other) end |
permalink #-@ ⇒ Object
[View source]
52 53 54 |
# File 'lib/z3/expr/float_expr.rb', line 52 def -@ sort.new LowLevel.mk_fpa_neg(self) end |
permalink #<(other) ⇒ Object
[View source]
12 13 14 |
# File 'lib/z3/expr/float_expr.rb', line 12 def <(other) FloatExpr.Lt(self, other) end |
permalink #<=(other) ⇒ Object
[View source]
16 17 18 |
# File 'lib/z3/expr/float_expr.rb', line 16 def <=(other) FloatExpr.Le(self, other) end |
permalink #==(other) ⇒ Object
[View source]
4 5 6 |
# File 'lib/z3/expr/float_expr.rb', line 4 def ==(other) FloatExpr.Eq(self, other) end |
permalink #>(other) ⇒ Object
[View source]
20 21 22 |
# File 'lib/z3/expr/float_expr.rb', line 20 def >(other) FloatExpr.Gt(self, other) end |
permalink #>=(other) ⇒ Object
[View source]
24 25 26 |
# File 'lib/z3/expr/float_expr.rb', line 24 def >=(other) FloatExpr.Ge(self, other) end |
permalink #abs ⇒ Object
[View source]
48 49 50 |
# File 'lib/z3/expr/float_expr.rb', line 48 def abs sort.new LowLevel.mk_fpa_abs(self) end |
permalink #add(other, mode) ⇒ Object
[View source]
28 29 30 |
# File 'lib/z3/expr/float_expr.rb', line 28 def add(other, mode) FloatExpr.Add(self, other, mode) end |
permalink #div(other, mode) ⇒ Object
[View source]
40 41 42 |
# File 'lib/z3/expr/float_expr.rb', line 40 def div(other, mode) FloatExpr.Div(self, other, mode) end |
permalink #exponent_string(biased) ⇒ Object
[View source]
96 97 98 |
# File 'lib/z3/expr/float_expr.rb', line 96 def exponent_string(biased) LowLevel.fpa_get_numeral_exponent_string(self, biased) end |
permalink #infinite? ⇒ Boolean
56 57 58 |
# File 'lib/z3/expr/float_expr.rb', line 56 def infinite? BoolSort.new.new LowLevel.mk_fpa_is_infinite(self) end |
permalink #max(other) ⇒ Object
[View source]
88 89 90 |
# File 'lib/z3/expr/float_expr.rb', line 88 def max(other) FloatExpr.Max(self, other) end |
permalink #min(other) ⇒ Object
[View source]
92 93 94 |
# File 'lib/z3/expr/float_expr.rb', line 92 def min(other) FloatExpr.Min(self, other) end |
permalink #mul(other, mode) ⇒ Object
[View source]
36 37 38 |
# File 'lib/z3/expr/float_expr.rb', line 36 def mul(other, mode) FloatExpr.Mul(self, other, mode) end |
permalink #nan? ⇒ Boolean
60 61 62 |
# File 'lib/z3/expr/float_expr.rb', line 60 def nan? BoolSort.new.new LowLevel.mk_fpa_is_nan(self) end |
permalink #negative? ⇒ Boolean
64 65 66 |
# File 'lib/z3/expr/float_expr.rb', line 64 def negative? BoolSort.new.new LowLevel.mk_fpa_is_negative(self) end |
permalink #nonzero? ⇒ Boolean
84 85 86 |
# File 'lib/z3/expr/float_expr.rb', line 84 def nonzero? Z3.And(~zero?, ~nan?) end |
permalink #normal? ⇒ Boolean
68 69 70 |
# File 'lib/z3/expr/float_expr.rb', line 68 def normal? BoolSort.new.new LowLevel.mk_fpa_is_normal(self) end |
permalink #positive? ⇒ Boolean
72 73 74 |
# File 'lib/z3/expr/float_expr.rb', line 72 def positive? BoolSort.new.new LowLevel.mk_fpa_is_positive(self) end |
permalink #rem(other) ⇒ Object
[View source]
44 45 46 |
# File 'lib/z3/expr/float_expr.rb', line 44 def rem(other) FloatExpr.Rem(self, other) end |
permalink #significand_string ⇒ Object
[View source]
100 101 102 |
# File 'lib/z3/expr/float_expr.rb', line 100 def significand_string LowLevel.fpa_get_numeral_significand_string(self) end |
permalink #sub(other, mode) ⇒ Object
[View source]
32 33 34 |
# File 'lib/z3/expr/float_expr.rb', line 32 def sub(other, mode) FloatExpr.Sub(self, other, mode) end |
permalink #subnormal? ⇒ Boolean
76 77 78 |
# File 'lib/z3/expr/float_expr.rb', line 76 def subnormal? BoolSort.new.new LowLevel.mk_fpa_is_subnormal(self) end |
permalink #zero? ⇒ Boolean
80 81 82 |
# File 'lib/z3/expr/float_expr.rb', line 80 def zero? BoolSort.new.new LowLevel.mk_fpa_is_zero(self) end |