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

Remove dependency of trie.ml and leapfrog.ml on Named_ref. #3650

Merged
merged 5 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
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
review
  • Loading branch information
Ekdohibs committed Mar 4, 2025
commit c723b736a56eab391ff14b3c485909f32e12e598
2 changes: 2 additions & 0 deletions middle_end/flambda2/datalog/cursor.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open Datalog_imports

(* Note: we don't use [with_name] here to avoid the extra indirection during
execution. *)
type vm_action =
| Unless :
('t, 'k, 'v) Trie.is_trie
Expand Down
3 changes: 2 additions & 1 deletion middle_end/flambda2/datalog/datalog.ml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ let rec bind_atom :
=
fun ~order post_level args iterators iterator_names ->
match args, iterators, iterator_names with
| [], [], _ -> ()
| [], [], [] -> ()
| [], [], _ :: _ -> Misc.fatal_error "Too many names in [bind_atom]"
| _, _, [] -> Misc.fatal_error "Missing names in [bind_atom]"
| ( this_arg :: other_args,
this_iterator :: other_iterators,
Expand Down
4 changes: 2 additions & 2 deletions middle_end/flambda2/datalog/virtual_machine.ml
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@ module Make (Iterator : Leapfrog.Iterator) = struct
(_, nil) instruction =
fun iterators refs instruction iterator_names ->
match iterators, refs, iterator_names with
| [iterator], [r], name :: _ ->
| [iterator], [r], [name] ->
open_ { value = iterator; name } { value = r; name = "_" } instruction
dispatch
| iterator :: (_ :: _ as iterators), r :: refs, name :: iterator_names ->
loop iterators refs
(open_ { value = iterator; name } { value = r; name = "_" }
instruction dispatch)
iterator_names
| _, _, [] ->
| _, _, [] | [_], [_], _ :: _ :: _ ->
Misc.fatal_errorf "Incorrect number of names for iterators in [iterate]"
in
match rev_iterators with
Expand Down