You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
9
9
10
10
11
-
12
11
## [Releases]
13
12
13
+
## v1.2.0 - April 15, 2026
14
+
15
+
### Added
16
+
17
+
- Added two new fields in `extract_theorems` to be consistent with `extract_decls` (see below):
18
+
-`kind`: always `theorem` for `extract_theorems`.
19
+
-`declaration_messages`: same content as `theorem_messages`. `theorem_messages` is now deprecated and will be removed in a future update.
20
+
- Added `extract_decls`, an upgraded version of `extract_theorems` that extracts all declaration kinds.
21
+
- New `kind` field in each document. Possible values: `theorem`, `def`, `abbrev`, `axiom`, `opaque`, `structure`, `class`, `class inductive`, `inductive`, `instance`, `example`, `unknown`
22
+
- Note: Not all fields are meaningful for all declaration kinds (e.g., `proof_length`/`tactic_counts` only apply to theorems/lemmas with tactic proofs.)
23
+
- This tool should be used instead of `extract_theorems` as it is a strict superset of functionality. `extract_theorems` will be deprecated in a future update.
24
+
25
+
### Fixed
26
+
27
+
- Added "Last Used" and "Requests (24h)" columns to the API key console page for better visibility into API key usage.
New `extract_decls` tool for extracting all declaration kinds, and corresponding updates to `extract_theorems`. Users using `extract_theorems` (which will be deprecated in a future update) should migrate to `extract_decls`. See the [changelog](https://axle.axiommath.ai/v1/docs/changelog/) for details.
@@ -149,6 +149,75 @@ class OutputField(TypedDict, total=False):
149
149
}
150
150
151
151
152
+
# Shared Document Fields documentation for extract_theorems and extract_decls
153
+
DOCUMENT_FIELDS_BASE="""\
154
+
??? "`kind` · str · The kind of declaration"
155
+
The kind of the declaration. For `extract_theorems`, this is always `"theorem"`. For `extract_decls`, possible values are: `theorem`, `def`, `abbrev`, `axiom`, `opaque`, `structure`, `class`, `class inductive`, `inductive`, `instance`, `example`, `unknown`.
156
+
157
+
??? "`declaration` · str · The declaration source code"
158
+
The raw source code of this declaration.
159
+
160
+
??? "`content` · str · Standalone content including declaration and dependencies"
161
+
Complete, self-contained Lean code that includes the declaration and all its local dependencies. Can be compiled independently.
162
+
163
+
??? "`tokens` · list[str] · Raw tokens from the declaration"
164
+
The declaration's source code split into tokens.
165
+
166
+
??? "`signature` · str · Declaration signature (everything before the body)"
167
+
The declaration signature, e.g., `theorem foo (x : Nat) : x = x` or `def bar : Nat`.
168
+
169
+
??? "`type` · str · Pretty-printed type of the declaration"
170
+
The type of the declaration as pretty-printed by Lean.
171
+
172
+
??? "`type_hash` · int · Hash of the canonical type expression"
173
+
Hash of the canonical, alpha-invariant type expression. Useful for deduplication.
174
+
175
+
??? "`is_sorry` · bool · Whether the declaration contains a sorry"
176
+
True if the declaration contains a `sorry`.
177
+
178
+
??? "`index` · int · 0-based index in original file"
179
+
Position of this declaration in the original file. Note: indices may not be contiguous (mutual definitions share indices).
180
+
181
+
??? "`line_pos` · int · 1-based line number where declaration starts"
182
+
Line number where the declaration begins.
183
+
184
+
??? "`end_line_pos` · int · 1-based line number where declaration ends"
185
+
Line number where the declaration ends.
186
+
187
+
??? "`proof_length` · int · Approximate number of tactics in proof"
188
+
Rough measure of proof complexity based on tactic count. Only meaningful for theorems/lemmas with tactic proofs.
189
+
190
+
??? "`tactic_counts` · dict[str, int] · Map of tactic names to occurrence counts"
191
+
Breakdown of which tactics are used and how often. Only meaningful for theorems/lemmas with tactic proofs.
192
+
193
+
??? "`local_type_dependencies` · list[str] · Transitive local dependencies of the type"
194
+
Local declarations that the declaration's type depends on (non-transitive).
195
+
196
+
??? "`local_value_dependencies` · list[str] · Transitive local dependencies of the body"
197
+
Local declarations that the declaration's body/proof depends on (non-transitive).
198
+
199
+
??? "`external_type_dependencies` · list[str] · Immediate external dependencies of the type"
200
+
External constants (builtins, imports) that appear in the type.
201
+
202
+
??? "`external_value_dependencies` · list[str] · Immediate external dependencies of the body"
203
+
External constants (builtins, imports) that appear in the body/proof.
204
+
205
+
??? "`local_syntactic_dependencies` · list[str] · Local constants explicitly written in source"
206
+
Local constants that appear literally in source (not from notation/macro expansion).
207
+
208
+
??? "`external_syntactic_dependencies` · list[str] · External constants explicitly written in source"
209
+
External constants that appear literally in source (not from notation/macro expansion).
210
+
211
+
??? "`declaration_messages` · dict · Messages specific to this declaration"
212
+
Lean messages (`errors`, `warnings`, `infos`) specific to this declaration in the original document.
213
+
214
+
??? "`theorem_messages` · dict · (Deprecated) Messages specific to this declaration"
215
+
Lean messages (`errors`, `warnings`, `infos`) specific to this declaration. For `extract_theorems`, this contains the same data as `declaration_messages`. For `extract_decls`, this is always empty.
216
+
217
+
!!! warning "Deprecated"
218
+
This field is deprecated. Use `declaration_messages` instead for new code."""
@@ -639,6 +655,143 @@ class EndpointMetadata(TypedDict, total=False):
639
655
TIMINGS_OUTPUT,
640
656
],
641
657
},
658
+
"extract_decls": {
659
+
"title": "Extract Declarations",
660
+
"details": "Split a file containing one or more declarations into smaller units, each containing a single declaration along with any required dependencies. Unlike extract_theorems, this works for all declaration kinds (def, theorem, lemma, abbrev, instance, structure, etc.).",
661
+
"description": "split file into separate declarations with dependencies",
662
+
"cli_output": {
663
+
"mode": "multiple_files",
664
+
"supports_output_dir": True,
665
+
"output_dir_default": "extract_decls/",
666
+
"output_file_pattern": "decl_{i}.lean",
667
+
"metadata_to_stderr": False,
668
+
"force_flag": True,
669
+
},
670
+
"cli_examples": [
671
+
"# Extract to default directory\naxle extract-decls combined.lean --environment lean-4.28.0",
Each document in the `documents` dictionary contains:
682
+
683
+
!!! note "Field applicability"
684
+
Not all fields are meaningful for all declaration kinds. For example, `proof_length` and `tactic_counts` are only relevant for theorems/lemmas with tactic proofs. For other declaration kinds (def, abbrev, structure, class, inductive, etc.), these fields may be empty or zero.
"description": "Declaration names mapped to self-contained documents",
789
+
"details": """\
790
+
Dictionary mapping declaration names to self-contained Lean code documents. Each key is a declaration name, and the value is a self-contained breakdown of the declaration, including a content field containing that declaration plus all dependencies it needs (imports, definitions, etc.).""",
0 commit comments