Method: Z3::Expr.Xor
- Defined in:
- lib/z3/expr/expr.rb
.Xor(*args) ⇒ Object
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/z3/expr/expr.rb', line 136 def Xor(*args) args = coerce_to_same_sort(*args) case args[0] when BoolExpr args.inject do |a, b| BoolSort.new.new(Z3::LowLevel.mk_xor(a, b)) end when BitvecExpr args.inject do |a, b| a.sort.new(Z3::LowLevel.mk_bvxor(a, b)) end else raise Z3::Exception, "Can't perform logic operations on #{args[0].sort} exprs, only Bool and Bitvec" end end |