Skip to content

Commit 0e3a07e

Browse files
committed
docs: drop the references to the downstream project
The module docs and doc/caliper.md described Caliper as the compilation target of one particular caller, down to its file paths and gadget names. State the general case instead: a target for languages that want certified resource bounds, with downstream layers proving their own claims.
1 parent 852af91 commit 0e3a07e

4 files changed

Lines changed: 18 additions & 21 deletions

File tree

Caliper/Core.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import Mathlib.Tactic
44
# A unit-cost machine model
55
66
A small imperative language whose every instruction runs in constant time, intended
7-
as a compilation target for Clean's witness-generation IR
8-
(`Clean/Circuit/WitnessIR.lean`). Programs carry machine-checked upper bounds on
9-
running time and memory. Design rationale, the lowering contract and the trust
10-
boundary are in `doc/caliper.md`; this module is the machine.
7+
as a compilation target for languages that want certified resource bounds. Programs
8+
carry machine-checked upper bounds on running time and memory. Design rationale, the
9+
lowering contract and the trust boundary are in `doc/caliper.md`; this module is the
10+
machine.
1111
1212
Buffers, not a RAM: the machine has an unbounded supply of independent, named
1313
buffers, so the only separation fact a proof ever needs is `b₁ ≠ b₂` on buffer
@@ -56,7 +56,7 @@ abbrev Reg := ℕ
5656
/-- Buffer names. Static: part of the syntax, never a runtime value. -/
5757
abbrev BufId := ℕ
5858

59-
/-- Machine words. Fixed at `w = 64` for Clean's witgen backend. -/
59+
/-- Machine words. Fixed at `w = 64` by the `Caliper64` surface. -/
6060
abbrev Word (w : ℕ) := BitVec w
6161

6262
variable {w : ℕ}

Caliper/Render.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Control flow renders structurally: `ifnz r<c> { … } else { … }`, and `whileN
1212
verdict register, mirroring the `Exec` rules (guard, test, body, repeat). `skip`
1313
renders as `skip`, since compiled code can contain genuine no-ops.
1414
15-
The printer is for *reading* programs, builder output or compiled witgen code. It is
15+
The printer is for *reading* programs, builder output or compiled code. It is
1616
not part of any trusted surface and nothing is proved about it.
1717
-/
1818

Caliper/W64.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import Caliper.Builder
44
/-!
55
# Caliper at word size 64
66
7-
The Caliper core is generic over the word size `w`, but in practice, and in
8-
particular for Clean's witgen backend, the word size is 64. This file is the surface
7+
The Caliper core is generic over the word size `w`, but in practice, and for every
8+
intended backend, the word size is 64. This file is the surface
99
programs and specs should be written against: reducible `abbrev`s fixing `w := 64`,
1010
so that
1111

doc/caliper.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
Caliper is a deep-embedded imperative language whose every instruction runs in
44
constant time, designed as a compilation target for languages that want certified
5-
resource bounds; in particular the witness-generation IR of the
6-
[Clean](https://github.com/rot256/clean) zk-circuit project, which depends on this
7-
library. Programs carry machine-checked upper bounds on running time and on
8-
allocated memory.
5+
resource bounds, witness-generation IRs among them. Programs carry machine-checked
6+
upper bounds on running time and on allocated memory.
97

108
## Files
119

@@ -19,14 +17,13 @@ allocated memory.
1917
| `Liveness.lean` | Backward liveness analysis (`Stmt.liveBefore`), inferred peak register pressure (`Stmt.regPeak`/`Stmt.regPeak₀`), the live-ins + writes bound, the combined buffers-plus-registers judgment (`SpaceBound`), and `Exec.straight_total_footprint_le` |
2018
| `W64.lean` | Fixed 64-bit surface: namespace `Caliper64` of reducible `abbrev`s pinning `w := 64` |
2119

22-
## Where the rest of the pipeline lives
20+
## Scope
2321

2422
This repository contains the machine: syntax, cost semantics, program logic,
25-
builder surface, renderer, and the fixed 64-bit surface `Caliper64`. The layers
26-
on top of it (the witness-generation compiler, the prime-field gadget library
27-
`Fp w p`, the `TimedCircuit` budgeted-witgen structure) live in the
28-
[Clean](https://github.com/rot256/clean) project, which depends on this library.
29-
Claims about those layers are stated and proved there, not here.
23+
builder surface, renderer, and the fixed 64-bit surface `Caliper64`. Layers built
24+
on top of it, such as a compiler targeting the machine or a gadget library, live in
25+
the projects that depend on this one; claims about those layers are stated and
26+
proved there, not here.
3027

3128
## Design decisions
3229

@@ -416,9 +413,9 @@ their own concrete numerals. `#print axioms <theorem>` is the audit tool.
416413
## Caveats / next steps
417414
- Natural next steps: a performant runner beyond the reference interpreter, and
418415
refining the cost model toward a concrete backend.
419-
- A `Proc` record bundling `code`/`Pre`/`Post`/`time`/`space`/`spec` (mirroring
420-
Clean's `FormalCircuit`) would package subroutines more tightly; the examples
421-
inline this pattern with plain `have`s for now.
416+
- A `Proc` record bundling `code`/`Pre`/`Post`/`time`/`space`/`spec` would package
417+
subroutines more tightly; the examples inline this pattern with plain `have`s for
418+
now.
422419
- Registers in the examples use fixed conventions (callee-clobbered scratch); a
423420
register-window or parameterized-register discipline is mechanical to add
424421
(distinctness side conditions close by `decide`).

0 commit comments

Comments
 (0)