Class: BinaryFormula
- Inherits:
-
Object
show all
- Defined in:
- lib/dpll_solver/formulas/binary_formula.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of BinaryFormula.
3
4
5
6
|
# File 'lib/dpll_solver/formulas/binary_formula.rb', line 3
def initialize(f1, f2)
@f1 = f1
@f2 = f2
end
|
Instance Attribute Details
#f1 ⇒ Object
Returns the value of attribute f1.
2
3
4
|
# File 'lib/dpll_solver/formulas/binary_formula.rb', line 2
def f1
@f1
end
|
#f2 ⇒ Object
Returns the value of attribute f2.
2
3
4
|
# File 'lib/dpll_solver/formulas/binary_formula.rb', line 2
def f2
@f2
end
|
Instance Method Details
#==(other) ⇒ Object
Also known as:
eql?
8
9
10
|
# File 'lib/dpll_solver/formulas/binary_formula.rb', line 8
def ==(other)
other.class == self.class && other.f1 == @f1 && other.f2 == @f2
end
|
17
18
19
|
# File 'lib/dpll_solver/formulas/binary_formula.rb', line 17
def atomic_formula?
false
end
|
#dnf? ⇒ Boolean
25
26
27
|
# File 'lib/dpll_solver/formulas/binary_formula.rb', line 25
def dnf?
@f1.dnf? && @f2.dnf?
end
|
#literal? ⇒ Boolean
13
14
15
|
# File 'lib/dpll_solver/formulas/binary_formula.rb', line 13
def literal?
false
end
|
#nnf ⇒ Object
29
30
31
|
# File 'lib/dpll_solver/formulas/binary_formula.rb', line 29
def nnf
self.class.new(@f1.nnf, @f2.nnf)
end
|
#nnf? ⇒ Boolean
21
22
23
|
# File 'lib/dpll_solver/formulas/binary_formula.rb', line 21
def nnf?
@f1.nnf? && @f2.nnf?
end
|