for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
module PropLogic
class Variable < Term
def initialize(name = nil)
@name = name || "v_#{object_id}"
@terms = [].freeze
freeze
end
public_class_method :new
def to_s(*)
@name
def nnf?
true
def reduced?
def to_cnf
self
def tseitin(pool)
def cnf?
def variables
[self]
def assign(trues, falses, variables = nil)
if trues.include? self
True
elsif falses.include? self
False
else
# bypassing Term.get
# @return [NotTerm] negated variable
def not
Term.__send__ :cached, NotTerm, self
alias_method :~, :not
alias_method :-@, :not