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

Introduce and use a red-black tree implementation for sets #3261

Merged
merged 18 commits into from
Apr 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
DeferredImplicits: Remove some dead code
mtzguido committed Apr 23, 2024
commit b57266ef550d479fd3693bd074ef2331b59d3ab0
25 changes: 0 additions & 25 deletions src/typechecker/FStar.TypeChecker.DeferredImplicits.fst
Original file line number Diff line number Diff line change
@@ -56,31 +56,6 @@ type goal_type =
| Can_be_split_into of term * term * ctx_uvar
| Imp of ctx_uvar

type goal_dep =
{
goal_dep_id : int; // Assign each goal an id, for cycle detection
goal_type : goal_type; // What sort of goal ...
goal_imp : implicit; // The entire implicit from which this was generated
assignees : FlatSet.t ctx_uvar; // The set of uvars assigned by the goal
goal_dep_uvars : FlatSet.t ctx_uvar; // The set of uvars this goal depends on
dependences : ref goal_deps; // NB: mutable; the goals that must precede this one in the order
visited : ref int // NB: mutable; a field to mark visited goals during the sort
}
and goal_deps = list goal_dep

let print_uvar_set (s:FlatSet.t ctx_uvar) =
(elems s
|> List.map (fun u -> "?" ^ (string_of_int <| Unionfind.uvar_id u.ctx_uvar_head))
|> String.concat "; ")

let print_goal_dep gd =
BU.format4 "%s:{assignees=[%s], dependences=[%s]}\n\t%s\n"
(BU.string_of_int gd.goal_dep_id)
(print_uvar_set gd.assignees)
(List.map (fun gd -> string_of_int gd.goal_dep_id) (!gd.dependences)
|> String.concat "; ")
(Print.ctx_uvar_to_string gd.goal_imp.imp_uvar)

(*
If [u] is tagged with attribute [a]