lib/veritas/function/proposition.rb in veritas-0.0.6 vs lib/veritas/function/proposition.rb in veritas-0.0.7
- old
+ new
@@ -3,16 +3,19 @@
module Veritas
class Function
# Abstract base class for logical propositions
class Proposition < Function
+ extend Comparator
include AbstractClass,
Singleton,
Function::Connective::Conjunction::Methods,
Function::Connective::Disjunction::Methods,
Function::Connective::Negation::Methods
+ compare # only compare instances with the same superclass
+
# Instantiate a new Proposition
#
# @example using a true value
# tautology = Proposition.new(true)
#
@@ -103,36 +106,10 @@
# @api public
def ==(other)
kind_of?(other.class) || other.kind_of?(self.class)
end
- # Compare the proposition with other proposition for equality
- #
- # @example
- # proposition.eql?(other) # => true or false
- #
- # @param [Proposition] other
- #
- # @return [Boolean]
- #
- # @api public
- def eql?(other)
- instance_of?(other.class)
- end
-
- # Return the hash of the proposition
- #
- # @example
- # hash = proposition.hash
- #
- # @return [Fixnum]
- #
- # @api public
- def hash
- self.class.hash
- end
-
# Return a string representing the proposition
#
# @example
# proposition.inspect # (String representation of Proposition)
#
@@ -140,11 +117,9 @@
#
# @api public
def inspect
call.inspect
end
-
- memoize :hash
end # class Proposition
end # module Algebra
end # module Veritas