Class: Udb::FreeTerm Private
- Inherits:
-
Object
- Object
- Udb::FreeTerm
- Extended by:
- T::Sig
- Includes:
- Comparable
- Defined in:
- lib/udb/logic.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
represents a “free” term, i.e., one that is not bound to the problem at hand used by the Tseytin Transformation, which introduces new propositions to represent subformula
Instance Attribute Summary collapse
- #id ⇒ Object readonly private
Instance Method Summary collapse
- #<=>(other) ⇒ Object private
- #eql?(other) ⇒ Boolean private
- #hash ⇒ Object private
-
#initialize ⇒ FreeTerm
constructor
private
A new instance of FreeTerm.
- #to_h ⇒ Object private
- #to_idl(cfg_arch) ⇒ Object private
- #to_s ⇒ Object private
- #to_s_pretty ⇒ Object private
- #to_z3 ⇒ Object private
Constructor Details
#initialize ⇒ FreeTerm
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of FreeTerm.
1123 1124 1125 1126 |
# File 'lib/udb/logic.rb', line 1123 def initialize @id = FreeTerm.instance_variable_get(:@next_id) FreeTerm.instance_variable_set(:@next_id, @id + 1) end |
Instance Attribute Details
#id ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1120 1121 1122 |
# File 'lib/udb/logic.rb', line 1120 def id @id end |
Instance Method Details
#<=>(other) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1157 1158 1159 1160 1161 |
# File 'lib/udb/logic.rb', line 1157 def <=>(other) return nil unless other.is_a?(FreeTerm) @id <=> other.id end |
#eql?(other) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1177 1178 1179 1180 1181 |
# File 'lib/udb/logic.rb', line 1177 def eql?(other) return false unless other.is_a?(FreeTerm) (self <=> other) == 0 end |
#hash ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1169 |
# File 'lib/udb/logic.rb', line 1169 def hash = @id.hash |
#to_h ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1146 |
# File 'lib/udb/logic.rb', line 1146 def to_h = {} |
#to_idl(cfg_arch) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1142 1143 1144 |
# File 'lib/udb/logic.rb', line 1142 def to_idl(cfg_arch) "FreeTerm" end |
#to_s ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1132 1133 1134 |
# File 'lib/udb/logic.rb', line 1132 def to_s "t#{@id}" end |
#to_s_pretty ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1149 |
# File 'lib/udb/logic.rb', line 1149 def to_s_pretty = to_s |
#to_z3 ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1137 1138 1139 |
# File 'lib/udb/logic.rb', line 1137 def to_z3 @z3 ||= Z3.Bool(to_s) end |