File tree Expand file tree Collapse file tree 2 files changed +35
-8
lines changed Expand file tree Collapse file tree 2 files changed +35
-8
lines changed Original file line number Diff line number Diff line change @@ -1509,21 +1509,22 @@ let parse_theory_opt =
15091509 Term. (const mk_disable_theories $ disable_theories $ disable_adts $ no_ac)
15101510 in
15111511 let preludes enable_theories disable_theories =
1512- let theories = Theories. default in
1512+ let theories = Theories.Set. of_list Theories. default in
15131513 let rec aux th en dis =
15141514 match en, dis with
1515- | _ :: _ , [] -> aux (List. rev_append en th) [] []
1515+ | _ :: _ , [] ->
1516+ aux (List. fold_left (fun th en -> Theories.Set. add en th) th en) [] []
15161517 | e :: _ , d :: _ when e = d ->
15171518 Fmt. error_msg " theory prelude '%a' cannot be both enabled and
15181519 disabled" Theories. pp e
1519- | e :: en , d :: _ when e < d -> aux (e :: th) en dis
1520- | _ , d :: dis -> aux (List . filter ((<> ) d) th) en dis
1521- | [] , [] -> Ok th
1520+ | e :: en , d :: _ when e < d -> aux (Theories.Set. add e th) en dis
1521+ | _ , d :: dis -> aux (Theories.Set . filter ((<> ) d) th) en dis
1522+ | [] , [] -> Ok ( Theories.Set. elements th)
15221523 in
15231524 aux
15241525 theories
1525- (List. fast_sort compare enable_theories)
1526- (List. fast_sort compare disable_theories)
1526+ (List. fast_sort Theories. compare enable_theories)
1527+ (List. fast_sort Theories. compare disable_theories)
15271528 in
15281529 Term. (
15291530 cli_parse_result (
Original file line number Diff line number Diff line change 1616(* *)
1717(* *************************************************************************)
1818
19- type prelude = Fpa | Ria | Nra [@@ deriving eq ]
19+ type prelude = Nra | Ria | Fpa [@@ deriving eq ]
2020
2121let pp_prelude ppf = function
2222 | Fpa -> Format. fprintf ppf " fpa"
2323 | Ria -> Format. fprintf ppf " ria"
2424 | Nra -> Format. fprintf ppf " nra"
2525
26+ let compare_prelude p1 p2 =
27+ match p1, p2 with
28+ | Nra , Nra -> 0
29+ | Nra , _ -> - 1
30+ | _ , Nra -> 1
31+
32+ | Ria , Ria -> 0
33+ | Ria , _ -> - 1
34+ | _ , Ria -> 1
35+
36+ | Fpa , Fpa -> 0
37+
2638type t =
2739 | Prelude of prelude
2840 | ADT
2941 | AC
3042[@@ deriving eq ]
3143
44+ let compare t1 t2 =
45+ match t1, t2 with
46+ | Prelude p1 , Prelude p2 -> compare_prelude p1 p2
47+ | Prelude _ , _ -> - 1
48+ | _ , Prelude _ -> 1
49+
50+ | ADT , ADT -> 0
51+ | ADT , _ -> - 1
52+ | _ , ADT -> 1
53+
54+ | AC , AC -> 0
55+
3256let pp ppf = function
3357 | Prelude p -> pp_prelude ppf p
3458 | ADT -> Format. fprintf ppf " adt"
@@ -52,3 +76,5 @@ let default = all
5276
5377let preludes =
5478 List. filter_map (function | Prelude p -> Some p | _ -> None )
79+
80+ module Set = Set. Make (struct type nonrec t = t let compare = compare end )
You can’t perform that action at this time.
0 commit comments