Class: Axiom::Function::Proposition::Tautology

Inherits:
Axiom::Function::Proposition show all
Includes:
Connective::Negation::Methods
Defined in:
lib/axiom/function/proposition/tautology.rb

Overview

A class representing a tautology

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Connective::Negation::Methods

#not

Methods included from Aliasable

#inheritable_alias

Methods inherited from Axiom::Function::Proposition

#call, coerce, #inverse, #rename, type

Methods inherited from Axiom::Function

extract_value, rename_attributes, #type

Methods included from Visitable

#accept

Class Method Details

.calltrue

Evaluate the proposition

Examples:

Tautology.call  # => true

Returns:

  • (true)


31
32
33
# File 'lib/axiom/function/proposition/tautology.rb', line 31

def self.call
  true
end

.inverseClass<Contradiction>

Return the inverse proposition class

Examples:

Tautology.inverse  # => Contradiction

Returns:



19
20
21
# File 'lib/axiom/function/proposition/tautology.rb', line 19

def self.inverse
  Contradiction
end

Instance Method Details

#and(other) ⇒ Function

Logically AND the proposition with another expression

Examples:

tautology.and(other)  # => other

Parameters:

Returns:



45
46
47
# File 'lib/axiom/function/proposition/tautology.rb', line 45

def and(other)
  other
end

#or(_other) ⇒ self

Logically OR the proposition with another expression

Examples:

tautology.or(other)  # => tautology

Parameters:

Returns:

  • (self)


59
60
61
# File 'lib/axiom/function/proposition/tautology.rb', line 59

def or(_other)
  self
end