Socrates in Logical English

Templates, a rule and a query in Logical English, compiled to LS.

socrates-le.le · output · proof · check · playground

The question

Socrates is human. Every human is mortal. Which thing is mortal?

Historical background

The familiar Socrates argument illustrates class inclusion in the tradition of Aristotle’s syllogistic. Logical English brings the premises and conclusion into the grammar of an executable rule language. The same pattern can be read as prose and followed as a computation. Aristotle, Prior Analytics, Book I · Logical English at CNL 2021

What we tell eyemind

The input is Logical English, the controlled natural language of Robert Kowalski and his colleagues. The templates *a thing* is human and *a thing* is mortal declare the two sentence patterns. The rule a person is mortal if the person is human uses them: a person introduces a variable and the person refers back to it. The query which thing is mortal asks for every value of which thing.

What eyemind concludes

The default output is another .le file, with the query’s answers as sentences:

% query mortal
Socrates is mortal.

The JavaScript check report holds the same answer as an LS term:

struct('le:answer', 'mortal', 'Socrates')

What the proof establishes

The saved proof is checked against the compiled LS program, in which the rule is a backward rule is_mortal(Person) with the body is_human(Person). That the compilation reads the English as intended is a matter of the compiler and its tests; the proof establishes the answer under the rule and fact.

Try it

node bin/eyemind.js examples/socrates-le.le
node bin/eyemind.js --program examples/socrates-le.le > /tmp/socrates-le.js
node bin/eyemind.js --proof examples/socrates-le.le
node bin/eyemind.js --check-proof examples/proof/socrates-le.js examples/socrates-le.le
node bin/eyemind.js --explain examples/socrates-le.le

Add the template *a thing* is an animal and the rule a thing is an animal if the thing is mortal., then ask which thing is an animal.