Beetle with nested alternatives in Logical English

Nine terminal cases all entail beauty.

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

The question

The beetle is a car, so it is green or blue. Blue entails beauty. Green leads to nice or pretty, and each of those branches twice more. Does every possible case entail beauty?

Historical background

Gentzen’s natural deduction made proof by cases an explicit rule. The subproofs under each case can themselves use that rule. The beetle example builds this nesting into its data and checks the conclusion down to the terminal alternatives. Gentzen, Untersuchungen über das logische Schließen I

What we tell eyemind

The has property … or … and entails … or … templates record pairs of alternatives. Blue and the eight terminal properties under green entail beauty directly. The recursive rule gives a property a guarantee of beauty when both alternatives it entails have that guarantee. The beetle is beautiful when both of its possible colours guarantee beauty. See disjunction elimination.

What eyemind concludes

% query beautiful
beetle is beautiful.

The checked answer is an LS term.

struct('le:answer', 'beautiful')

What the proof establishes

The saved proof is checked against the compiled LS program. It derives guarantees at the leaves before deriving them at the forks. For example, nice21 and nice22 support nice2, which together with nice1 supports nice. The --explain output follows the chain through both the nice and pretty branches to establish the guarantee from green.

Try it

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

Remove nice22 entails beauty. The query has no answer because that leaf leaves the green alternative without a guarantee.