Class: Propose::Tree::Sequent
Overview
Statement indicating that a set of premises (propositional formulae) can be used to prove to a conclusion (another propositional formula).
Sequents which the premises do not prove the conclusion are called invalid.
Instance Attribute Summary collapse
-
#conclusion ⇒ Object
readonly
Returns the value of attribute conclusion.
-
#premises ⇒ Object
readonly
Returns the value of attribute premises.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #children ⇒ Object
-
#initialize(premises, conclusion) ⇒ Sequent
constructor
A new instance of Sequent.
- #inspect ⇒ Object
- #to_s ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(premises, conclusion) ⇒ Sequent
Returns a new instance of Sequent.
9 10 11 12 |
# File 'lib/propose/tree/sequent.rb', line 9 def initialize(premises, conclusion) @premises = premises @conclusion = conclusion end |
Instance Attribute Details
#conclusion ⇒ Object (readonly)
Returns the value of attribute conclusion.
7 8 9 |
# File 'lib/propose/tree/sequent.rb', line 7 def conclusion @conclusion end |
#premises ⇒ Object (readonly)
Returns the value of attribute premises.
7 8 9 |
# File 'lib/propose/tree/sequent.rb', line 7 def premises @premises end |
Instance Method Details
#==(other) ⇒ Object
14 15 16 |
# File 'lib/propose/tree/sequent.rb', line 14 def ==(other) super || @premises == other.premises && @conclusion == other.conclusion end |
#children ⇒ Object
18 19 20 |
# File 'lib/propose/tree/sequent.rb', line 18 def children premises + [conclusion] end |
#inspect ⇒ Object
22 23 24 |
# File 'lib/propose/tree/sequent.rb', line 22 def inspect "#<Sequent [#{premises.map(&:inspect).join(', ')}] ⊢ #{conclusion.inspect}" end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/propose/tree/sequent.rb', line 26 def to_s "#{premises.map(&:to_s).join(', ')} ⊢ #{conclusion}" end |