Skip to content
Logo

Module map

The framework is 2,163 lines of Lean across 14 modules, plus three examples (309 lines) — 2,472 lines in all. Encapp.lean is the umbrella import.

Authoring

ModuleLinesOwns
Encapp/Core.lean57abstract TEA — App Model Msg, Cmd, Event, ofMsgLog_append
Encapp/Doc.lean56the state model — Atom, Row, Doc, accessors, short16
Encapp/View.lean50the typed view vocabulary, View Msg
Encapp/Ui.lean26the minimal view vocabulary used by the Spec path
Encapp/ViewDsl.lean36app-agnostic authoring sugar over RView

Semantics and proof

ModuleLinesOwns
Encapp/Store.lean89World, Refines, refines_sound, refines_log
Encapp/Adapter.lean60reversedWorld — a non-trivial refinement witness
Encapp/Replay.lean42applyEv, applyEv_idem, replayLog_append
Encapp/Bridge.lean94the interpreter as a Foundation.World; the UI-over-store Layer lift

Codegen

ModuleLinesOwns
Encapp/AppGen.lean1,060ReflApp, Eff, RView, RHandler, HostBinding, reflStep, appCoreJs/appDomJs/appRnJs, all emitters
Encapp/EmuGen.lean310the ENC emulator authored as RView data — the largest worked example of UI-as-data
Encapp/Codegen.lean93the minimal Spec → SPA path used by the counter
Encapp/Spec.lean71the reflected counter model — Op, Handler, Spec, Spec.toApp

Verification

ModuleLinesOwns
Encapp/Workflow.lean119WStep, WCheck, UICheck, Workflow, holds, toJson

Examples

ModuleLinesWhat it demonstrates
Encapp/Examples/Counter.lean65the smallest complete app, both faces (Spec and App Int CMsg), three theorems — and the only non-messaging example
Encapp/Examples/Hello.lean177a real app: routing, identity, composer, two tables, reflection, and the typed↔reflected theorem
Encapp/Examples/HelloWorkflow.lean67three workflows covering all three routes, each native_decide-proven, plus the aggregate corpus

Entry points

FileExecutableEmits
HelloApp.leanhelloappthe hello app for web, native and desktop
EmuGenMain.leanemulatorthe ENC emulator
Main.leanencappthe counter through Codegen.emit
HelloCheck.leanhellocheckhello's final state as JSON, for the compatibility diff

Dependencies

lakefile.lean requires exactly one package:

require «foundation» from ".." / "impl-foundation"

Foundation.Layer.mono is the keystone Bridge.lean uses to lift a store refinement through a UI layer. The axiom audit pins it to exactly zero axioms.

Encapp depends on no protocol, SDK or network library.

Reading order

For the framework itself: CoreDocViewAppGen (the interpreter half) → WorkflowStoreBridge.

For building an app: Getting startedThe app modelEffectsWorkflows.