object LaunchburyInterpreter extends App
Simple call-by-need (i.e. lazy) interpreter for Lambda Calculus based off of John Launchbury's "A Natural Semantics for Lazy Evaluation" Uses the "Barendregt convention": All variable names are globally unique (i.e. you cannot shadow variable names), and renames variables after substitution to maintain this invariant.
- Source
- StateTUsage.scala
- Alphabetic
- By Inheritance
- LaunchburyInterpreter
- App
- DelayedInit
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- case class Apply(term: Expr, arg: String) extends Expr with Product with Serializable
- sealed abstract class Expr extends AnyRef
Simple lambda calculus Abstract Syntax Tree.
Simple lambda calculus Abstract Syntax Tree. Note that that apply applies a let-bound argument to an Expr. This is to make sharing easier, by ensuring that arguments are in the heap.
- case class Lambda(name: String, term: Expr) extends Expr with Product with Serializable
- case class Let(bindings: IMap[String, Expr], term: Expr) extends Expr with Product with Serializable
- case class ReduceState(heap: IMap[String, Expr], freshVars: LazyList[String]) extends Product with Serializable
- case class Var(name: String) extends Expr with Product with Serializable
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val S: MonadState[[β$20$]IndexedStateT[ReduceState, ReduceState, [X]X, β$20$], ReduceState]
- final def args: Array[String]
- Attributes
- protected
- Definition Classes
- App
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def evaluate(e: Expr): Expr
- val example1: Lambda
- val example2: Let
- final val executionStart: Long
- Definition Classes
- App
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def main(args: Array[String]): Unit
- Definition Classes
- App
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()