@@ -122,7 +122,8 @@ let complete_with_candidate outs prevs ag ag_tail id todo p_id dst_info p_switch
122122 LKappa. ra_syntax = ag.LKappa. ra_syntax;
123123 }
124124 :: ag_tail),
125- todo )
125+ todo,
126+ false )
126127 :: acc
127128 ) else if s = LKappa. Erased && p_switch = LKappa. Freed then (
128129 let ports' = Array. copy ag.LKappa. ra_ports in
@@ -139,7 +140,8 @@ let complete_with_candidate outs prevs ag ag_tail id todo p_id dst_info p_switch
139140 LKappa. ra_syntax = ag.LKappa. ra_syntax;
140141 }
141142 :: ag_tail),
142- todo )
143+ todo,
144+ false )
143145 :: acc
144146 ) else
145147 acc
@@ -165,7 +167,8 @@ let complete_with_candidate outs prevs ag ag_tail id todo p_id dst_info p_switch
165167 LKappa. ra_syntax = ag.LKappa. ra_syntax;
166168 }
167169 :: ag_tail),
168- todo' )
170+ todo',
171+ false )
169172 :: acc
170173 | [] , _ -> acc
171174 | _ :: _ :: _ , _ -> assert false
@@ -194,15 +197,17 @@ let new_agent_with_one_link sigs ty_id port link dst_info switch =
194197 }
195198
196199let rec add_one_implicit_info sigs id (((port , ty_id ), dst_info , s ) as info ) acc
197- out todo = function
200+ fresh_only_acc out todo = function
198201 | [] ->
199202 ( List. rev_append acc
200203 [ new_agent_with_one_link sigs ty_id port id dst_info s ],
201- todo )
204+ todo,
205+ fresh_only_acc )
202206 :: out
203207 | ag :: ag_tail ->
204208 let out_tail =
205- add_one_implicit_info sigs id info (ag :: acc) out todo ag_tail
209+ add_one_implicit_info sigs id info (ag :: acc) fresh_only_acc out todo
210+ ag_tail
206211 in
207212 if ty_id = ag.LKappa. ra_type then
208213 complete_with_candidate out_tail acc ag ag_tail id todo port dst_info s
@@ -212,11 +217,13 @@ let rec add_one_implicit_info sigs id (((port, ty_id), dst_info, s) as info) acc
212217let add_implicit_infos sigs l =
213218 let rec aux acc = function
214219 | [] -> acc
215- | (m , [] ) :: t -> aux (m :: acc) t
216- | (m , (id , info , dst_info , s ) :: todo' ) :: t ->
217- aux acc (add_one_implicit_info sigs id (info, dst_info, s) [] t todo' m)
220+ | (m , [] , only_fresh ) :: t -> aux ((m, only_fresh) :: acc) t
221+ | (m , (id , info , dst_info , s ) :: todo' , only_fresh ) :: t ->
222+ aux acc
223+ (add_one_implicit_info sigs id (info, dst_info, s) [] only_fresh t todo'
224+ m)
218225 in
219- aux [] l
226+ aux [] ( List. rev_map ( fun ( a , b ) -> a, b, true ) ( List. rev l))
220227
221228let is_linked_on_port me i id = function
222229 | (LKappa. LNK_VALUE (j , _ ), _ ), _ when i = j -> id <> me
@@ -609,7 +616,8 @@ let incr_origin = function
609616 | (Operator. ALG _ | Operator. MODIF _ ) as x -> x
610617 | Operator. RULE i -> Operator. RULE (succ i)
611618
612- let connected_components_of_mixture ~debug_mode created mix (env , origin ) =
619+ let connected_components_of_mixture ~debug_mode created (mix , bool ) (env , origin )
620+ =
613621 let sigs = Pattern.PreEnv. sigs env in
614622 let rec aux env transformations instantiations links_transf acc id = function
615623 | [] ->
@@ -635,10 +643,11 @@ let connected_components_of_mixture ~debug_mode created mix (env, origin) =
635643 complete_with_creation sigs transformations' links_transf [] actions' 0
636644 created
637645 in
638- ( ( origin,
639- Tools. array_rev_of_list acc,
640- { instantiations with Instantiation. actions = actions'' },
641- transformations'' ),
646+ ( ( ( origin,
647+ Tools. array_rev_of_list acc,
648+ { instantiations with Instantiation. actions = actions'' },
649+ transformations'' ),
650+ bool ),
642651 (env, Option_util. map incr_origin origin) )
643652 | h :: t ->
644653 let wk = Pattern. begin_new env in
@@ -705,7 +714,7 @@ let connected_components_sum_of_ambiguous_rule ~debug_mode ~compile_mode_on
705714 let () =
706715 if compile_mode_on then
707716 Format. eprintf " @[<v>_____(%i)@,%a@]@." (List. length all_mixs)
708- (Pp. list Pp. cut (fun f x ->
717+ (Pp. list Pp. cut (fun f ( x , _ ) ->
709718 Format. fprintf f " @[%a%a@]"
710719 (LKappa. print_rule_mixture ~no Counters sigs counters_info
711720 ~ltypes: true created)
@@ -728,7 +737,7 @@ let connected_components_sum_of_ambiguous_mixture ~debug_mode ~compile_mode_on
728737 ( cc_env,
729738 List. rev_map
730739 (function
731- | _ , l , event , ([] , [] ) -> l, event.Instantiation. tests
740+ | ( _ , l , event , ([] , [] )), _b -> l, event.Instantiation. tests
732741 | _ -> assert false )
733742 rules )
734743
0 commit comments