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

feat: A-star search #3973

Closed
wants to merge 21 commits into from
Closed

feat: A-star search #3973

wants to merge 21 commits into from

Conversation

semorrison
Copy link
Contributor

This is intended for meta programming, not proving.


Open in Gitpod

@semorrison semorrison added awaiting-CI t-meta Tactics, attributes or user commands labels May 14, 2023
@semorrison
Copy link
Contributor Author

Eventually this is leading to a reimplementation of the original rewrite_search from mathlib3, but there's no hurry.

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Aug 9, 2023
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Aug 10, 2023
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Sep 13, 2023
@bors bors bot changed the base branch from master to ScottCarnahan/BinomialRing2 September 17, 2023 03:24
@semorrison semorrison changed the base branch from ScottCarnahan/BinomialRing2 to master September 17, 2023 12:17
Mathlib.lean Show resolved Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Sep 27, 2023
Copy link
Member

@fpvandoorn fpvandoorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one small thing: you use lowest priority and highest priority synonymously (I think).

bors d+

heuristicPrio := default
totalPrio := default
explored := []
remaining := .nil }⟩
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just write deriving Inhabited after Path and VertexData instead of doing this manually?

recursively record all paths obtained by adding a previously explored edge to this path.
-/
partial def recordPath (Γ : GraphData m P V E) (optimal : Bool) (path : Path P V E) :
(M m P V E) PUnit := do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(M m P V E) PUnit := do
M m P V E PUnit := do

/-- The best so far path to the vertex. -/
bestPath : Path P V E
/-- The heuristic associated to the vertex. -/
heuristicPrio : P
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to track this here, because it's always the same as Γ.heuristic v for the v this is associated to, right? The single occurrence of d.heuristicPrio below can become Γ.heuristic v.

@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Nov 30, 2023

✌️ semorrison can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Jan 5, 2024
@semorrison
Copy link
Contributor Author

This was support for a previously planned implementation of rw_search that I didn't end up pursuing. I think this code is sufficiently specialised that it would not be useful for others, so I'm going to close.

@semorrison semorrison closed this Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated merge-conflict The PR has a merge conflict with master, and needs manual merging. t-meta Tactics, attributes or user commands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants