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

dt filter out uvar in input mode with rigid arg #322

Merged
merged 1 commit into from
Apr 4, 2025

Conversation

FissoreD
Copy link
Collaborator

@FissoreD FissoreD commented Apr 4, 2025

I have tested this change on all the project thanks to this change, where I put DTree
in all predicate with high indexing depth.

To perform the same test apply the following diff.

diff --git a/src/compiler/compiler.ml b/src/compiler/compiler.ml
index 983da7c7..e134e47e 100644
--- a/src/compiler/compiler.ml
+++ b/src/compiler/compiler.ml
@@ -512,13 +512,13 @@ end = struct (* {{{ *)
       | Index(i,index_type) :: rest ->
          let it =
            match index_type with
-           | None -> None
-           | Some "Map" -> Some Map
-           | Some "Hash" -> Some HashMap
+           | None -> Some DiscriminationTree
+           | Some "Map" -> Some DiscriminationTree
+           | Some "Hash" -> Some DiscriminationTree
            | Some "DTree" -> Some DiscriminationTree
            | Some s -> error ~loc ("unknown indexing directive " ^ s ^ ". Valid ones are: Map, Hash, DTree.") in
          begin match r with
-           | None -> aux_tatt (Some (Structured.Index(i,it))) f rest
+           | None -> aux_tatt (Some (Structured.Index(List.init 100 (fun _ -> 100),it))) f rest
            | Some (Structured.Index _) -> duplicate_err "index"
            | Some _ -> error ~loc "external predicates cannot be indexed"
          end
diff --git a/src/runtime/runtime.ml b/src/runtime/runtime.ml
index 471bed38..6f14124c 100644
--- a/src/runtime/runtime.ml
+++ b/src/runtime/runtime.ml
@@ -2629,7 +2629,7 @@ let arg_to_trie_path ~safe ~depth ~is_goal args arg_depths args_depths_ar mode m
       make_sub_path arg_hd arg_tl arg_depth_hd arg_depth_tl Output []
     | arg_hd :: arg_tl, arg_depth_hd :: arg_depth_tl, mode_hd :: mode_tl ->
       make_sub_path arg_hd arg_tl arg_depth_hd arg_depth_tl (get_arg_mode mode_hd) mode_tl 
-    | _, _ :: _,_ -> anomaly "Invalid Index length" in
+    | _, _ :: _,_ -> () in
   begin
     if args == [] then emit_mode is_goal mkOutputMode
     else aux ~safe ~depth is_goal args (if is_goal then Array.to_list args_depths_ar else arg_depths) mode

@gares gares merged commit d2dfe91 into LPCIC:master Apr 4, 2025
8 of 9 checks passed
@FissoreD FissoreD deleted the dt_uvar branch April 6, 2025 20:43
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.

2 participants