Does every machine have a passing inspection?

ASK finds that the workshop records lack a passing inspection for one machine.

complete-inspections-rq.rq · data/complete-inspections-rq.ttl · output · proof · check · playground


The question

A workshop records its machines and their inspection outcomes. The drill and saw have passes on record. The lift has a failed inspection. Is the inventory nonempty, with at least one passing inspection for every machine?


What we tell eyemind

The first filter requires a machine in the inventory. The second filter looks for a machine without a recorded pass. Its inner NOT EXISTS tests the machine currently bound in the enclosing pattern.

ASK WHERE {
  FILTER EXISTS { ?machine a :Machine }
  FILTER NOT EXISTS {
    ?machine a :Machine .
    FILTER NOT EXISTS {
      ?inspection :machine ?machine ; :outcome :passed .
    }
  }
}

What eyemind concludes

The answer is false. The lift is a counterexample because its only recorded inspection failed.

sparql_ask('false')

What the proof establishes

The saved report ends with verdict('checked'). The checker verifies the call table for each machine’s passing inspections against the data. The lift’s table is empty, so there is a counterexample and the overall ASK pattern has no solution.


Try it

Run these commands from the repository root.

node bin/eyemind.js examples/complete-inspections-rq.rq examples/data/complete-inspections-rq.ttl
node bin/eyemind.js --proof examples/complete-inspections-rq.rq examples/data/complete-inspections-rq.ttl
node bin/eyemind.js --check-proof examples/proof/complete-inspections-rq.js examples/complete-inspections-rq.rq examples/data/complete-inspections-rq.ttl

Record a new passing inspection for the lift in the playground to see the answer change to true.