Module: Unific
- Defined in:
- lib/unific.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
'0.11'
Class Method Summary collapse
-
._ ⇒ Object
Return the Unific wildcard variable.
-
.fail ⇒ Object
Return false.
-
.trace(lvl = false) ⇒ Object
Turn on tracing (to STDERR) of Unific operations.
-
.unify(a, b, env = Env.new) ⇒ Object
Unify two terms against an empty environment.
-
.untrace ⇒ Object
Turn off tracing (to STDERR) of Unific operations.
Class Method Details
._ ⇒ Object
Return the Unific wildcard variable
228 229 230 |
# File 'lib/unific.rb', line 228 def self._ Unific::Wildcard.instance end |
.fail ⇒ Object
Return false
Placeholder for possible future expansion of failed unification behavior
248 249 250 |
# File 'lib/unific.rb', line 248 def self.fail false end |
.trace(lvl = false) ⇒ Object
Turn on tracing (to STDERR) of Unific operations
The optional level argument sets the verbosity – if not passed, each call to this method increases verbosity
236 237 238 |
# File 'lib/unific.rb', line 236 def self.trace lvl = false Unific::Env::trace lvl end |
.unify(a, b, env = Env.new) ⇒ Object
Unify two terms against an empty environment
See README.rdoc or Env#unify for details
If the two values cannot be unified, ‘false’ is returned. If they can, a new environment is returned which is this environment extended with any new bindings created by unification. – XXX This documentation must be kept in sync with that for Env#unify ++
183 184 185 |
# File 'lib/unific.rb', line 183 def self.unify a, b, env = Env.new env.unify a, b end |