Skip to content

1. The language

This chapter describes the language. Each section says at its head whether it describes what is built or what is designed.

A LEN program says three kinds of thing, and the language is built to keep them apart.

It says With Mood
what exists and what is asserted type const rel fact claim it is so
what that means context define formal assume complete when checked
what is wanted goal and its verbs: prove, conclude and others desired, and has not happened

The first is the ontology level. It is vocabulary and sentences, and it mentions no logic and no programming language. The other two are the formal level.

Code versus logic

A claim has no meaning until a context gives it one. A context names a language, and everything written in the context is written in that language.

That language may be a logic. In a Horn context a claim is a ground atom, and it is proved by deriving it from clauses and facts. In first-order logic it is a sentence.

The language may also be a programming language. There the same claim is a signature or a test, and what speaks for it is a program that builds and a test that passes.

So code and logic are not two systems in LEN. They are two kinds of context, and one claim may be stated in both. What differs is what a result is worth:

A logic A programming language
A claim is stated as a sentence a signature, or a test
A symbol gets its meaning from define, as clauses or a formula define, as declarations of the language
What settles a claim a proof a build and a run
Truth values true, false true, false, both, neither
One instance proved a passing test speaks for it
The general claim proved supported by evidence, never proved

That two contexts say the same thing about a claim is never assumed. It is a claim of its own.

Contexts in a logic are built in part: Horn contexts are read and proved. Contexts in a programming language are designed and not built.

The sections

  • A first ontology: types, constants, a relation, a fact and a claim, and what len check does with them. Built.

These are planned, in this order:

  • Relations and their forms.
  • Modules: splitting an ontology over files.
  • Contexts: a logic, its truth values, the names it may use and its premises.
  • Giving meaning: define, formal and assume.
  • Goals: work that is wanted, and how len plan and len apply do it.
  • A context in a programming language: signatures, tests and implement.
  • Truth belongs to the context: two values for a proof, four for evidence.