Skip to content

Commit a12d63a

Browse files
committed
cleanup
1 parent 7fcd8db commit a12d63a

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

src/compiler.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ type program = {
567567
type_abbrevs : type_abbrev_declaration C.Map.t;
568568
modes : (mode * Loc.t) C.Map.t;
569569
clauses : (preterm,attribute) Ast.Clause.t list;
570-
prolog_program : preindex;
570+
prolog_program : index;
571571
indexing : (mode * indexing) C.Map.t;
572572
chr : block_constraint list;
573573
local_names : int;
@@ -615,7 +615,7 @@ type 'a query = {
615615
type_abbrevs : type_abbrev_declaration C.Map.t;
616616
modes : mode C.Map.t;
617617
clauses : (preterm,Assembled.attribute) Ast.Clause.t list;
618-
prolog_program : preindex;
618+
prolog_program : index;
619619
chr : block_constraint list;
620620
initial_depth : int;
621621
query : preterm;

src/data.ml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,21 +159,21 @@ and prolog_prog = {
159159

160160
(* These two are the same, but the latter should not be mutated *)
161161

162-
and preindex = clause Bl.t first_lvl_idx
163-
and index = clause Bl.t first_lvl_idx
164-
and 'clause_list first_lvl_idx = { idx : 'clause_list second_lvl_idx Ptmap.t; time : int; times : times }
165-
and 'clause_list second_lvl_idx =
162+
and clause_list = clause Bl.t
163+
and index = first_lvl_idx
164+
and first_lvl_idx = { idx : second_lvl_idx Ptmap.t; time : int; times : times }
165+
and second_lvl_idx =
166166
| TwoLevelIndex of {
167167
mode : mode;
168168
argno : int;
169-
all_clauses : 'clause_list; (* when the query is flexible *)
170-
flex_arg_clauses : 'clause_list; (* when the query is rigid but arg_id ha nothing *)
171-
arg_idx : 'clause_list Ptmap.t; (* when the query is rigid (includes in each binding flex_arg_clauses) *)
169+
all_clauses : clause_list; (* when the query is flexible *)
170+
flex_arg_clauses : clause_list; (* when the query is rigid but arg_id ha nothing *)
171+
arg_idx : clause_list Ptmap.t; (* when the query is rigid (includes in each binding flex_arg_clauses) *)
172172
}
173173
| BitHash of {
174174
mode : mode;
175175
args : int list;
176-
args_idx : 'clause_list Ptmap.t; (* clause, insertion time *)
176+
args_idx : clause_list Ptmap.t; (* clause, insertion time *)
177177
}
178178
| IndexWithDiscriminationTree of {
179179
mode : mode;
@@ -183,7 +183,7 @@ and 'clause_list second_lvl_idx =
183183
[@@deriving show]
184184

185185
let stop = ref false
186-
let close_index ({idx; time; times} : preindex) : index =
186+
let close_index ({idx; time; times} : index) : index =
187187
{ idx =idx; time = 0; times = StrMap.empty }
188188

189189
type constraints = stuck_goal list

src/runtime.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2800,7 +2800,7 @@ let rec add1clause_compile_time ~depth { idx; time; times } ~graft predicate cla
28002800
let idx = Ptmap.add predicate (make_new_Map_snd_level_index 0 []) idx in
28012801
add1clause_compile_time ~depth { idx; time; times } ~graft predicate clause name
28022802

2803-
let update_indexing (indexing : (mode * indexing) Constants.Map.t) (index : preindex) : preindex =
2803+
let update_indexing (indexing : (mode * indexing) Constants.Map.t) (index : index) : index =
28042804
let idx =
28052805
C.Map.fold (fun predicate (mode, indexing) m ->
28062806
Ptmap.add predicate
@@ -2820,7 +2820,7 @@ let update_indexing (indexing : (mode * indexing) Constants.Map.t) (index : prei
28202820
in
28212821
{ index with idx }
28222822

2823-
let add_to_index ~depth ~predicate ~graft clause name index : preindex =
2823+
let add_to_index ~depth ~predicate ~graft clause name index : index =
28242824
add1clause_compile_time ~depth ~graft index predicate clause name
28252825

28262826
let make_empty_index ~depth ~indexing =
@@ -4237,7 +4237,7 @@ end;*)
42374237
let search = exec (fun () ->
42384238
(* let o = open_out "/tmp/log" in
42394239
let fmt = Format.formatter_of_out_channel o in
4240-
Format.fprintf fmt "%a\n%!" pp_preindex compiled_program.index;
4240+
Format.fprintf fmt "%a\n%!" pp_index compiled_program.index;
42414241
close_out o; *)
42424242
[%spy "dev:trail:init" ~rid (fun fmt () -> T.print_trail fmt) ()];
42434243
let gid[@trace] = UUID.make () in

src/runtime.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ module CompileTime : sig
7474
(* updates how predicates are indexed *)
7575
val update_indexing :
7676
(mode * indexing) Constants.Map.t ->
77-
preindex -> preindex
77+
index -> index
7878

7979
(* adds 1 clause to its index *)
8080
val add_to_index :
8181
depth:int ->
8282
predicate:constant ->
8383
graft:Elpi_parser.Ast.Structured.insertion option ->
84-
clause -> string option -> preindex -> preindex
84+
clause -> string option -> index -> index
8585

8686
(* can raise CannotDeclareClauseForBuiltin *)
8787
val clausify1 :

0 commit comments

Comments
 (0)