Method: Z3::Expr.Or

Defined in:
lib/z3/expr/expr.rb

.Or(*args) ⇒ Object



122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/z3/expr/expr.rb', line 122

def Or(*args)
  args = coerce_to_same_sort(*args)
  case args[0]
  when BoolExpr
    BoolSort.new.new(Z3::LowLevel.mk_or(args))
  when BitvecExpr
    args.inject do |a, b|
      a.sort.new(Z3::LowLevel.mk_bvor(a, b))
    end
  else
    raise Z3::Exception, "Can't perform logic operations on #{args[0].sort} exprs, only Bool and Bitvec"
  end
end