Logical English 2.0
Logical English (LE) is a controlled natural language for legal and business logic. It allows experts to write executable rules that look like plain English, which are then automatically translated into formal logic (Prolog) for reasoning and explanation.
LE 2.0 is a modernized, high-performance implementation of the original Logical English project.
🚀 Try the Live Demo
Logic Production Systems, the sister system for rules about time and
change — contracts, processes, agents — runs programs written in Logical
English: LogicalContractsOrg/lps2,
live at lps2.logicalcontracts.com.
Logical English reads the programs of twelve other rule systems. The
translations of their published examples, with the sources, the tests and a
ledger of what was and was not carried over, are in
examples/migration/. The translators
themselves are open source too, under the same Apache-2.0 licence: they are
in the folder migration/ of this repository, one folder per
system, so every installation of Logical English has them. They are published
"as is": nobody promises that a translator will follow the new versions of the
system it reads or writes. On the hosted service the translators are free for
every visitor who has signed in.
One part is still a licensed product of Logical Contracts:
the LE Contract Assistant, which writes the first draft of a program from a
contract, its schedules and its cases
(the assistants).
📖 The Language
Logical English is designed to be readable by non-programmers while remaining mathematically precise.
- Template-based: Define your own natural language patterns (e.g.,
*a person* acquires British citizenship on *a date*).
- Rule-oriented: Write logic using
if, and, or.
- Explainable: Every answer comes with a justification tree in natural language.
- Typed: Built-in support for types, dates, and arithmetic.
Language reference | Tutorial | All documentation | Examples
🛠 The Editor
The LE 2.0 environment provides a powerful, web-based IDE for developing and testing logic:
- Real-time Feedback: Instant syntax highlighting and error reporting as you type.
- Explanations: Every answer, and every failure, with a navigable explanation tree; a step-by-step tracer.
- Scenario Testing: Define "Scenarios" (facts) and "Queries" within the same file, with expected answers.
- Language server: Autocompletion, hover, folding and quick fixes, running in the browser.
- Assistants: The LE Assistant edits and repairs the open program with an LLM; the Contract Assistant turns a contract into a tested program.
Using the editor | Architecture | Debugger | LE Assistant
🐳 Deployment