Class: Variable
- Inherits:
-
Term
show all
- Defined in:
- lib/rover_prover/language/term/variable.rb
Constant Summary
Constants inherited
from Term
Term::TIME_DEFAULT
Instance Attribute Summary
Attributes inherited from Term
#name, #time
Instance Method Summary
collapse
Methods inherited from Term
#initialize
Constructor Details
This class inherits a constructor from Term
Instance Method Details
#eql?(var) ⇒ Boolean
29
30
31
32
|
# File 'lib/rover_prover/language/term/variable.rb', line 29
def eql?(var)
return false unless var.is_a?(Variable)
@name == var.name
end
|
#free_unification_terms ⇒ Object
8
9
10
|
# File 'lib/rover_prover/language/term/variable.rb', line 8
def free_unification_terms
[]
end
|
#free_variables ⇒ Object
4
5
6
|
# File 'lib/rover_prover/language/term/variable.rb', line 4
def free_variables
[self]
end
|
#occurs(unification_term) ⇒ Object
17
18
19
|
# File 'lib/rover_prover/language/term/variable.rb', line 17
def occurs(unification_term)
false
end
|
#replace(old, new) ⇒ Object
12
13
14
15
|
# File 'lib/rover_prover/language/term/variable.rb', line 12
def replace(old, new)
return new if eql?(old)
self
end
|
#set_instantiation_time(time) ⇒ Object
21
22
23
|
# File 'lib/rover_prover/language/term/variable.rb', line 21
def set_instantiation_time(time)
@time = time
end
|
#to_s ⇒ Object
25
26
27
|
# File 'lib/rover_prover/language/term/variable.rb', line 25
def to_s
@name
end
|
#unify(term) ⇒ Object
34
35
36
37
38
39
|
# File 'lib/rover_prover/language/term/variable.rb', line 34
def unify(term)
return term.unify(self) if term.is_a?(UnificationTerm)
return nil unless term.is_a?(Variable)
return nil unless eql?(term)
{}
end
|