Package jazzparser :: Package formalisms :: Package base :: Package semantics :: Module lambdacalc
[hide private]
[frames] | no frames]

Module lambdacalc

source code

Lambda calculus semantic representations for the Jazz Parser.

Defines a set of base classes for use in defining and handling semantic interpretations of jazz chord sequences. These take the form of lambda-expressions containing predicates.

A semantic representation should be created as a Semantics object. This should be initialised with a LogicalForm object defining the logical form it represents.

LambdaAbstraction, FunctionApplication and Variable define the basic lambda expressions.

Author: Mark Granroth-Wilding <>

Classes [hide private]
This acts as the root node in the LF's tree structure.
A semantic element, used to build the semantic interpretations returned by the parser.
A type of complex logical form element corresponding to a lambda abstraction.
A variable in a semantic expression.
A function application in a semantic expression.
Base class for any logical forms that are atomic: have no children.
Represents any literal that is used in a semantic expression.
A logical form that doesn't really represent anything, but implements the full interface of LogicalForm.
Functions [hide private]
multi_apply(application, fun, arg, *args)
Given a function application class, uses it to produce the curried application of multiple arguments.
source code
multi_abstract(abstraction, arg0, arg1, *args)
Given a lambda abstraction class, uses it to produce the nested abstraction over any number of variables.
source code
distinguish_variables(sem1, sem2, semantics=True)
Utility method.
source code
next_unused_variable(start_var, var_list)
Returns an altered version of the start_var to represent a new variable such that it is not equal to the original value and is not in the var_list
source code
Variables [hide private]
  logger = logging.getLogger("main_logger")
  __package__ = 'jazzparser.formalisms.base.semantics'
Function Details [hide private]

distinguish_variables(sem1, sem2, semantics=True)

source code 

Utility method. Given two instances of Semantics, check to make sure they have no common variable names and renames them if there are any. Modifies the object in situ. The semantics flag indicates that the arguments are within a Semantics object.