Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

What each suite offers

deduxit's suites (linear logic, ordinary logic, calculi given as rule files, modal logic) each make values and turn values into others: a sequent becomes a decision, a translation, a proof step by step, a drawing. The library lists these as data, so that a program, a web page or the workspace of linked tabs can offer every one of them without code of its own per suite. This chapter is the reference of that list and of the values it passes.

In the library

The module deduxit::protocol (the crate's feature protocol, on by default) holds the list and runs it. Every value is JSON text. Here a classical sequent is translated into intuitionistic logic, and the translation's promise, that both sequents are valid together or not, is checked:

#![allow(unused)]
fn main() {
use deduxit::{Settings, protocol};

let settings = Settings::default().deterministic();
let sequent = r#"{"version": 8, "formulas": [{"V": 0}, {"¬": 0}, {"∨": [0, 1]}],
    "atoms": ["a"], "left": [], "right": [2], "logic": "classical"}"#;
let glivenko = r#"{"translation": "glivenko"}"#;
let translated =
    protocol::run("ordinary.translate", &[sequent], glivenko, &settings, |_| false)?;
let text = protocol::summary("ordinary.sequent", &translated.value, &settings.limits)?;
assert_eq!(text, "⊢ ¬¬(a ∨ ¬a)");
let check = protocol::check(
    "ordinary.translate", &[sequent], glivenko, &translated.value, &settings, |_| false,
)?;
assert_eq!(check.status, protocol::Status::Held);
}

protocol::catalogue() writes the whole list as JSON. Each suite is a value of the trait protocol::Suite, so a suite from another crate can join it.

Kinds of values

A kind says what a value is and how it is written. A statement is a sequent with the calculus it is claimed in; a work kind holds the steps someone took; evidence is what a run found; a rendering is a drawing or a text, quick to make again.

kindwhat it iswritten as
linear.sequenta sequent of linear logic and its modethe sequent's JSON with mode
linear.sessiona proof in progressthe session's JSON
linear.outcomea sequent decidedthe outcome's JSON
linear.proofa proofthe proof's JSON
linear.neta proof netthe proof structure's JSON
ordinary.sequenta sequent of ordinary logic and its logicthe sequent's JSON with logic
ordinary.sessiona proof in progress in LK or LJthe session's JSON
ordinary.outcomea sequent decided, with a derivation or a countermodelthe outcome's JSON
ordinary.derivationa derivation of LK or LJthe derivation's JSON
ordinary.interpolanta Craig interpolant and its two halves{"logic", "partition", "outcome", "interpolant"}
rules.calculusa calculusthe rule file
rules.sequenta sequent to derive in a calculus{"goal", "assumptions"}, text the calculus reads
rules.sessiona derivation in progressthe session's JSON
rules.derivationa derivationthe derivation's JSON
modal.sequenta sequent of modal logic and its systemthe sequent's JSON with system
modal.outcomea sequent decided, with a derivation or a countermodelthe outcome's JSON
modal.modela Kripke model, each world's arrows the worlds it seesthe model's JSON
modal.evaluationa model checked against a sequent{"system", "world", "frame", "holds", "failing", "values"}
drawinga drawing{"svg"}
texta text in a format{"format", "text"}
certificatea certificate for Rocq{"text"}
terma proof read as a lambda-term{"text", "judgement"}

A sequent's JSON with mode, logic or system beside its keys reads as the sequent wherever a sequent is read: the key is ignored there. text, where present, is the sequent as it was typed.

Operations

An operation takes values of the kinds it lists, in order, and makes one value. Its parameters are a JSON object, "" for every default. It promises something of its output and says what checking that costs.

operationfromtopromise
linear.provelinear.sequentlinear.outcomedecides
linear.startlinear.sequentlinear.sessionexact
linear.goallinear.sessionlinear.sequentexact
linear.prooflinear.sessionlinear.proofproves
linear.netlinear.prooflinear.netproves
linear.eliminatelinear.prooflinear.proofproves
linear.terma session or a prooftermrenders
linear.drawa session, a proof or a netdrawingrenders
linear.exporta session or a prooftextrenders
linear.certificatea proof or an outcomecertificatecertifies
linear.duplicatelinear.sequentlinear.sequentexact
ordinary.decideordinary.sequentordinary.outcomedecides
ordinary.startordinary.sequentordinary.sessionexact
ordinary.goalordinary.sessionordinary.sequentexact
ordinary.derivationa session or an outcomeordinary.derivationproves
ordinary.translateordinary.sequentordinary.sequentsame verdict
ordinary.interpolateordinary.sequentordinary.interpolantinterpolates
ordinary.halfordinary.interpolantordinary.sequentexact
ordinary.embedordinary.sequentlinear.sequentsame verdict
ordinary.terma session or a derivationtermrenders
ordinary.drawa session, a derivation or an outcomedrawingrenders
ordinary.exporta session or a derivationtextrenders
ordinary.certificatea derivation or an outcomecertificatecertifies
ordinary.duplicateordinary.sequentordinary.sequentexact
rules.startrules.calculus, rules.sequentrules.sessionexact
rules.derivationrules.sessionrules.derivationproves
rules.from_ordinaryordinary.derivationrules.derivationproves
rules.drawrules.sessiondrawingrenders
rules.exportrules.sessiontextrenders
rules.duplicaterules.sequentrules.sequentexact
modal.decidemodal.sequentmodal.outcomedecides
modal.countermodelmodal.outcomemodal.modelexact
modal.evaluatemodal.sequent, modal.modelmodal.evaluationexact
modal.derivationmodal.outcomerules.derivationproves
modal.calculusmodal.sequentrules.calculusexact
modal.drawmodal.outcomedrawingrenders
modal.exportmodal.outcometextrenders
modal.duplicatemodal.sequentmodal.sequentexact

The catalogue gives each operation's parameters with their values and defaults, its plain name, how its output relates to its inputs once made (derived, work or copy), and whether a run is instant or a search that may end at a bound.

Promises and their checks

promisewhat it claimswhat checking it costs
exactthe output is read off the inputnothing to check
decidesthe verdict has evidence deduxit's checker acceptsinstant
provesthe proof or derivation proves its sequentinstant
same verdictinput and output are valid together or nottwo searches
interpolatesthe interpolant's atoms occur in both parts, and both halves are validtwo searches
rendersthe drawing or text shows its inputnothing to check
certifiesRocq accepts the certificateRocq checks it

A check ends held, failed (a fault of deduxit), open (a part was not decided within the bounds), recorded (it held when the output was made, and the output keeps nothing to check it by again, as a clausal proof's counts), outside (another program checks it) or none.

What a run depends on

Each operation lists the settings keys its output depends on, besides its inputs and parameters: limits.work, search, view, styles.svg and so on, from the settings file. On one thread (--deterministic in the command, Settings::deterministic in the library) the same inputs, parameters and settings give the same output, so a program may keep it. A run that a bound ended says which: its output says "unknown", and the run names the reason and the settings key that lifts it, limits.work for the budget of work.

In the web page's module

The WebAssembly module of the web page (the crate deduxit-web) has the same calls for every suite, under the suite's prefix: none for linear logic, ordinary_ and rules_. describe() answers which call of a suite is which, with its arguments, and the catalogue above:

callwhat it doeslinearordinaryrules
readreads a sequent, or a rule fileread_asordinary_readrules_read
startstarts a proof step by stepstartordinary_startrules_start
viewwhat the page shows of a proofviewordinary_viewrules_view
rulesthe rules that apply at a goalrulesordinary_rulesrules_rules
applytakes a stepapplyordinary_applyrules_apply
undotakes the last step backundoordinary_undorules_undo
closecloses a goal by the searchcloseordinary_closenone
hintthe next steps of the goal's proofhintordinary_hintnone
drawthe proof as SVGdrawordinary_drawrules_draw
export_asthe proof in a formatexport_asordinary_exportrules_export
certificatea Rocq certificate of an outcomecertificateordinary_certificatenone

Each call takes JSON text and the page's settings, and keeps nothing between calls: the documents it takes and gives carry their version. Every view says in layout where the page draws the proof: tree for a derivation, list for a Fitch proof.

The schema of the JSON forms

wire.schema.json is a JSON Schema of every document deduxit writes and reads, with the level each form appeared at, and of the values above. A rule file has a schema of its own, deduxit::rules::SCHEMA (Check a derivation in your own rules). Each release carries both schemas of its version, wire.schema.json and rules.schema.json.