Expand description
Re-export of the LOGOS interface types from the kernel crate.
Provides access to core types like World and Entity for
integration with the LOGOS runtime.
Vernacular interface for the Kernel.
Provides a text-based command interface for interacting with the kernel:
Definition name : type := term.- Add a definitionCheck term.- Print the type of a termEval term.- Normalize and print a termInductive Name := C1 : T1 | C2 : T2.- Define an inductive type
§Surface extensions (they declare a SPELLING, never a global)
Notation "a ⊕ b" := ((myOp a) b).- Mixfix notation; identifier pieces are holesInfixl 65 "⋄" := f./Infixr/Prefix "∽" := neg./Postfix "‼" := bang.Macro "twice $e" := …./MacroRules "list![$x, $xs]" := ….- Pattern rewritingSection Name.…End Name.- Scope aLocal Notationto a section/-- doc -/,/-! module doc -/,-- line comment- Prose, which declares nothing
§Doors
Repl::execute reads ONE command and refuses a prefix; Repl::execute_document reads a
whole document and stops at the first block that does not check.
parse_command and parse_command_in read a command from TEXT ALONE. One surface cannot
be read from text alone — a literate Consider’s equation set has to be compiled against the
discriminant’s inductive, and the constructor list, its order and its arities live in the
kernel context — so parse_command_in_ctx is the door that has one.
§Literate Syntax (English-like alternative)
A Bool is either Yes or No.- Define an inductive type## To add (n: Nat) and (m: Nat) -> Nat:- Define a functionConsider x: When Zero: Yield m.- Pattern matching
Modules§
- lean
- Lean 4 kernel export (NDJSON 3.1) as an input surface of the LOGOS kernel.
- literate_
parser - Literate Specification Parser for the Kernel.
- match_
compile - The equation compiler: surface patterns → the kernel’s positional
Matchtree. - printer
- The kernel’s surface, written back: the exact inverse of
term_parserandcommand_parser. - surface
- The SURFACE environment — user-declared notation, fixity and macros.
Structs§
- Binder
Surface - Everything the SURFACE says about ONE parameter that the kernel’s three-field
Term::Picannot hold: how it is supplied, and what fills it when the caller does not. - Clause
- One equation: one pattern per column, and the body those patterns’ variables are free in.
- Compile
Report - What the compiler noticed on the way through, beyond the term itself.
- Declaration
Surface - A declared type split into the pure kernel type the context is keyed at and the per-parameter surface information that has to be recorded beside it.
- Inductive
Member - One member of an
Command::InductiveBlock. - Repl
- The Vernacular REPL.
- Surface
- The surface environment: a stack of scopes, innermost last.
- Term
Parser - Recursive descent parser for Term syntax.
Enums§
- Assoc
- Which way a chain of one operator nests.
- Binder
Kind - How a parameter is SUPPLIED at a call site – Lean’s four binder kinds.
- Command
- A command in the Vernacular language.
- Interface
Error - Errors that can occur in the interface layer.
- Operator
Form - The shape a fixity command implies for its operator.
- Parse
Error - Parse errors for the Vernacular.
- Pattern
- A surface pattern, exactly as a
Whenclause spells it. - Print
Error - A term or command the LOGOS surface cannot spell (yet).
- Surface
Decl - A declaration that extends the SURFACE rather than the context. Emitted by the command parser, applied by the REPL — so the one place a parser extension can land is the surface environment.
Functions§
- compile_
clauses - Compile a clause matrix against a list of scrutinees.
- compile_
clauses_ reporting compile_clauses, plus what the compiler noticed.- parse_
command - Parse ONE command, and require it to be the WHOLE input.
- parse_
command_ in_ ctx - Parse ONE command with the kernel CONTEXT available, and require it to be the whole input.
- parse_
command_ prefix_ in - Parse ONE command off the FRONT of
input, returning it with the number of bytes consumed. - parse_
command_ prefix_ in_ ctx - Parse ONE command off the FRONT of
inputwith the kernel CONTEXT available, returning it with the number of bytes consumed. - print_
command - Spell
commandas one vernacular command, terminated by its period. - print_
term - Spell
termin the kernel term surface. - print_
term_ in - Spell
termread in a context whose locals arelocals: each prints as its own name. A goal and its hypotheses are spelled this way for a reader; a closed term’s round trip isprint_term’s, which refuses a free name because the surface would read it as a global. - standard_
context - A context of its own for a REPL or a document to extend: a copy-on-write clone of the process’s
one standard library registration,
crate::prelude::StandardLibrary::context.