class Z3::ArithExpr
Public Class Methods
Source
# File lib/z3/expr/arith_expr.rb, line 79 def Div(a,b) a, b = coerce_to_same_arith_sort(a, b) a.sort.new(LowLevel.mk_div(a, b)) end
Source
# File lib/z3/expr/arith_expr.rb, line 84 def Power(a, b) # Wait, is this even legitimate that it's I**I and R**R? a, b = coerce_to_same_arith_sort(a, b) a.sort.new(LowLevel.mk_power(a, b)) end
Source
# File lib/z3/expr/arith_expr.rb, line 73 def coerce_to_same_arith_sort(*args) args = coerce_to_same_sort(*args) raise Z3::Exception, "Int or Real value expected" unless args[0].is_a?(IntExpr) or args[0].is_a?(RealExpr) args end
Public Instance Methods
Source
# File lib/z3/expr/arith_expr.rb, line 19 def **(other) ArithExpr.Power(self, other) end
Source
# File lib/z3/expr/arith_expr.rb, line 39 def -@ sort.new(LowLevel.mk_unary_minus(self)) end
Source
# File lib/z3/expr/arith_expr.rb, line 15 def /(other) ArithExpr.Div(self, other) end
Source
# File lib/z3/expr/arith_expr.rb, line 66 def coerce(other) other_sort = Expr.sort_for_const(other) max_sort = [sort, other_sort].max [max_sort.from_const(other), max_sort.from_value(self)] end
Recast so 1 + x:Float is: (+ 1.0 x) not: (+ (to_real 1) x)