Skip to content
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

Add function to export theorem dependencies in GraphML format #112

Merged
merged 5 commits into from
Jun 14, 2023

Conversation

tirix
Copy link
Collaborator

@tirix tirix commented Jun 4, 2023

As per discussion on the google groups:

This adds a new option --export-graphml-deps [FILE] (no shortcut), which allows to export the theorem dependencies in GraphML format.
Requires to be compiled with the xml feature.

@GinoGiotto
Copy link

I don't have the competence to review, but I wanted to show my support for this. I think a graph database of theorems dependencies would be a really cool tool to play with. In 2022 Stephen Wolfram wrote an article with a visualization for set.mm https://writings.stephenwolfram.com/2022/03/the-physicalization-of-metamathematics-and-its-implications-for-the-foundations-of-mathematics/

Here is his graph:
Immagine 2023-06-05 011239

Probably there are ways to make it prettier and less "chaotic", but at least this should give an idea of what it could look like.

@david-a-wheeler
Copy link
Member

It's a different visualization, but Metamath Proof Explorer (set.mm) contributions visualized with Gource through 2020-04-29 shows the set.mm database's structure and growth over time. Each little circle represents an assertion (mostly theorems). It's structured by section and subsection, not by internal theorem dependencies, but it may be of interest. I'll post to the mailing list too.

@humanitiesclinic
Copy link

Thank you for this. Is it me, or is there something not quite right with the new PR. I keep on getting the error:

error: Found argument '--export-graphml-deps' which wasn't expected, or isn't valid in this context
Did you mean --export?

USAGE:
metamath-knife --export ... --time

For more information try --help

I even tried downloading the specific fork/branch directly, and still have the same problem:

git clone https://github.com/tirix/metamath-knife.git export_graphml_deps
Cloning into 'export_graphml_deps'...
remote: Enumerating objects: 2377, done.
remote: Counting objects: 100% (645/645), done.
remote: Compressing objects: 100% (175/175), done.
remote: Total 2377 (delta 523), reused 526 (delta 466), pack-reused 1732
Receiving objects: 100% (2377/2377), 20.79 MiB | 6.67 MiB/s, done.
Resolving deltas: 100% (1704/1704), done.
Users-MacBook-Pro-5:checkouts user$ cd /Users/user/.cargo/git/checkouts/export_graphml_deps
Users-MacBook-Pro-5:export_graphml_deps user$ cargo build --release

@humanitiesclinic
Copy link

I am not completely familiar with Rust and Cargo, please pardon me for this

@humanitiesclinic
Copy link

on a separate but relevant note, @tirix @digama0, sorry to inform that I seem to have a problem with the current GraphML output. Pls see the attached output which is exactly what I got when I ran the commands in:
#113 (comment)

out.gml.zip

On Gephi, I have a Invalid GML Parsing error.

On GraPhP with PHP (https://github.com/graphp/graph), I am having the following error:
Fatal error: Uncaught Exception: String could not be parsed as XML in /Users/user/Documents/graph/vendor/graphp/graphml/src/Loader.php:13
Stack trace:
#0 /Users/user/Documents/graph/vendor/graphp/graphml/src/Loader.php(13): SimpleXMLElement->__construct('/Users/user/Doc...')
#1 /Users/user/Documents/graph/index.php(26): Graphp\GraphML\Loader->loadContents('/Users/user/Doc...')
#2 {main}
thrown in /Users/user/Documents/graph/vendor/graphp/graphml/src/Loader.php on line 13

It appears that the GraphML output is not well-formed, but I dun have enough knowledge now to check manually what is the exact problem.

Hopefully, you can fix this problem while you add the feature for the definitions dependency graph..

@humanitiesclinic
Copy link

may I know if the definitions graph have been added? I don't see any news yet..

@tirix
Copy link
Collaborator Author

tirix commented Jun 7, 2023

I'll try to add it whenever I can find some free time, but it's hard to commit on a date.

@humanitiesclinic
Copy link

ok yes pls

@humanitiesclinic
Copy link

humanitiesclinic commented Jun 8, 2023

erm sorry to ask, but will it take long? because I need it for work and teaching.. the definitions graph, when topologically sorted, can be used to learn all definitions of objects from the ground up..

@jkingdon
Copy link
Contributor

jkingdon commented Jun 8, 2023

As @digama0 said on the mailing list:

I am actually a bit concerned at the growth in behaviors of what is ostensibly a library. We need better separation between the proof assistant and the library, possibly a second crate in the same repo.

and I agree that having an xml feature seems like maybe an inelegant way of handling what would be better organized as multiple crates (not that I've looked at the code much, just based on the idea that we were hoping to design metamath-knife in a modular way which featured a core library with a bunch of other packages built on top of it).

@tirix
Copy link
Collaborator Author

tirix commented Jun 11, 2023

Ok, so we have this PR pending, then #116, which depends on this, and also a proposal to split metamath-knife into two crates.
I suggest we first merge this PR, then #116, then possibly release, and then do the split.

I agree that having an xml feature seems like maybe an inelegant way of handling what would be better organized as multiple crates

Yes, as a result of the split, the library crate will not depend on xml, and it will not need to be optional in the binary crate. And that's much better.

@jkingdon
Copy link
Contributor

I suggest we first merge this PR, then #116, then possibly release, and then do the split.

I'd gladly defer to people more involved in metamath-knife development than I am, but sounds sensible to me.

@tirix
Copy link
Collaborator Author

tirix commented Jun 12, 2023

I have started by merging #107 .
This PR can come next, and then #116, then we can release and then refactor.

@digama0
Copy link
Member

digama0 commented Jun 12, 2023

What do you mean by "release"?

@tirix
Copy link
Collaborator Author

tirix commented Jun 12, 2023

What do you mean by "release"?

Last release was 0.3.6, I mean baseline a 0.3.7 for example.

@tirix tirix merged commit 4c4e873 into metamath:main Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants