machinechecked 0.1.23__tar.gz → 0.1.25__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {machinechecked-0.1.23 → machinechecked-0.1.25}/PKG-INFO +1 -1
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/machinechecked.egg-info/PKG-INFO +1 -1
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/machinechecked.egg-info/SOURCES.txt +6 -2
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/assess.py +128 -45
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/audit.py +17 -6
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/cli.py +78 -36
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/compare.py +104 -25
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/composition.py +50 -9
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/config.py +2 -1
- machinechecked-0.1.25/engine/python/prooflens/connections.py +756 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/content.py +5 -4
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/data/ProofLensProbe.lean +604 -102
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/data/schema/published-work.schema.json +300 -1
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/dependencies.py +69 -12
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/deps.py +5 -3
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/estimates.py +771 -42
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/export.py +20 -7
- machinechecked-0.1.25/engine/python/prooflens/expressions.py +592 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/facts.py +2 -1
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/impact.py +252 -0
- machinechecked-0.1.25/engine/python/prooflens/layout.py +154 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/moddocs.py +2 -1
- machinechecked-0.1.25/engine/python/prooflens/notation_plan.py +186 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/numbering.py +14 -8
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/probe.py +2 -1
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/proof_facts.py +77 -13
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/published_work.py +71 -12
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/rebound.py +11 -4
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/requirements.py +80 -1
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/review_citations.py +148 -12
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/review_queue.py +18 -7
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/semantic.py +7 -1
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/simple.py +13 -17
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/source_names.py +27 -9
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/source_regions.py +196 -18
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/symbols.py +108 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/targets.py +2 -1
- machinechecked-0.1.23/engine/python/prooflens/web/assets/index-I8FAYkPe.css → machinechecked-0.1.25/engine/python/prooflens/web/assets/index-AZS58fGU.css +1 -1
- machinechecked-0.1.25/engine/python/prooflens/web/assets/index-D9PVfZb1.js +289 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/index.html +2 -2
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/workspace.py +50 -22
- {machinechecked-0.1.23 → machinechecked-0.1.25}/pyproject.toml +1 -1
- machinechecked-0.1.23/engine/python/prooflens/web/assets/index-DC51O0h7.js +0 -289
- {machinechecked-0.1.23 → machinechecked-0.1.25}/LICENSE +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/README.md +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/machinechecked.egg-info/dependency_links.txt +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/machinechecked.egg-info/entry_points.txt +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/machinechecked.egg-info/requires.txt +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/machinechecked.egg-info/top_level.txt +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/__init__.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/__main__.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/authoring.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/bundle.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/cache.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/changes.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/data/prooflens.sty +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/data/schema/evidence.schema.json +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/data/schema/inventory.schema.json +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/data/schema/manifest-claim.schema.json +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/data/schema/manifest-index.schema.json +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/data/semantic.json +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/data/statuses.json +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/evidence.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/excerpt.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/formalization.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/manifest.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/objects.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/paper.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/pdfclaims.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/pipeline.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/promote.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/published.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/readable.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/reopen.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/repin.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/replay.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/retire.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/retrieval.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/review_cli.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/review_sources.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/reviews.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/schemas.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/server.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/sources.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/status.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/steps.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/tex.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/uses.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/util.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/version_map.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/versions.py +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/cursor-editorTextHighlight-kG3uUOwL.svg +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/assets/pdf.worker.min-yatZIOMy.mjs +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/prooflens/web/theme.css +0 -0
- {machinechecked-0.1.23 → machinechecked-0.1.25}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: machinechecked
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.25
|
|
4
4
|
Summary: Read a mathematical paper beside its Lean formalisation, and see claim by claim what Lean establishes.
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Project-URL: Homepage, https://machinechecked.org
|
{machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/machinechecked.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: machinechecked
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.25
|
|
4
4
|
Summary: Read a mathematical paper beside its Lean formalisation, and see claim by claim what Lean establishes.
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Project-URL: Homepage, https://machinechecked.org
|
{machinechecked-0.1.23 → machinechecked-0.1.25}/engine/python/machinechecked.egg-info/SOURCES.txt
RENAMED
|
@@ -19,6 +19,7 @@ engine/python/prooflens/cli.py
|
|
|
19
19
|
engine/python/prooflens/compare.py
|
|
20
20
|
engine/python/prooflens/composition.py
|
|
21
21
|
engine/python/prooflens/config.py
|
|
22
|
+
engine/python/prooflens/connections.py
|
|
22
23
|
engine/python/prooflens/content.py
|
|
23
24
|
engine/python/prooflens/dependencies.py
|
|
24
25
|
engine/python/prooflens/deps.py
|
|
@@ -26,11 +27,14 @@ engine/python/prooflens/estimates.py
|
|
|
26
27
|
engine/python/prooflens/evidence.py
|
|
27
28
|
engine/python/prooflens/excerpt.py
|
|
28
29
|
engine/python/prooflens/export.py
|
|
30
|
+
engine/python/prooflens/expressions.py
|
|
29
31
|
engine/python/prooflens/facts.py
|
|
30
32
|
engine/python/prooflens/formalization.py
|
|
31
33
|
engine/python/prooflens/impact.py
|
|
34
|
+
engine/python/prooflens/layout.py
|
|
32
35
|
engine/python/prooflens/manifest.py
|
|
33
36
|
engine/python/prooflens/moddocs.py
|
|
37
|
+
engine/python/prooflens/notation_plan.py
|
|
34
38
|
engine/python/prooflens/numbering.py
|
|
35
39
|
engine/python/prooflens/objects.py
|
|
36
40
|
engine/python/prooflens/paper.py
|
|
@@ -102,6 +106,6 @@ engine/python/prooflens/web/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2
|
|
|
102
106
|
engine/python/prooflens/web/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2
|
|
103
107
|
engine/python/prooflens/web/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2
|
|
104
108
|
engine/python/prooflens/web/assets/cursor-editorTextHighlight-kG3uUOwL.svg
|
|
105
|
-
engine/python/prooflens/web/assets/index-
|
|
106
|
-
engine/python/prooflens/web/assets/index-
|
|
109
|
+
engine/python/prooflens/web/assets/index-AZS58fGU.css
|
|
110
|
+
engine/python/prooflens/web/assets/index-D9PVfZb1.js
|
|
107
111
|
engine/python/prooflens/web/assets/pdf.worker.min-yatZIOMy.mjs
|
|
@@ -233,15 +233,51 @@ def _rule(c: str, o: dict) -> tuple[str, str | None]:
|
|
|
233
233
|
return "applies", TOTALISED[c]
|
|
234
234
|
|
|
235
235
|
|
|
236
|
+
def _binder_names(srec: dict) -> dict[str, str]:
|
|
237
|
+
"""The name the statement record gives each of its binders, by the binder's identity: those
|
|
238
|
+
that open it (an unnamed hypothesis is `h1`, `h2`, …) and those inside its tree."""
|
|
239
|
+
out: dict[str, str] = {}
|
|
240
|
+
|
|
241
|
+
def walk(n):
|
|
242
|
+
if not isinstance(n, dict):
|
|
243
|
+
return
|
|
244
|
+
if n.get("id") is not None and n.get("name"):
|
|
245
|
+
out.setdefault(n["id"], n["name"])
|
|
246
|
+
walk(n.get("logic"))
|
|
247
|
+
for a in n.get("args") or []:
|
|
248
|
+
walk(a)
|
|
249
|
+
for b in srec.get("binders") or []:
|
|
250
|
+
if b.get("id") is not None and b.get("name"):
|
|
251
|
+
out[b["id"]] = b["name"]
|
|
252
|
+
walk(srec.get("tree"))
|
|
253
|
+
return out
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
def _subterms(o: dict, names: dict[str, str]) -> list[dict]:
|
|
257
|
+
"""The sub-term at each position of one recorded application (`at`, and `text` when the
|
|
258
|
+
probe printed it), with the binder or hypothesis around it (`within`), named as the
|
|
259
|
+
statement names it."""
|
|
260
|
+
out = []
|
|
261
|
+
for s in o.get("subterms") or []:
|
|
262
|
+
rec = {"at": s.get("at"), "text": s.get("text")}
|
|
263
|
+
w = s.get("within")
|
|
264
|
+
if isinstance(w, dict):
|
|
265
|
+
rec["within"] = {**w, "name": names.get(w.get("id")) or w.get("name")}
|
|
266
|
+
out.append(rec)
|
|
267
|
+
return out
|
|
268
|
+
|
|
269
|
+
|
|
236
270
|
def occurrences(srec: dict, c: str) -> list[dict] | None:
|
|
237
271
|
"""The applications of the totalised operation `c` that the probe read in a statement, each
|
|
238
272
|
with its type (`type`, its head constant `type_head`), the structure on it that decides the
|
|
239
|
-
rule (`structure`), the state of the rule there and the rule itself,
|
|
240
|
-
|
|
241
|
-
|
|
273
|
+
rule (`structure`), the state of the rule there and the rule itself, the positions of the
|
|
274
|
+
application in the proposition (`at`), and the sub-term at each with the binder or
|
|
275
|
+
hypothesis around it (`subterms`, when the probe printed them). None for an operation the
|
|
276
|
+
probe does not read by type, and for a record from before it read them."""
|
|
242
277
|
ops = srec.get("order_ops")
|
|
243
278
|
if not isinstance(ops, dict) or c not in READ_BY_TYPE:
|
|
244
279
|
return None
|
|
280
|
+
names = _binder_names(srec)
|
|
245
281
|
out = []
|
|
246
282
|
for o in _occurrences(c, ops):
|
|
247
283
|
state, rule = _rule(c, o)
|
|
@@ -250,6 +286,8 @@ def occurrences(srec: dict, c: str) -> list[dict] | None:
|
|
|
250
286
|
rec = {"operation": c, "type": o.get("carrier") or None,
|
|
251
287
|
"type_head": o.get("carrier_head") or None, "structure": structure,
|
|
252
288
|
"state": state, "rule": rule, "at": list(o.get("at") or [])}
|
|
289
|
+
if o.get("subterms"):
|
|
290
|
+
rec["subterms"] = _subterms(o, names)
|
|
253
291
|
if state == "applies" and o.get("conditions"):
|
|
254
292
|
conds = [{k: d[k] for k in ("condition", "state", "by", "premise", "statement")
|
|
255
293
|
if k in d} for d in o["conditions"]]
|
|
@@ -1046,8 +1084,10 @@ class Assessor:
|
|
|
1046
1084
|
(with the statement's as `statement_fingerprint`), and its id ends in `@` and that
|
|
1047
1085
|
position. A dismissal naming `at` and an application's fingerprint dismisses that
|
|
1048
1086
|
application only: the one at `at` when its fingerprint matches, otherwise the one
|
|
1049
|
-
application with that fingerprint (it moved)
|
|
1050
|
-
changes
|
|
1087
|
+
application with that fingerprint (it moved). It lapses when the application at `at`
|
|
1088
|
+
changes and it follows no application, and the warning at `at` is then marked
|
|
1089
|
+
`dismissal_stale` unless a dismissal of its own matches it. A dismissal without `at`
|
|
1090
|
+
(the form before applications were read one by one)
|
|
1051
1091
|
dismisses every warning of its operation in the statement while the statement's
|
|
1052
1092
|
fingerprint matches, and says so (`dismissed.form`: `statement`)."""
|
|
1053
1093
|
fp = srec.get("fingerprint")
|
|
@@ -1063,7 +1103,11 @@ class Assessor:
|
|
|
1063
1103
|
if d["at"] in same:
|
|
1064
1104
|
targets[(d["trigger"], d["at"])] = ("dismissed", d)
|
|
1065
1105
|
elif len(same) == 1:
|
|
1066
|
-
|
|
1106
|
+
# It follows its application, which moved there: a lapsed dismissal given at that
|
|
1107
|
+
# position does not override it, and its own old position is not marked stale.
|
|
1108
|
+
if targets.get((d["trigger"], same[0]), ("stale",))[0] == "stale":
|
|
1109
|
+
targets[(d["trigger"], same[0])] = ("dismissed", d)
|
|
1110
|
+
continue
|
|
1067
1111
|
if d["at"] not in same and any(a == d["at"] for a, _ in here):
|
|
1068
1112
|
targets.setdefault((d["trigger"], d["at"]), ("stale", d))
|
|
1069
1113
|
for i in items:
|
|
@@ -1094,27 +1138,32 @@ class Assessor:
|
|
|
1094
1138
|
f["dismissal_stale"] = True
|
|
1095
1139
|
|
|
1096
1140
|
def add_warning(self, code, subj, name, rec, message, trigger, fingerprint=None,
|
|
1097
|
-
legacy_only=False, **extra):
|
|
1141
|
+
legacy_only=False, reported=(), **extra):
|
|
1098
1142
|
"""A warning, dismissed by a dismissal of its code, subject (`name`) and trigger whose
|
|
1099
|
-
fingerprint is the subject's current one (`rec`'s)
|
|
1100
|
-
such a dismissal
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1143
|
+
fingerprint is the subject's current one (`rec`'s). A warning no dismissal matches is
|
|
1144
|
+
marked `dismissal_stale` when such a dismissal has another fingerprint that is not in
|
|
1145
|
+
`reported`, the fingerprints of the other warnings of this code, subject and trigger
|
|
1146
|
+
that the assessment reports: a dismissal of one of those is that warning's, not a
|
|
1147
|
+
lapsed dismissal of this one. The finding records `fingerprint` when given (what a
|
|
1148
|
+
dismissal of it records) and `rec`'s otherwise. With `legacy_only`, only dismissals
|
|
1149
|
+
without `at` are considered here, and one that applies is marked as naming the whole
|
|
1150
|
+
statement (`form`: `statement`)."""
|
|
1104
1151
|
fp = rec.get("fingerprint")
|
|
1105
1152
|
f = _finding("warning", code, subj, message, trigger=trigger,
|
|
1106
1153
|
fingerprint=fingerprint or fp,
|
|
1107
1154
|
signal="low" if trigger in LOW_SIGNAL else "normal", **extra)
|
|
1108
|
-
for d in self.dismissals
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1155
|
+
same = [d for d in self.dismissals
|
|
1156
|
+
if d.get("code") == code and d.get("subject") == name
|
|
1157
|
+
and d.get("trigger") == trigger
|
|
1158
|
+
and not ("at" in d and (legacy_only or code == "totalised"))]
|
|
1159
|
+
hits = [d for d in same if d.get("fingerprint") == fp]
|
|
1160
|
+
if hits:
|
|
1161
|
+
f["dismissed"] = {"rationale": hits[-1].get("rationale", ""),
|
|
1162
|
+
"by": hits[-1].get("by", "")}
|
|
1163
|
+
if legacy_only:
|
|
1164
|
+
f["dismissed"]["form"] = "statement"
|
|
1165
|
+
elif any(d.get("fingerprint") not in reported for d in same):
|
|
1166
|
+
f["dismissal_stale"] = True
|
|
1118
1167
|
self.findings.append(f)
|
|
1119
1168
|
|
|
1120
1169
|
# -- claims ---------------------------------------------------------------------------
|
|
@@ -1342,39 +1391,46 @@ class Assessor:
|
|
|
1342
1391
|
plain = [d for d in docs if d.get("kind", "none") == "none"]
|
|
1343
1392
|
found = {id(d) for d in plain} - {id(d) for d in undeclared_doc_names(plain, lean_root)}
|
|
1344
1393
|
docs = [d for d in docs if id(d) not in found]
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1394
|
+
# A name under two headings of one docstring is two warnings with two fingerprints; a
|
|
1395
|
+
# dismissal of one is not a lapsed dismissal of the other.
|
|
1396
|
+
fps = [stale_doc_fingerprint(d) for d in docs]
|
|
1397
|
+
for d, fp in zip(docs, fps):
|
|
1398
|
+
reported = {g for e, g in zip(docs, fps)
|
|
1399
|
+
if (e["module"], e["name"]) == (d["module"], d["name"])}
|
|
1400
|
+
self.add_warning("module-doc-name", d["module"], d["module"], {"fingerprint": fp},
|
|
1401
|
+
stale_doc_message(d), d["name"], reported=reported)
|
|
1349
1402
|
self.findings[-1].update(file=d["file"], line=d["line"])
|
|
1350
1403
|
|
|
1351
1404
|
def review_citation_checks(self):
|
|
1352
1405
|
"""A warning for each name or path cited in backticks by the review files that nothing
|
|
1353
|
-
resolves (`review_citations.py`),
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
token as trigger
|
|
1406
|
+
resolves (`review_citations.py`), one for each block of review text that cites it,
|
|
1407
|
+
with its file and lines; a violation when the configuration says
|
|
1408
|
+
`review_citations_strict`. The warning never changes a status, and an auditor can
|
|
1409
|
+
dismiss it (code `review-citation`, the review file as subject, the token as trigger,
|
|
1410
|
+
the block as `at`); a dismissal covers its block only (`review_citations.dismiss`)."""
|
|
1357
1411
|
from . import review_citations as rc
|
|
1358
1412
|
files = getattr(self.cfg, "reviews", None)
|
|
1359
1413
|
root = getattr(self.cfg, "root", None)
|
|
1360
1414
|
if not files or root is None:
|
|
1361
1415
|
return
|
|
1362
|
-
|
|
1416
|
+
ignore = getattr(self.cfg, "review_citations_ignore", None)
|
|
1417
|
+
cites = rc.citations(files, root, ignore)
|
|
1363
1418
|
lean_root = getattr(self.cfg, "lean_root", None) or root
|
|
1364
1419
|
bases = [root] + ([lean_root] if not lean_root.is_relative_to(root) else [])
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1420
|
+
strict = getattr(self.cfg, "review_citations_strict", False)
|
|
1421
|
+
warnings = []
|
|
1422
|
+
for w in rc.blocks(rc.unresolved(cites, self.lean.get("names"), bases)):
|
|
1423
|
+
f = _finding("violation" if strict else "warning", "review-citation", w["file"],
|
|
1424
|
+
rc.message(w) + rc.replaced_default(w["token"], ignore),
|
|
1425
|
+
trigger=w["token"], file=w["file"], line=w["line"],
|
|
1426
|
+
lines=w["lines"], at=w["at"])
|
|
1427
|
+
f["id"] += "@" + w["at"]
|
|
1428
|
+
if not strict:
|
|
1429
|
+
f.update(fingerprint=w["fingerprint"],
|
|
1430
|
+
signal="low" if w["token"] in LOW_SIGNAL else "normal")
|
|
1431
|
+
warnings.append(f)
|
|
1432
|
+
self.findings.append(f)
|
|
1433
|
+
rc.dismiss(warnings, self.dismissals)
|
|
1378
1434
|
|
|
1379
1435
|
# -- gates ----------------------------------------------------------------------------
|
|
1380
1436
|
|
|
@@ -1501,8 +1557,11 @@ class Assessor:
|
|
|
1501
1557
|
f"the source region at {c['location']} uses macros defined outside "
|
|
1502
1558
|
f"it ({where}); a change to those definitions does not change the "
|
|
1503
1559
|
"pin. Pin the definitions whose values are part of the claim "
|
|
1504
|
-
"(machinechecked inventory rebound --macro NAME)
|
|
1560
|
+
"(machinechecked inventory rebound --macro NAME). Listing a macro "
|
|
1561
|
+
"as notation reopens the readings of the passages that use it "
|
|
1562
|
+
"(machinechecked inventory notation --add NAME lists them); list the "
|
|
1505
1563
|
"notation in notation_macros", names)
|
|
1564
|
+
self.macros_pinned_elsewhere(c, region.get("pinned_elsewhere") or [])
|
|
1506
1565
|
continue
|
|
1507
1566
|
a = match_anchor(c, anchors)
|
|
1508
1567
|
if a is None:
|
|
@@ -1538,6 +1597,30 @@ class Assessor:
|
|
|
1538
1597
|
if a.get("suggested"):
|
|
1539
1598
|
self.findings[-1]["suggested"] = a["suggested"]
|
|
1540
1599
|
|
|
1600
|
+
def macros_pinned_elsewhere(self, claim: dict, macros: list[dict]):
|
|
1601
|
+
"""One warning per passage that uses macros whose definitions another claim's pin holds
|
|
1602
|
+
(`source_regions.pinned_elsewhere`): a change to such a definition fails that claim's
|
|
1603
|
+
source check, and reopens no reading of this passage. Its trigger is the set of macros;
|
|
1604
|
+
its fingerprint covers the passage's pin and the digests of the definitions, so a
|
|
1605
|
+
dismissal lapses when either changes."""
|
|
1606
|
+
if not macros:
|
|
1607
|
+
return
|
|
1608
|
+
import hashlib
|
|
1609
|
+
names = " ".join(m["macro"] for m in macros)
|
|
1610
|
+
where = "; ".join(f"{m['macro']} at {', '.join(m['defined'])}, pinned by "
|
|
1611
|
+
f"{', '.join(m['claims'])}" for m in macros)
|
|
1612
|
+
fingerprint = hashlib.sha256("".join(
|
|
1613
|
+
[f"passage {claim.get('source_sha256')}\n"]
|
|
1614
|
+
+ [f"macro {m['macro']} {m['sha256']}\n" for m in macros]).encode()).hexdigest()
|
|
1615
|
+
self.add_warning(
|
|
1616
|
+
"source-macro-pinned-elsewhere", claim["id"], claim["id"],
|
|
1617
|
+
{"fingerprint": fingerprint},
|
|
1618
|
+
f"the source region at {claim['location']} uses macros whose definitions another "
|
|
1619
|
+
f"claim pins ({where}); a change to those definitions fails that claim's source "
|
|
1620
|
+
"check but reopens no reading of this passage. Pin them in this claim too "
|
|
1621
|
+
"(machinechecked inventory rebound --macro NAME) for its readings to depend on "
|
|
1622
|
+
"them", names)
|
|
1623
|
+
|
|
1541
1624
|
|
|
1542
1625
|
def unpinned_passages(inventory: dict, tex: dict | None) -> dict[str, str]:
|
|
1543
1626
|
"""The claims whose passage in the manuscript no longer matches their pin, each with the
|
|
@@ -125,8 +125,9 @@ def source_path(lean_root: Path, module: str | None) -> str | None:
|
|
|
125
125
|
project rather than in a dependency."""
|
|
126
126
|
if not module or not re.fullmatch(r"[\w.']+", module):
|
|
127
127
|
return None
|
|
128
|
+
from .layout import module_file
|
|
128
129
|
sr = source_root(lean_root)
|
|
129
|
-
rel =
|
|
130
|
+
rel = module_file(lean_root, module)
|
|
130
131
|
if sr is None or not (lean_root / rel).is_file():
|
|
131
132
|
return None
|
|
132
133
|
return sr[1] + rel
|
|
@@ -136,13 +137,23 @@ def source_info(lean_root: Path | None, roots: list[str], repository: str | None
|
|
|
136
137
|
private: bool = False) -> dict:
|
|
137
138
|
"""Where the reader's Lean source links point: the GitHub repository (given, else the
|
|
138
139
|
project's `origin` remote), whether it is private (the reader then does not show its name;
|
|
139
|
-
the links still name it), the
|
|
140
|
-
|
|
140
|
+
the links still name it), the path inside it of the folder that holds the modules
|
|
141
|
+
(`source_prefix`: the project's path joined with its libraries' source folder), and the
|
|
142
|
+
top-level module names whose files are the project's own and in that folder. When the
|
|
143
|
+
libraries keep their sources in different folders, the folder most of them use is given,
|
|
144
|
+
and the roots in the others get no source link."""
|
|
145
|
+
from collections import Counter
|
|
146
|
+
from .layout import library_dir
|
|
141
147
|
if lean_root is None:
|
|
142
148
|
return {}
|
|
143
149
|
sr = source_root(lean_root)
|
|
150
|
+
dirs = {r: library_dir(lean_root, r.split(".")[0]) for r in roots}
|
|
151
|
+
present = {r: d for r, d in dirs.items()
|
|
152
|
+
if (lean_root / d / r).is_dir() or (lean_root / d / f"{r}.lean").is_file()}
|
|
153
|
+
counts = Counter(present.values())
|
|
154
|
+
common = min(counts, key=lambda d: (-counts[d], d != ".", d)) if counts else "."
|
|
155
|
+
prefix = None if sr is None else sr[1] + ("" if common == "." else common + "/")
|
|
144
156
|
return {"repository": repository or github_repository(lean_root),
|
|
145
157
|
"repository_private": bool(private),
|
|
146
|
-
"source_prefix":
|
|
147
|
-
"source_roots": sorted(r for r in
|
|
148
|
-
or (lean_root / f"{r}.lean").is_file())}
|
|
158
|
+
"source_prefix": prefix,
|
|
159
|
+
"source_roots": sorted(r for r, d in present.items() if d == common)}
|
|
@@ -299,21 +299,36 @@ def _simple_site(root: Path, paper: Path, web: str | None, reuse_lean: bool = Fa
|
|
|
299
299
|
|
|
300
300
|
|
|
301
301
|
def _check_summary(view: dict, root: Path) -> tuple[dict, dict]:
|
|
302
|
-
"""The semantic summary `check` gives in zero configuration, and each claim's facts
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
302
|
+
"""The semantic summary `check` gives in zero configuration, and each claim's facts
|
|
303
|
+
(`_check_workspaces`)."""
|
|
304
|
+
summary, facts, _ = _check_workspaces(view, root)
|
|
305
|
+
return summary, facts
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
def _check_workspaces(view: dict, root: Path) -> tuple[dict, dict, dict]:
|
|
309
|
+
"""The semantic summary `check` gives in zero configuration, each claim's facts, and each
|
|
310
|
+
claim's computed hints: the facts of the site this view would write (`semantic.of_view`),
|
|
311
|
+
with the findings in force of the working directory's workspaces checked against that
|
|
312
|
+
site's data, and the hints their alignments give there (`estimates.workspace_hints`, which
|
|
313
|
+
the summary does not count). The site is written to a temporary directory for the purpose
|
|
314
|
+
when there are any (`check` writes no site)."""
|
|
315
|
+
from . import estimates as est
|
|
306
316
|
from . import semantic
|
|
307
317
|
work = root / cfgmod.work_dir_name(root)
|
|
308
|
-
found = None
|
|
309
|
-
|
|
318
|
+
found, hints = None, {}
|
|
319
|
+
want_found, want_hints = semantic.has_findings(work), est.has_alignments(work)
|
|
320
|
+
if want_found or want_hints:
|
|
310
321
|
import tempfile
|
|
311
322
|
from .simple import write_view_site
|
|
312
323
|
with tempfile.TemporaryDirectory() as tmp:
|
|
313
324
|
site = Path(tmp) / "site"
|
|
314
325
|
write_view_site({**view, "pdf": None}, site, None, root)
|
|
315
|
-
|
|
316
|
-
|
|
326
|
+
if want_found:
|
|
327
|
+
found = semantic.workspace_findings(work, site / "data", root)
|
|
328
|
+
if want_hints:
|
|
329
|
+
hints = est.workspace_hints(work, site / "data", work / "sources")
|
|
330
|
+
summary, facts = semantic.of_view(view["body"], root, found)
|
|
331
|
+
return summary, facts, hints
|
|
317
332
|
|
|
318
333
|
|
|
319
334
|
def _print_simple(body, summary: dict | None = None):
|
|
@@ -576,6 +591,12 @@ def _print_workspace(v: dict) -> None:
|
|
|
576
591
|
+ f" [{f['currency']['state']}]" + (f" supersedes {f['supersedes']}: "
|
|
577
592
|
f"{f['reason']}" if f.get("supersedes")
|
|
578
593
|
else ""))
|
|
594
|
+
if f.get("impact"):
|
|
595
|
+
from .impact import difference_words
|
|
596
|
+
imp = f["impact"]
|
|
597
|
+
print(f" at the use {imp['use']}: {imp['outcome']}; "
|
|
598
|
+
f"{difference_words(imp.get('difference') or {})}")
|
|
599
|
+
print(f" why: {imp.get('why')}")
|
|
579
600
|
if f.get("question"):
|
|
580
601
|
print(f" question: {f['question']}")
|
|
581
602
|
if f.get("would_decide"):
|
|
@@ -910,7 +931,7 @@ NO_MODULES = ("--fix-modules: only a project with a machinechecked.toml lists `m
|
|
|
910
931
|
"zero configuration reads every built module")
|
|
911
932
|
|
|
912
933
|
|
|
913
|
-
FINDING_KEYS = ("id", "tier", "code", "subject", "message", "trigger", "file", "line",
|
|
934
|
+
FINDING_KEYS = ("id", "tier", "code", "subject", "message", "trigger", "file", "line", "lines",
|
|
914
935
|
"fingerprint", "at", "dismissed", "dismissal_stale", "resolved", "occurrences",
|
|
915
936
|
"occurrences_complete")
|
|
916
937
|
|
|
@@ -979,6 +1000,18 @@ def _check_json(a):
|
|
|
979
1000
|
sys.exit(1)
|
|
980
1001
|
|
|
981
1002
|
|
|
1003
|
+
def _with_hints(claims: list[dict], hints: dict[str, dict]) -> None:
|
|
1004
|
+
"""Each claim's computed hints from the working directory's workspaces, attributed to the
|
|
1005
|
+
workspace and auditor whose alignment gives them (`hints`), and those a difference
|
|
1006
|
+
dismissed (`dismissed_hints`): present only when there are some. Pointers, not statuses."""
|
|
1007
|
+
for c in claims:
|
|
1008
|
+
h = hints.get(c["id"]) or {}
|
|
1009
|
+
if h.get("hints"):
|
|
1010
|
+
c["hints"] = h["hints"]
|
|
1011
|
+
if h.get("dismissed"):
|
|
1012
|
+
c["dismissed_hints"] = h["dismissed"]
|
|
1013
|
+
|
|
1014
|
+
|
|
982
1015
|
def _check_full_json(a) -> tuple[dict, list[dict], bool]:
|
|
983
1016
|
"""`check --json` with a machinechecked.toml: the document's fields, its claims, and whether
|
|
984
1017
|
the assessment found a violation."""
|
|
@@ -994,6 +1027,8 @@ def _check_full_json(a) -> tuple[dict, list[dict], bool]:
|
|
|
994
1027
|
facts = {c["id"]: c.get("semantic") for c in idx["claims"]}
|
|
995
1028
|
for c in claims:
|
|
996
1029
|
c["semantic"] = facts.get(c["id"])
|
|
1030
|
+
from .estimates import workspace_hints
|
|
1031
|
+
_with_hints(claims, workspace_hints(cfg.out_dir, res["site"] / "data"))
|
|
997
1032
|
out = {"mode": "full", "release": idx["release"],
|
|
998
1033
|
"project": idx.get("project", {}).get("commit"),
|
|
999
1034
|
"semantic": idx.get("semantic"),
|
|
@@ -1040,9 +1075,10 @@ def _check_simple_json(a) -> tuple[dict, list[dict], bool]:
|
|
|
1040
1075
|
"unit": c.get("unit", "statement"), "parent": c.get("parent"),
|
|
1041
1076
|
**(_step_json(c) if c.get("unit") else {})}
|
|
1042
1077
|
for c in body["claims"]]
|
|
1043
|
-
summary, facts =
|
|
1078
|
+
summary, facts, hints = _check_workspaces(view, root)
|
|
1044
1079
|
for c in claims:
|
|
1045
1080
|
c["semantic"] = facts.get(c["id"])
|
|
1081
|
+
_with_hints(claims, hints)
|
|
1046
1082
|
num = body.get("numbering") or {"references": [], "pattern": None}
|
|
1047
1083
|
out = {"mode": "simple", "paper": body["paper"], "title": body["title"],
|
|
1048
1084
|
"release": view_release(body), "commit": body.get("commit"),
|
|
@@ -1131,6 +1167,13 @@ def _build_full(a, site: str | None = None, refresh: bool = False, fix_modules:
|
|
|
1131
1167
|
print(f"note: {len(whole)} totalisation warning(s) are dismissed by a dismissal of the "
|
|
1132
1168
|
"operation in the whole statement, which holds until the statement changes; a "
|
|
1133
1169
|
"dismissal with the warning's `at` and `fingerprint` names one application")
|
|
1170
|
+
by_file = [f for f in details if f["code"] == "review-citation"
|
|
1171
|
+
and (f.get("dismissed") or {}).get("form") == "file"]
|
|
1172
|
+
if by_file:
|
|
1173
|
+
print(f"note: {len(by_file)} review-citation warning(s) are dismissed by a dismissal "
|
|
1174
|
+
"without `at`, which covers the first block of review text citing the token in "
|
|
1175
|
+
"its file and no other; a dismissal with the warning's `at` and `fingerprint` "
|
|
1176
|
+
"names one block")
|
|
1134
1177
|
rg = _replay_guard(cfg, res["evidence"])
|
|
1135
1178
|
if rg and rg["message"]:
|
|
1136
1179
|
print(f"note: independent replay: {rg['message']}")
|
|
@@ -1552,6 +1595,14 @@ def cmd_compare(a):
|
|
|
1552
1595
|
if not out["results"]:
|
|
1553
1596
|
print(f"no composition is recorded for {out['subject']['claim']}")
|
|
1554
1597
|
return
|
|
1598
|
+
if op == "connections":
|
|
1599
|
+
from .connections import lines as connection_lines
|
|
1600
|
+
for c in out["results"]:
|
|
1601
|
+
print(f"{c['workspace']} ({c['mode']}), {c['reviewer']}:")
|
|
1602
|
+
print("\n".join(connection_lines(c)))
|
|
1603
|
+
if not out["results"]:
|
|
1604
|
+
print(f"no connection is recorded for {out['subject']['claim']}")
|
|
1605
|
+
return
|
|
1555
1606
|
for r in out["results"]:
|
|
1556
1607
|
print("\n".join(cmp.statement_lines(r)) if "statement" not in r
|
|
1557
1608
|
or isinstance(r.get("statement"), dict) else
|
|
@@ -1561,23 +1612,8 @@ def cmd_compare(a):
|
|
|
1561
1612
|
return
|
|
1562
1613
|
if not a.claim:
|
|
1563
1614
|
sys.exit("name a claim (its id, key or number), or give --query OP TARGET")
|
|
1564
|
-
reading =
|
|
1565
|
-
|
|
1566
|
-
from . import workspace as wsp
|
|
1567
|
-
from .targets import Snapshot
|
|
1568
|
-
cid = site.resolve_claim(a.claim)
|
|
1569
|
-
try:
|
|
1570
|
-
ws = wsp.read(wsp.find(work, a.workspace))
|
|
1571
|
-
except wsp.WorkspaceError as e:
|
|
1572
|
-
raise cmp.CompareError(str(e), "unknown-workspace") from None
|
|
1573
|
-
v = wsp.view(ws, Snapshot(work / "site" / "data"), cid, root)
|
|
1574
|
-
from .objects import derivations
|
|
1575
|
-
reading = {"workspace": ws["id"], "reviewer": v["reviewer"], "mode": v["mode"],
|
|
1576
|
-
**((v["claims"].get(cid) or {}).get("reading")
|
|
1577
|
-
or {"requirements": [], "witnesses": [], "alignments": [],
|
|
1578
|
-
"questions": []}),
|
|
1579
|
-
"compositions": (v["claims"].get(cid) or {}).get("compositions") or [],
|
|
1580
|
-
"derivations": derivations((v["claims"].get(cid) or {}).get("evidence"))}
|
|
1615
|
+
reading = cmp.workspace_reading(site, work, a.workspace, a.claim, root) \
|
|
1616
|
+
if a.workspace else None
|
|
1581
1617
|
out = cmp.claim_packet(site, a.claim, a.stage, a.limit, a.after, reading)
|
|
1582
1618
|
except cmp.CompareError as e:
|
|
1583
1619
|
if e.kind in ("no-build", "no-project") and not a.json:
|
|
@@ -1760,7 +1796,7 @@ def cmd_review_promote(a):
|
|
|
1760
1796
|
|
|
1761
1797
|
|
|
1762
1798
|
INVENTORY = {"regions": "source_regions", "repin": "repin", "rebound": "rebound",
|
|
1763
|
-
"retire": "retire"}
|
|
1799
|
+
"retire": "retire", "notation": "notation_plan"}
|
|
1764
1800
|
|
|
1765
1801
|
|
|
1766
1802
|
def cmd_inventory(a):
|
|
@@ -2055,25 +2091,30 @@ def _add_compare(sub) -> None:
|
|
|
2055
2091
|
"search CLAIM-OR-TEXT (the project's declarations by statement content), "
|
|
2056
2092
|
"proof-facts NAME (the facts inside its proof), uses NAME (where it is "
|
|
2057
2093
|
"applied, with the source of each premise), composition CLAIM (the "
|
|
2058
|
-
"auditors' compositions for it, with --workspace for one workspace),
|
|
2094
|
+
"auditors' compositions for it, with --workspace for one workspace), "
|
|
2095
|
+
"connections CLAIM (the auditors' connections between objects), impact "
|
|
2059
2096
|
"NAME (how each main result uses it, and which claims' Lean uses it), "
|
|
2060
2097
|
"expansion KEY (a definition at the arguments of one application, by the "
|
|
2061
2098
|
"key a statement gives it)")
|
|
2062
2099
|
co.add_argument("--in", dest="within", metavar="CALLER",
|
|
2063
2100
|
help="with uses: only the applications inside this declaration, or the one "
|
|
2064
2101
|
"application with this id (app:CALLER:N), each with every local of its "
|
|
2065
|
-
"context"
|
|
2102
|
+
"context; with proof-facts: only the facts at or inside this position of "
|
|
2103
|
+
"the proof (a fact's `at`, such as an application's)")
|
|
2066
2104
|
co.add_argument("--match", metavar="TEXT",
|
|
2067
2105
|
help="with proof-facts: rank the facts by the symbols they share with TEXT")
|
|
2068
2106
|
co.add_argument("--main", action="append", metavar="NAME",
|
|
2069
2107
|
help="with impact: a main result to trace from, a declaration or a claim "
|
|
2070
2108
|
"(its linked Lean); repeat for several (default: those `workspace main` "
|
|
2071
2109
|
"saved, else the declarations linked to the paper's theorems)")
|
|
2072
|
-
co.add_argument("--limit", type=int, help="return at most this many definitions or results"
|
|
2073
|
-
|
|
2074
|
-
co.add_argument("--
|
|
2075
|
-
"
|
|
2076
|
-
|
|
2110
|
+
co.add_argument("--limit", type=int, help="return at most this many definitions or results "
|
|
2111
|
+
"(with proof-facts: the facts of one page, 200 by default)")
|
|
2112
|
+
co.add_argument("--after", metavar="ID", help="continue a list after this item (with "
|
|
2113
|
+
"proof-facts: Lean reads the page after this fact)")
|
|
2114
|
+
co.add_argument("--workspace", metavar="ID", help="include this workspace's requirements, "
|
|
2115
|
+
"compositions and connections of the claim (informed stage only); with "
|
|
2116
|
+
"--query composition or connections, only this workspace's; with --query "
|
|
2117
|
+
"impact, the main results it saves")
|
|
2077
2118
|
co.add_argument("--all-libraries", action="store_true",
|
|
2078
2119
|
help="with --query search: search every library of the project, also those "
|
|
2079
2120
|
"the paper's build leaves out because formalization.yaml maps them only to "
|
|
@@ -2150,7 +2191,8 @@ def _add_inventory(sub) -> None:
|
|
|
2150
2191
|
description="regions: hash line pins as regions at the revision they were pinned at "
|
|
2151
2192
|
"(docs/SOURCE_REGIONS.md); rebound: change the bounds of claims' regions there; repin: "
|
|
2152
2193
|
"move the claims to a new revision of the paper; retire: remove the readings review markers "
|
|
2153
|
-
"record of passages that no longer use their declaration
|
|
2194
|
+
"record of passages that no longer use their declaration; notation: report the readings "
|
|
2195
|
+
"a change to notation_macros would reopen (it writes nothing). "
|
|
2154
2196
|
"Each prints a plan, and changes files only with --write; pass --help after the action "
|
|
2155
2197
|
"for its options.")
|
|
2156
2198
|
iv.add_argument("action", choices=sorted(INVENTORY))
|