for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
require 'singleton'
module PropLogic
class Constant < Variable
def variables
[]
end
def to_cnf
self
class TrueConstant < Constant
include Singleton
def to_s(*)
'true'
def assign(trues, falses, variables = nil)
if falses.include?(self)
raise ArgumentError, 'Contradicted assignment'
class FalseConstant < Constant
'false'
if trues.include?(self)
True = TrueConstant.instance.freeze
False = FalseConstant.instance.freeze