-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buggy output of --dump-formula #147
Comments
Note: Metamath-knife is first and foremost a library. That is, the intended way for users to perform complex activities is by writing code, in this project or a dependent. While it has a rudimentary CLI, it is not designed for complex interaction loops, and if you are calling it hundreds or thousands of times in a script you're doing it wrong. The library interface is fairly convenient and can be used to get really high performance programs; an example of doing complex display and analysis on metamath databases is mm-web-rs. IMO implementing all these little scripts as additional flags in metamath-knife is not long-term sustainable, or at least it will result in the code getting large and haphazard like the project it's trying to replace.
There should not be a significant performance difference between printing to stdout and printing to a file, as long as you don't actually send stdout to the console. Just pipe it to disk as in |
Ah right, I haven't thought about that. I tried this way and it takes a few seconds, so it's good.
The readme file only mentions the CLI interface (and doesn't even call it a library), perhaps this could be specified. About the output of --dump-formula what do you think about my proposed visualization? |
To explain the speed: If the goal is to quickly dump all formulas, there are more efficient ways, without switching to the tree structure and back. In the mean time I've added a better check, in the form of the
For reference, this is the issue #117... still open! |
Ok, so this is not what I thought it was. I thought this was the equivalent of
Can you name one? This is useful for something I'm working on, but at the moment I only know how to do it with metamath-exe, which is slow (it's slow even using the trick of printing the output directly on a file instead of the command line).
Indeed. I saw that option and by reading the help section I assumed this one was for an other purpose (for Given the fact that a better tool is implemented, and given the fact that
Does exist somewhere a list of all library features of metamath-knife? For metamath-exe there is a lot of documentation which is well explained, so with time I gained a somewhat decent confidence with the tool. But here I'm not really sure where to start, as I can't find some help documentation about the library interface. I feel the only thing I should do would be to learn rust and read the code by myself, which is something I was contemplating doing. |
I was thinking about the way a simple Rust executable would use
You can obtain the doc by launching:
From the directory where you checked out metamath-knife. Then you can browse your own computer somewhere like: Because |
Thanks! It works, only a thing: On the README.md I read:
But when I execute warning: unresolved link to `StartMathMode` --> src\comment_parser.rs:38:19 | 38 | /// Between [`StartMathMode`] and [`EndMathMode`], | ^^^^^^^^^^^^^ no item named `StartMathMode` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default warning: unresolved link to `EndMathMode` --> src\comment_parser.rs:38:41 | 38 | /// Between [`StartMathMode`] and [`EndMathMode`], | ^^^^^^^^^^^ no item named `EndMathMode` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `MathToken` --> src\comment_parser.rs:39:53 | 39 | /// there will be no comment items other than [`MathToken`]. | ^^^^^^^^^ no item named `MathToken` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `StartMathMode` --> src\comment_parser.rs:42:19 | 42 | /// Between [`StartMathMode`] and [`EndMathMode`], | ^^^^^^^^^^^^^ no item named `StartMathMode` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `EndMathMode` --> src\comment_parser.rs:42:41 | 42 | /// Between [`StartMathMode`] and [`EndMathMode`], | ^^^^^^^^^^^ no item named `EndMathMode` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `MathToken` --> src\comment_parser.rs:43:53 | 43 | /// there will be no comment items other than [`MathToken`]. | ^^^^^^^^^ no item named `MathToken` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `Database::usage_pass` --> src\database.rs:645:29 | 645 | /// Returns `None` if [`Database::usage_pass`] was not previously called. | ^^^^^^^^^^^^^^^^^^^^ the struct `Database` has no field or associated item named `usage_pass` warning: unresolved link to `TypesettingData::html_bibliography` --> src\verify_markup.rs:524:7 | 524 | /// [`TypesettingData::html_bibliography`], | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `TypesettingData` in scope warning: unresolved link to `TypesettingData::ext_html_label` --> src\verify_markup.rs:525:34 | 525 | /// while references after the [`TypesettingData::ext_html_label`] go to the | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `TypesettingData` in scope warning: unresolved link to `TypesettingData::ext_html_bibliography` --> src\verify_markup.rs:526:7 | 526 | /// [`TypesettingData::ext_html_bibliography`]. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `TypesettingData` in scope warning: `metamath-knife` (lib doc) generated 10 warnings Finished dev [optimized + debuginfo] target(s) in 3m 04s Should I report them in a separate issue? Or we don't need to worry about these?
That would be nice! However I don't want to assign work, so if you don't have time I'll figure something myself at some point :-) |
Yes, we should fix those in order to have the correct hyperlinks in the docs. A separate issue would be nice. |
Getting back to the topic of this issue, what I understand is:
Therefore there probably aren't many compelling reasons to update the output with my proposal, however I still have the question if $a statements should be showed (it still looks weird to me that $e statements of a rule of inference are printed without the actual statement of that rule of inference). Unless the plan is to remove it and there is no need to fix anything. |
I've published it under #150, though it's yet another option for the command line tool.
Actually axioms are showed (at least, some are), what's not shown are syntactic axioms, as they are explicitly skipped here. |
Strange, indeed I checked with set.mm and turnstile axioms are showed (even if statements are not showed in the conventional order). So the reason why turnstile axioms are not showed for demo0.mm is getting more puzzling. I even tried to edit the label names of |
With #153 all axioms are shown, including The reason they were not shown was that that database is missing the The output is still not organized, but with the independent |
I understand now, therefore #153 is a valid fix.
I agree, if --dump-formula is just used for testing there is no need to do that. |
I'm using the demo0.mm example of the set.mm repository.
If I write:
The output is:
Which looks incomplete:
min
andmaj
are hypotheses ofmp
, but that's not printed, alsoa1
anda2
are not printed as well. I'm guessing that it was originally designed to not print $a statements, overlooking the fact that corresponding $e statements should be hidden as well.Proposal: I would print axioms, group hypotheses with their corresponding statements and visualize their keywords, like this:
This makes the output more clear and easier to read.
The remaining statements of demo0.mm are
wff
andterm
types. I think it's ok to not print those.Personal note: I used to work with matamath-exe to print lists of statements, but it's quite slow. Unfortunately the metamath-knife version is quite slow as well because it prints the list of statements on the command line, so I have to wait the program to display the whole database, which takes a while (also I have difficulties extracting information from the command line display). It would be so much better if the list would be written in a file instead, the same way axiom usage
metamath-knife set.mm --axiom-use ax.txt
is implemented.The text was updated successfully, but these errors were encountered: