The oldest example in logic, with the reasoning written down.
socrates.pl · output · proof · check · try it in the playground
Socrates is human. Every human is mortal.
Is Socrates mortal? And, just as important: can the computer show why?
Two facts and one rule, written in Prolog syntax:
type(socrates, human). % Socrates is a human
subclass_of(human, mortal). % every human is a mortal
type(S, B) :+ type(S, A), subclass_of(A, B).
The rule reads: if S is an A, and every A is a B, then S is a B.
The :+ means “keep applying this until nothing new follows”.
type(socrates, mortal).
type(socrates, human).
The first line is new: nobody typed it in. The second is the fact we gave,
reported back because the program asks for every type it knows.
Eyedia does not just print the answer; it records how it got there:
Each step names the exact line of the program it used, and the values it filled in.
The proof is a document of its own, and a separate checker reads it against the program. It confirms, among other things, that:
Verdict: checked. All 3 steps verified, and nothing taken on trust.
node bin/eyedia.js examples/socrates.pl # the answers
node bin/eyedia.js --proof examples/socrates.pl # answers with their proof
Or open it in the playground.
Add type(plato, human). and run again: Plato becomes mortal too, with his
own proof.
A conclusion you can follow step by step, and that a machine has checked, is one you can explain, question and build on — not just believe.