Class: LyambdaGem::Term

Inherits:
Object
  • Object
show all
Defined in:
lib/lyambda_gem/term.rb

Overview

Base abstract class for all terms in the lambda calculus (variables, abstractions, applications)

Direct Known Subclasses

Abstraction, Application, Variable

Instance Method Summary collapse

Instance Method Details

#free_variablesObject

Raises:

  • (NotImplementedError)


4
5
6
# File 'lib/lyambda_gem/term.rb', line 4

def free_variables
  raise NotImplementedError, "Subclasses must implement the free_variables method"
end

#reduce(strategy: :normal_order) ⇒ Object

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/lyambda_gem/term.rb', line 16

def reduce(strategy: :normal_order)
  raise NotImplementedError, "Subclasses must implement the reduce method"
end

#reduceable?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


12
13
14
# File 'lib/lyambda_gem/term.rb', line 12

def reduceable?
  raise NotImplementedError, "Subclasses must implement the reduceable? method"
end

#substitute(term, variable) ⇒ Object

Raises:

  • (NotImplementedError)


8
9
10
# File 'lib/lyambda_gem/term.rb', line 8

def substitute(term, variable)
  raise NotImplementedError, "Subclasses must implement the substitute method"
end