Class: PropLogic::DefaultIncrementalSolver
- Inherits:
-
Object
- Object
- PropLogic::DefaultIncrementalSolver
- Defined in:
- lib/prop_logic/default_incremental_solver.rb
Overview
Default implementation of incremental SAT solver. Provided for reference implementation and avoiding non-existent error. (Using normal solver, not incrementally)
Instance Attribute Summary collapse
-
#term ⇒ Object
readonly
Current term.
Instance Method Summary collapse
-
#add(*terms) ⇒ DefaultIncrementalSolver
(also: #<<)
Adding new terms to this solver.
-
#initialize(term) ⇒ DefaultIncrementalSolver
constructor
A new instance of DefaultIncrementalSolver.
-
#sat? ⇒ Term, false
Check satisfiability of terms.
Constructor Details
#initialize(term) ⇒ DefaultIncrementalSolver
Returns a new instance of DefaultIncrementalSolver.
9 10 11 |
# File 'lib/prop_logic/default_incremental_solver.rb', line 9 def initialize(term) @term = term end |
Instance Attribute Details
#term ⇒ Object (readonly)
Current term
14 15 16 |
# File 'lib/prop_logic/default_incremental_solver.rb', line 14 def term @term end |
Instance Method Details
#add(*terms) ⇒ DefaultIncrementalSolver Also known as: <<
Adding new terms to this solver.
19 20 21 22 |
# File 'lib/prop_logic/default_incremental_solver.rb', line 19 def add(*terms) @term = @term.and(*terms) self end |
#sat? ⇒ Term, false
Check satisfiability of terms.
29 30 31 |
# File 'lib/prop_logic/default_incremental_solver.rb', line 29 def sat? @term.sat? end |