How idni/tau-lang works
Based on our analysis of the file tree and the README contents, this project is an open‐source tool that implements the Tau specification language. It is essentially a language framework and interpreter designed to allow users to write Boolean-algebra-based, temporally extended specifications. It supports parsing, interpretation, execution, and even synthesis of programs from a declarative specification. The project is written in C++ (with a C++23 requirement) and built with CMake. It has a significant amount of support code for parsing (with generated files in the “parser” folder), Boolean algebra core functionalities (in “src/boolean_algebras” and related files), interactive REPL, and testing via unit, integration, and benchmark tests.
Main Components
• Command Line Interface (CLI) / REPL: The “src/main.cpp” and REPL-related functionality in the tests and documentation indicate a command-line based interface. This component handles user input, script evaluation, and interaction.
• Parser: The “parser” folder (with .tgf files and generated header files) along with the CMake custom parser generation scripts indicates that there is a specialized parser for the Tau language that converts specifications into internal representations.
• Core Language Engine: Within “src/boolean_algebras” and its subdirectories (including components for BDDs and other Boolean algebra manipulations), this core engine manages the semantics of the language—handling Boolean functions, handling normal forms (cnf, dnf, etc.), and supporting recurrence relations as described in the README.
• Specification Interpreter and Executor: Based on the sections in the README, there is a component that takes a parsed specification, interprets it (e.g., mapping specifications to actual computations such as satisfiability checks, normalization, solving, etc.), and executes it (via the “tau” executable).
• Utility Libraries and Helpers: There are several helper components such as “debug_helpers”, “hooks”, “normalizer”, and others that implement optimization, logging, and other utility functions.
• External Dependencies Integration: The project uses external libraries like Boost and the Z3 SMT solver. These dependencies are used in the core logic for logical reasoning and possibly for constraint solving.
Architectural Relationships and Data Flow
• At the top, the user interacts with the system via the CLI/REPL. Inputs from the user (Tau specifications or commands) flow into the Parser.
• The Parser converts the input specification text into an Abstract Syntax Tree (AST) or similar internal representation.
• This AST or representation is then handed off to the Core Language Engine, which uses various modules (for Boolean logic, recurrence relations, and normal form transformations) to analyze and compute the specification’s semantics.
• The Interpretation and Execution component evaluates the spec (possibly using external libraries like Z3 when checking satisfiability or performing solving tasks) and drives the output action (displaying results on the console or writing to files as configured).
• Throughout, utility modules (such as logging, debugging, and helper functions) support processing and error reporting.
• Build and packaging scripts (CMakeLists.txt, Dockerfile, shell scripts like release.sh, debug.sh, etc.) encapsulate building, testing, and deployment workflows.
Architectural Patterns and Design Principles
• Layered Architecture: There’s a clear separation between the interface (CLI/REPL), language parsing (the Parser layer), core semantics (Boolean algebra and interpreter), and external integrations (Boost, Z3).
• Modularization: Each major functionality (parsing, evaluation, execution, testing) is placed in different directories and modules, following principles of separation of concerns.
• Extensibility: The support for functions, predicates, recurrence relations and multiple Boolean algebras indicates that the design adheres to open-closed principles, allowing extensions without modifying the core engine.