Skip to content

3. Advanced reasoning

This chapter describes the design. One part of it is built: len apply writes a record for each claim, and a changed input lists the run again.

The first two chapters treat a LEN program as a file. In use, LEN works inside a knowledge base, and most of what makes it useful happens there.

The parts

Part What it does
A HyperMarkdown vault holds the cards: the documents the knowledge is written in, and the links between them
LEN states claims about what the cards describe, has the work done, and writes each result into a record beside its card
HQL reads the vault: the cards, their metadata and the records LEN wrote
Extensions bring in the reasoners that settle an obligation

LEN and HQL do not overlap. HQL reads the knowledge base and reasons about nothing. LEN produces and maintains what HQL reads. Much of the integration with HyperMarkdown is done by HQL: finding cards, following links, building the tables a report needs.

Reasoners and judges

A backend is anything that can settle an obligation. A Horn evaluator is one, and it is built in. A prover for first-order logic is another. So are a proof assistant, a test runner for a programming language, a statistical model, and a person who reads the evidence and judges.

Each enters the same way: it is named in the project's configuration, a goal asks for work in a context, and the plan shows which backend would do it. A result from a person is recorded like any other, with who judged and on what.

The life of a result

Stage What happens
Recorded the outcome, the artifact and a digest of every input are written beside the card
Relied on later work takes the result as a premise
Stale an input changed, so the record's stamp no longer matches
Revised the work is listed again, and what relied on the old result is listed with it

A knowledge base maintained this way can answer a question a plain document cannot: what a statement was based on, and whether that still holds.

Where the chapter goes

These sections are planned:

  • LEN in a card: len#eval cells, and a card as a module.
  • Records: what one holds, where it is kept, and how an edit is detected.
  • Reading results with HQL.
  • Evidence: sources, observations, and conclusions that are true, false, both or neither.
  • Bringing in a reasoner: backends as extensions.
  • A person as a judge: justify, review and challenge.
  • Stale results, and what a change reaches.