Isolate the front end part as a library#6
Merged
KenSakayori merged 18 commits intomasterfrom Aug 13, 2025
Merged
Conversation
This still doesn't compile
Does not compile because other places hasn't been replaced.
Compiles up to lib/muhfl_prover
Now it compiles
lib/syntax is no longer needed since we are now using the hfl library
Member
Author
|
Trying a review from Copilot, out of curiosity. |
There was a problem hiding this comment.
Pull Request Overview
This PR replaces the local syntax library (lib/syntax) with an external HFL library, migrating the codebase to use shared components for better maintainability across related tools (muhfl and rethfl).
Key changes include:
- Complete removal of the local
lib/syntaxmodule and replacement with the externalhfllibrary - Update of dependency management to include the new
hfllibrary from git - Extensive refactoring across the codebase to use the new library's module structure and APIs
Reviewed Changes
Copilot reviewed 70 out of 71 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| muhfl.opam.template, muhfl.opam | Add dependency on external hfl library |
| lib/syntax/* | Complete removal of local syntax implementation |
| lib/muhfl_prover/* | Update imports from Hflmc2_syntax to Hfl |
| lib/manipulate/* | Migrate to use Hfl modules and update function calls |
| lib/mufu_core/* | Replace Hflmc2_syntax with Hfl |
| lib/muhfl.ml | Update parsing logic to use new library APIs |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
KenSakayori
commented
Aug 13, 2025
I haven't checked whether they are working as intended. The only thing I did was to make it compile
If I understand correctly, the rename_simple_ty thing was used to align the variable in type with that of the function argument. For example, it changes the type of \x. e from f : (y : Int -> Prop) to f : (x : Int -> Prop) I don't think we rely on the variables in types because we are only using simple types. Hence it should be safe to remove it
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adapts the code to use this library. The library is basically the codes that existed in
lib/syntax. The followings are the reasons to prefer using a library:The first point is important if we were to add features (e.g. the support of ADT) to muhfl. We don't want to write the code for ADT twice, one for muhfl and the other for Rethfl. Actually, this problem has already happened multiple times in the past. For example, the code to remove disjunctoins of a nuHFL formula has been written twice. Also muhfl has a lot of redundant code (which this PR doesn't delete). I don't know why we need a yet another data type for Hflz and yet another printer for the HFlz (not for the new data type but for the original one).
It's also simply much easier to maintain the two tools. There are changes/fixes that has only been applied to muhfl and not to rethfl and vice versa. I tried to import the changes to the library as much as possible.
I believe that no one can review this PR, so I'll do a self-review, and merge it once I think it is ready.