Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cucapra/lambdalab
/ functions
Functions
88 in github.com/cucapra/lambdalab
⨍
Functions
88
◇
Types & classes
19
↓ 24 callers
Function
pretty
(e: Expr, step : StepInfo | null)
lib/ast.ts:126
↓ 15 callers
Function
parse
(scanner : Scanner, strat : Strategy)
lib/parse.ts:400
↓ 12 callers
Method
copy
()
lib/ast.ts:18
↓ 9 callers
Method
error
* Create a ParseError with the given message that refers to the current * source position of the parser.
lib/parse.ts:94
↓ 9 callers
Method
scan
* Match the regular expression at the current offset, return the match, and * advance the current position past the matched string. Or, if the regu
lib/parse.ts:69
↓ 9 callers
Function
skip_whitespace
* Scan over any amount of whitespace.
lib/parse.ts:102
↓ 7 callers
Function
alpha_equivalent
(ex1 : Expr, ex2: Expr)
lib/macro.ts:20
↓ 7 callers
Function
equiv_s
* Determines if two terms are macro-equivalent under Strategy s
lib/macro.ts:70
↓ 6 callers
Function
parse_expr
* Parse a sequence of terms separated by whitespace: in other words, * a nested hierarchy of applications.
lib/parse.ts:124
↓ 6 callers
Method
set_string
(s : string)
lib/parse.ts:36
↓ 5 callers
Function
execute
()
lambdalab.ts:392
↓ 4 callers
Function
clearError
* Remove the current error being displayed.
lambdalab.ts:299
↓ 4 callers
Function
insertText
* Insert text into the DOM at the current selection caret.
lambdalab.ts:19
↓ 4 callers
Function
replace_macros
* Replaces a term containing macros with an equivalent term without macros
lib/macro.ts:50
↓ 4 callers
Function
subst
* Perform capture-avoiding substitution: e[v/x]. Returns the new expressions, as well as pointers to all * the substituted expressions
lib/reduce.ts:65
↓ 3 callers
Function
activeInStep
* Determines if a given expression contains any subexpressions relevant to a step
lib/ast.ts:271
↓ 3 callers
Function
find_value
(expr : Expr, reduce : (e: Expr) => [Expr | null, StepInfo | null])
lib/parse.ts:283
↓ 3 callers
Function
is_closed
(e : Expr)
lib/parse.ts:323
↓ 3 callers
Function
makeGraph
(e : Expr, step : StepInfo | null, graphOut : HTMLElement)
lambdalab.ts:48
↓ 3 callers
Function
reduce_appl
(e: Expr)
lib/reduce.ts:227
↓ 3 callers
Function
sortMacros
* Sort the list of macros by dependency. Returns the sorted list
lambdalab.ts:456
↓ 2 callers
Function
appendResults
(res: ReadonlyArray<[string, Expr, StepInfo | null]>, resultList: HTMLElement)
lambdalab.ts:187
↓ 2 callers
Function
compileMacro
(s : Scanner, macro_text : string, macro_name : string)
lib/parse.ts:327
↓ 2 callers
Function
getStrategy
* Determine the currently selected evaluaiton strategy.
lambdalab.ts:369
↓ 2 callers
Function
macroAdd
* Accept a new macro definition and incorporate it into the current macro * list.
lambdalab.ts:497
↓ 2 callers
Function
macroText
* Get the current list of macros as a string.
lambdalab.ts:469
↓ 2 callers
Function
parse_macro_name
* Parse a macro name. Macro names are uppercase
lib/parse.ts:116
↓ 2 callers
Function
parse_var_name
* Parse a variable name. Variable names are lowercase
lib/parse.ts:109
↓ 2 callers
Function
posInText
* Given a list of text nodes and an offset into the concatenated text * they represent, return the text node where this offset lies and the * corres
lambdalab.ts:239
↓ 2 callers
Function
renderASTs
(prev : Expr | null, stepInfo : StepInfo | null, cur : Expr)
lambdalab.ts:38
↓ 2 callers
Function
run
(expr : Expr | null, timeout : number, reduce : (e: Expr) => [Expr | null, StepInfo | null])
lib/reduce.ts:288
↓ 2 callers
Function
showError
* Display a parser error.
lambdalab.ts:259
↓ 2 callers
Function
showResult
* Show the result, given as a string, of executing some code in the list * element provided. * * When interactive mode is off, this displays the re
lambdalab.ts:213
↓ 2 callers
Function
strat_of_string
(s : string)
lib/reduce.ts:13
↓ 2 callers
Function
updateLink
* Update the sharing link with the current code.
lambdalab.ts:306
↓ 2 callers
Function
updateMacroList
* Update the list of defined macros to display all the macros in the scanner.
lambdalab.ts:480
↓ 1 callers
Function
add_macro
(s: Scanner)
lib/parse.ts:373
↓ 1 callers
Function
alpha_equiv_in_context
(e1 : Expr, vars1 : string[], e2: Expr, vars2 : string[])
lib/macro.ts:21
↓ 1 callers
Function
collectTree
(e : Expr, parent : number | null, self : number, target : number | null, vars : number[
lib/ast.ts:219
↓ 1 callers
Function
colorize
(entry : HTMLLIElement, line : string)
lambdalab.ts:115
↓ 1 callers
Function
convertToDot
(e : Expr, step : StepInfo | null)
lib/ast.ts:366
↓ 1 callers
Method
copyMacros
()
lib/parse.ts:55
↓ 1 callers
Function
dependsExpr
(e : Expr)
lib/macro.ts:195
↓ 1 callers
Function
expand
* Expands a flattened AST
lib/ast.ts:299
↓ 1 callers
Function
flatten
* Flattens an Expr tree in place into a flattened tree by collapsing the parts * of the tree not relevant to the current step
lib/ast.ts:328
↓ 1 callers
Function
flattenToMatch
(source : Expr, target : Expr)
lib/ast.ts:202
↓ 1 callers
Function
fresh
* Create a version of the variable name x that is not * already present in the array.
lib/reduce.ts:53
↓ 1 callers
Function
fv
* Get the free variables in an expresison.
lib/reduce.ts:34
↓ 1 callers
Function
getDependencies
(m1 : MacroDefinition, s : Scanner)
lib/macro.ts:194
↓ 1 callers
Function
getLabel
* Produces the correct string label from a StepInfo object
lib/reduce.ts:277
↓ 1 callers
Function
guessesMatch
(e1 : Expr, e2 : Expr | null)
lib/ast.ts:190
↓ 1 callers
Function
handleHash
* Load the current state from a URL hash, if it contains share link data. * * Return a flag indicating whether code was loaded from the state.
lambdalab.ts:321
↓ 1 callers
Function
hide
* Hide an HTML element from the page by setting "display: none" in its CSS.
lambdalab.ts:111
↓ 1 callers
Function
in_library
(e : Expr, sigma : MacroLibrary, s : Strategy, timeout : number)
lib/macro.ts:113
↓ 1 callers
Function
init_macros
(s : Scanner)
lib/macro.ts:217
↓ 1 callers
Function
interactiveResult
(res: ReadonlyArray<[string, Expr, StepInfo | null]>, s : Scanner, start : number,
lambdalab.ts:148
↓ 1 callers
Function
is_closed_in_context
(e : Expr, context : string[] )
lib/parse.ts:301
↓ 1 callers
Function
macroSetUp
* Set up the macro event handlers. This is called when the DOM is first loaded.
lambdalab.ts:515
↓ 1 callers
Function
parse_abs
* Parse a lambda-abstraction.
lib/parse.ts:258
↓ 1 callers
Function
parse_dots
* Parse ellipses
lib/parse.ts:209
↓ 1 callers
Function
parse_macro
* Parse a macro occurrence.
lib/parse.ts:221
↓ 1 callers
Function
parse_term
* Parse a non-application expression: a variable or an abstraction, or a * parenthesized expression.
lib/parse.ts:154
↓ 1 callers
Function
parse_var
* Parse a variable occurrence.
lib/parse.ts:196
↓ 1 callers
Function
programSetUp
* Set up the program event handlers. This is called when the DOM is first * loaded. * * Return a function that runs the currently-entered program,
lambdalab.ts:386
↓ 1 callers
Method
recompileMacros
* Recompiles the macros in the scanner to reflect changes in dependencies * * @param sorted the sorted list of macros by dependency. This is ne
lib/parse.ts:48
↓ 1 callers
Function
resugar
(e : Expr, sigma : MacroLibrary, s : Strategy)
lib/macro.ts:166
↓ 1 callers
Function
runCode
* Execute a lambda-calculus expression in a string. Return a new set of steps * to display or a parse error.
lambdalab.ts:70
↓ 1 callers
Function
toggleVisibility
(el: HTMLElement)
lambdalab.ts:578
Method
constructor
( public readonly name: string )
lib/ast.ts:12
Method
constructor
( public e1: Expr, public e2: Expr )
lib/ast.ts:28
Method
constructor
( public readonly vbl: string, public body: Expr )
lib/ast.ts:45
Method
constructor
( public readonly name: string, public readonly body: Expr )
lib/ast.ts:62
Method
constructor
(public readonly body : Expr )
lib/ast.ts:79
Method
constructor
( public readonly beta: boolean, // whether the last step was a macro expansion (false) or a beta reductio
lib/ast.ts:102
Method
constructor
(public name: string, public cbv_val : Expr | null, public cbn_val : Expr | null, public full_val : Ex
lib/macro.ts:11
Method
constructor
(public msg: string, public pos: number)
lib/parse.ts:17
Method
constructor
()
lib/parse.ts:29
Method
copy
()
lib/ast.ts:35
Method
copy
()
lib/ast.ts:52
Method
copy
()
lib/ast.ts:69
Method
copy
()
lib/ast.ts:84
Method
copy
()
lib/ast.ts:114
Method
done
* Check whether the entire string has been consumed.
lib/parse.ts:86
Function
equiv_a
* Determines if two terms are macro-equivalent under alpha-equivalence
lib/macro.ts:63
Function
is_value
* Check whether a lambda-term is a value. Only works for CBV/CBN and * does not account for macros.
lib/reduce.ts:27
Function
reduce_cbn
(e: Expr)
lib/reduce.ts:153
Function
reduce_cbv
(e: Expr)
lib/reduce.ts:110
Function
reduce_normal
(e: Expr)
lib/reduce.ts:181