Package loda

Python implementation of the LODA Language: an assembly language and computational model for integer sequences.

This Python package allows you to read and write LODA programs, to evaluate them to integer sequences, and to search for matches in the OEIS database.

Installation

You need Python 3.7 or higher. To install the dependencies for LODA, run these commands:

python3 -m venv env
source env/bin/activate
pip install -r requirements.txt

Getting Started

LODA programs are stored in *.asm files. Below you can find the example program fibonacci.asm which computes the Fibonacci numbers. For a comprehensive overview of the language, see the LODA Language Specification.

; A000045: Fibonacci numbers.
mov $3,1
lpb $0
  sub $0,1
  mov $2,$1
  add $1,$3
  mov $3,$2
lpe
mov $0,$1

Check out the sub-modules for working with LODA programs.

Development

To execute the tests, run the following command:

nose2 tests -v

Sub-modules

loda.lang

Load and save programs …

loda.llm

Large Language Model (LLM) implementation for natural language to LODA code generation …

loda.mine

Program mining for integer sequences.

loda.oeis

OEIS integration …

loda.runtime

Evaluate programs to integer sequences …