Module language

Module language 

Source
Expand description

Defines the core language of thought of the model and a simple virtual machine.

Structs§

Context
A struct which keeps track of the context leading up to some expression, e.g. its depth, what variables are accessible, and whether the context has a constant function.
ExecutionConfig
A configuration struct to limit the time of execution of a given language expression
ExprRef
An index for a specific Expr in a LanguageExpression
LambdaEnumerator
An iterator that enumerates over all possible expressions of a given type.
LambdaSampler
A struct which samples expressions from a distribution.
LanguageExpression
An expression pool with a defined root.
PossibleExpressions
A struct which defines a HashMap of all types and expressions. The outer HashMap is for the return types of expressions and the inner HashMap is for their arguments. Then there is a vector of all possible lambda expressions with that output type and input arguments.
TypeAgnosticSampler
A re-usable sampler for sampling expressions of arbitrary types while caching frequent types

Enums§

ActorOrEvent
Whether something refers to an actor or event.
BinOp
All binary operations
ConjoiningError
An error which results from a failed application of RootedLambdaPool::conjoin
Constant
Any valid constant in the language.
Expr
The basic expression type of the language of thought. Note that it does not include free variables or any of the machinery of the lambda calculus which is handled elsewhere.
LambdaParseError
Error in parsing a lambda expression
LanguageResult
The result of running a LanguageExpression, see LanguageExpression::run.
LanguageResultType
The basic atomic types of the LOT. See LanguageResult.
LanguageTypeError
Possible errors that can be generated when running a LanguageExpression
MonOp
All unary operations
Quantifier
An enum which represents all possible quantifiers in the language.
Variable
The ID of a given variable bound by quantification

Functions§

parse_executable
A function which maps strings to language of thought expressions. Crucially, it automatically performs all lambda reductions.