Module: MagicLogic::Operator
- Included in:
- Base
- Defined in:
- lib/magic_logic.rb
Instance Method Summary collapse
Instance Method Details
#*(q) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/magic_logic.rb', line 12 def *(q) case q when Taut then self when UTaut then $utout when self then self else if neg?(q) then $utout else FORM.new([self, q], :*) end end end |
#+(q) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/magic_logic.rb', line 24 def +(q) case q when Taut then $tout when UTaut then self when self then self else if neg?(q) then $tout else FORM.new([self, q], :+) end end end |
#<=>(q) ⇒ Object
40 41 42 |
# File 'lib/magic_logic.rb', line 40 def <=>(q) (self >= q) * (q >= self) end |
#>=(q) ⇒ Object
36 37 38 |
# File 'lib/magic_logic.rb', line 36 def >=(q) (~self + q) end |
#~@ ⇒ Object
5 6 7 8 9 10 |
# File 'lib/magic_logic.rb', line 5 def ~@ if is_neg? then p elsif is_form? then vars.map(&:~).inject(reope) else NEG.new(self) end end |