Skip to main content

Lambda Notebook: Formal Semantics with Jupyter and Python

Author: Kyle Rawlins, kgr@jhu.edu

Website: https://rawlins.github.io/lambda-notebook/

Repository: https://github.com/rawlins/lambda-notebook

This project is a framework for linguists and especially semanticists developing analyses in compositional semantics. It aims to provide a means of developing 'digital fragments', following from the method of fragments in Montague grammar. Contributions, requests, and suggestions are welcome. To see some examples of the project in action, Have a look at the demo page, which is pre-rendered from an interactive Jupyter document. The project itself comes with many more examples, though you will need to download and work with them interactively: https://github.com/rawlins/lambda-notebook/tree/master/notebooks

The lead developer for this project is Kyle Rawlins. I'm an associate professor in the Cognitive Science Department at Johns Hopkins University, and I do both theoretical linguistic semantics and computational semantics. My eventual goal is for any theoretical linguistics I do to come with a lambda notebook file. (I'm a long way from that dream.)

Installation

See https://github.com/rawlins/lambda-notebook/wiki/Installation

Basically,

  • Install Jupyter Lab.
  • current release: install from PyPI. (pip install lambda-notebook.)
  • current development version: download/clone the repository and ensure you have Jupyter installed (probably via anaconda). Run ./install_lambda_kernel.py from the repository root to install the kernel.
  • See the above link for information on using the package on colab. VSCode and other Jupyter notebook interfaces are not supported.

Getting started

Once you have installed the package, you can then open open lambda notebook files by using the newly installed kernel from any jupyter lab (or notebook) instance. The kernel for regular installs is named Lambda notebook (Python 3), and it can be selected as a new kernel from the launcher, or via the Change Kernel... menu item in the Kernel menu.

Alternatively, with the lamb module installed in the python path, you can run import lamb.auto, which is fully equivalent to loading a notebook with the kernel.

I recommend starting with some of the notebook files in this repository.

Code overview

There are three main parts to the code, structured into lamb.meta and submodules ("meta" for metalanguage), lamb.types, and lamb.lang.

  • meta and types together provide a typed logical metalanguage. Some of meta's key submodules:
    • lamb.meta.core: core machinery for typed expressions and functions
    • lamb.meta.boolean: boolean expressions
    • lamb.meta.quantifiers: quantified expressions
    • lamb.meta.sets: set theoretic expressions
    • lamb.meta.meta: meta-meta-language expressions
    • lamb.meta.ply: tools for manipulating metalanguage expressions
  • lamb.types provides implementations of type systems for a simply typed lambda calculus, a polymorphic lambda calculus using the "Damas-Hindley-Milner" type system, and various accessories.
  • lamb.lang provides machinery for doing composition on an object language.

Two additional files, magics.py and parsing.py provide support for using cell magics in the notebook to directly type expressions in the metalanguage. See the notebooks for demos and documentation.

License information

The lambda notebook is released under the BSD 3-clause license.

The module lamb.tree_mini provides a modified and dependency-less version of the nltk.tree module from the nltk package. See here for NLTK license information (Apache license).

Metadata

Release files for lambda-notebook 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lambda-notebook 0.8.1
File Size Uploaded
lambda_notebook-0.8.1.tar.gz 11.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for lambda-notebook 0.8.1
File Interpreter ABI Platform
lambda_notebook-0.8.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.8 MB

Release files / lambda_notebook-0.8.1.tar.gz

Download URL lambda_notebook-0.8.1.tar.gz
Size 11.3 MB
Tags Source
SHA-256 checksum
How to use checksums
74ceafc49761eb6dbe822669acde77c5c2e5a3884b563ca9ea773e80b5cb3a62
BLAKE2b-256 checksum
How to use checksums
a4b16c22153623d40b8dab4b4ddd85e0958a94fa1f614eb39d25db3761500b39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.5

Release files / lambda_notebook-0.8.1-py3-none-any.whl

Download URL lambda_notebook-0.8.1-py3-none-any.whl
Size 432.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42b64cfcae19fbb0940b876a89daeb64d1de33f888a55a71ad12ceba2358b2e6
BLAKE2b-256 checksum
How to use checksums
bbd04898ce919cb95b4ffb14c8e55b23fcaf45b5eeda773e7e2b7e14f02f7602
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.5

Release history Release notifications | RSS feed

This release

0.8.1 This release

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.9

2 release files

0.6.8

2 release files

0.6.7

2 release files

0.6.6

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page