A locked and open door triggers an integrity violation.
fuse-n3.n3 · output · proof · check · playground
The question
What happens when the same door is both locked and open?
Historical background
In Notation3 logic, a formula can imply false. This gives an RDF rule document a way to state an integrity condition that should never be triggered. The example uses an inconsistent door state to show what happens when the body does hold. Berners-Lee, Notation3 Logic
What the program says
fuse-n3.n3:
# An inference fuse: { ... } => false stops the run when its premise holds,
# here a door that is both locked and open. eyemind exits with status 65.
@prefix : <http://example.org/door#>.
:door :state :locked, :open.
{ ?d :state :locked, :open } => false.
What eyemind concludes
The N3 output is empty because false is a contradiction, not an RDF triple.
The conjunction holds, so the inference fuse concludes false and the command exits with status 65. The proof records that contradiction; the native N3 writer emits no triple for false.
The check report records the corresponding claim as a JavaScript expression:
// Checked claims: these follow from the input program, which halted.
'false'
What the proof establishes
The run halted, so the proof holds its one claim, 'false', and one step:
step('false', clause(3), {D: iri('http://example.org/door#door')}, [rdf(iri('http://example.org/door#door'), iri('http://example.org/door#state'), iri('http://example.org/door#locked')), rdf(iri('http://example.org/door#door'), iri('http://example.org/door#state'), iri('http://example.org/door#open'))])
It reads: 'false' holds by clause 3 of the compiled program, the fuse,
with D the door, because the door is both locked and open. The checker
replays that firing against the source program: it runs the fuse from no
bindings, finds both state triples among the program’s facts, and obtains
'false' again. The saved report ends with verdict('checked').
For a halted run this establishes that its claim follows from the program, not that the claims are every answer: the run stopped at the contradiction, so there are no questions to answer.
Try it
From the repository root:
node bin/eyemind.js examples/fuse-n3.n3
node bin/eyemind.js --proof examples/fuse-n3.n3
node bin/eyemind.js --check-proof examples/proof/fuse-n3.js examples/fuse-n3.n3
