Skip to main content
Version: Sprint 4

Language Overview

The fla-- Language is a declarative language for describing Turing machines. It provides a concise, human-readable syntax for defining machine states, alphabets, transitions, and behavior variants.

Structure​

A fla-- program consists of three main sections that must appear in order:

  1. Settings - Machine configuration (variant, tape count)
  2. Declarations - States, alphabets, and markers
  3. Transitions - State transition rules

Basic Syntax​

Every statement in fla-- follows a function-call pattern:

functionName(arg1, arg2, ...);

Statements are separated by semicolons. Function names are case-insensitive, but state names and alphabet symbols are case-sensitive.

Comments​

fla-- supports two types of comments:

Single-line Comments​

Use ### for single-line comments:

setvariant(single-tape); ### This is a comment

Multi-line Comments​

Use """ for block comments that span multiple lines:

"""
This is a multi-line comment.
It can span several lines.
"""
setvariant(single-tape);

Minimal Example​

setvariant(single-tape);
setalpha(0, 1);
makestates(q0, q1);
makeinit(q0);
makeaccept(q1);
maketransitions(
q0, 0 -> q0, 0, R;
q0, 1 -> q0, 1, R;
q0, _ -> q1, _, S;
);

This machine accepts any string of 0s and 1s.

Key Concepts​

  • Variant: Determines the type of Turing machine (single-tape, multi-tape, computational, etc.)
  • States: Named configurations the machine can be in
  • Alphabet: Symbols that can appear on the tape
  • Transitions: Rules that determine how the machine moves between states
  • Markers: Special states (initial, accept, reject, halt)

Documentation Sections​