Logical ContractsClarity in smartcontracts

Logical English

Logical English is a way of writing rules in English that a computer can run. A program is a set of sentences. Each sentence follows a pattern, called a template, which the author declares at the top of the program: a person is eligible for a refund if the person bought the goods within 30 days. A lawyer, an underwriter or a caseworker can read the program as it is written. The same sentences are also a logic program, so the computer can answer questions about them, and give the reasons for each answer.

Logical English was designed by Robert Kowalski at Imperial College London, building on four decades of work on logic programming and on legal reasoning, among it the British Nationality Act as a logic program (1986). Logical English 2 is the current implementation, by Logical Contracts with Kowalski and Jacinto Dávila. It is open source under the Apache 2.0 licence.

What you get

Try it

In your browser. Open https://le2.logicalcontracts.com and choose Open the editor. Nothing is installed and no account is needed. The Examples menu holds programs to open and run; the Help menu holds the tutorial, the guide to the editor and the language reference.

On your own machine. Install SWI-Prolog, then:

git clone https://github.com/LogicalContractsOrg/LogicalEnglish2.git
cd LogicalEnglish2
swipl -g "use_module(classic_web_api), start_api_server(3050)"

The editor is then at http://localhost:3050/editor/. The repository’s README says the rest.

Open source. https://github.com/LogicalContractsOrg/LogicalEnglish2 (Apache 2.0), with the documentation, the examples and the test suite. The first implementation, Logical English 1, is at https://github.com/LogicalContractsOrg/LogicalEnglish, with the publications.

Public models

Two models of real regulation are among the examples, each rule citing the passage it encodes, and each with the cases it was checked against:

Both are provided as they are, without warranty, and are not legal, tax, customs or medical advice. Each says so in its own text.

Videos

Short narrated recordings of the editor at work. All are on our YouTube channel.

VideoLength
Insurance in Logical English: a Socotra product and Medicare coverage7:45
Rules as code in Logical English: Blawx, Epilog and LegalRuleML7:51
Oracle Intelligent Advisor and OIPA users to Logical English8:31
Underwriting guidelines you can run4:49
L4 in Logical English and LPS4:27
Tariff classification in Logical English4:57
Medicare DMEPOS coverage in Logical English4:25
Oracle Intelligent Advisor to Logical English4:39
A Socotra product in Logical English3:40
LegalRuleML in Logical English3:27
OIPA in Logical English3:04
Blawx in Logical English2:58
s(CASP) in Logical English2:59

Extensions

Two licensed products extend the open system: the Logical English Translators, which read the programs of twelve other rule systems into Logical English, and write some of them back, and which include the LE Contract Assistant, which drafts a tested program from a contract. And the InsurLE language extensions, for contract and statute text that is written with which, unless and numbered conditions. See Logical English Extensions.