-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define the biconditional connective.
Also clean up the coverage script and include metavariables. Metamath-style definitions can only define logical constants; in order to express a variable, we must treat it as a sort of floating hole which weaves through logical structure, and this means that it is declared $f instead of $a. So, I wrote a regex to match $f and another to match $a. This definition of the biconditional is almost directly from iset.mm, and I think it's worth noting that I only prefer it because it allows for reduction of axioms. In general, I want few axioms, because I want the amount of certainty to be maximized; I'm willing to eat a few long {ganai} and {ge} and {go} in order to get there.
- Loading branch information
1 parent
09f5025
commit 038b89d
Showing
4 changed files
with
147 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
from collections import Counter | ||
import json | ||
import json, re | ||
|
||
VALSI = r"[\w']+" | ||
DF = re.compile(rf"df-({VALSI}) +\$a") | ||
F = re.compile(rf"\$f +{VALSI} ({VALSI})") | ||
|
||
with open("valsi-class.json") as handle: vc = json.load(handle) | ||
with open("mm/jbobau.mm") as handle: | ||
dfs = [l.split(" ")[0][3:] for l in handle.readlines() if l.startswith("df-")] | ||
c = Counter(vc[v] for v in dfs) | ||
print("Grammatical class | # of formal definitions"); print("---|---") | ||
for cls in c: print(cls, "|", c[cls]) | ||
print("total", "|", sum(c.values())) | ||
with open("mm/jbobau.mm") as handle: db = handle.read() | ||
|
||
dfc = Counter(vc[v] for v in DF.findall(db)) | ||
dff = Counter(vc[v] for v in F.findall(db)) | ||
count = sum(dfc.values()) + sum(dff.values()) | ||
|
||
print("Grammatical class | Metamath class | # of formal definitions") | ||
print("---|---|---") | ||
lines = [f"{cls} | metavariable | {dff[cls]}" for cls in dff] | ||
lines.extend(f"{cls} | constant | {dfc[cls]}" for cls in dfc) | ||
for line in sorted(lines): print(line) | ||
print("total", "| - |", count, "%0.2f%%" % (count * 100 / 2529)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters