Skip to content

Commit

Permalink
poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
Halbaroth committed Jun 12, 2024
1 parent 7045bb6 commit 226fda1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/lib/frontend/typechecker.ml
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ module Env = struct
| Ty.Tadt (name, [], true) ->
let Adt cases = Ty.type_body name [] in
let cstrs = List.map (fun Ty.{ constr; _ } -> constr) cases in
List.find (fun c -> String.equal n @@ Uid.show c) cstrs
List.find (Uid.equal n) cstrs
| _ ->
assert false

Expand All @@ -329,9 +329,9 @@ module Env = struct
let nte = Fpa_rounding.string_of_rounding_mode NearestTiesToEven in
let tname = Fpa_rounding.fpa_rounding_mode_ae_type_name in
let float32 = float (int "24") (int "149") in
let float32d = float32 (mode nte) in
let float32d = float32 (mode (Uid.of_string nte)) in
let float64 = float (int "53") (int "1074") in
let float64d = float64 (mode nte) in
let float64d = float64 (mode (Uid.of_string nte)) in
let op n op profile =
MString.add n @@ `Term (Symbols.Op op, profile, Other)
in
Expand Down
6 changes: 5 additions & 1 deletion src/lib/reasoners/adt_rel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,10 @@ let split_enum env uf =
if can_split env n then
let _, cons = Option.get @@ build_constr_eq r c in
let nr, ctx = X.make cons in
(* In the current implementation of `X.make`, we produce
a nonempty context only for interpreted semantic values
of the `Arith` and `Records` theories. The semantic
values `cons` never involves such values. *)
assert (Lists.is_empty ctx);
Some (LR.mkv_eq r nr)
else
Expand All @@ -672,11 +676,11 @@ let split_best_domain ~for_model uf =
let ds = Uf.(GlobalDomains.find (module Domains) @@ domains uf) in
let* r, c = pick_best ds in
let _, cons = Option.get @@ build_constr_eq r c in
let nr, ctx = X.make cons in
(* In the current implementation of `X.make`, we produce
a nonempty context only for interpreted semantic values
of the `Arith` and `Records` theories. The semantic
values `cons` never involves such values. *)
let nr, ctx = X.make cons in
assert (Lists.is_empty ctx);
Some (LR.mkv_eq r nr)

Expand Down
9 changes: 6 additions & 3 deletions src/lib/structures/ty.mli
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ type t =
[params]. The flag [enum] determines if the ADT is an enum.
For instance the type of integer lists can be represented by the
value [Tadt (Hstring.make "list", [Tint])] where the identifier "list"
denotes a polymorphic ADT defined by the user with [t_adt]. *)
value [Tadt (Hstring.make "list", [Tint], false)] where the identifier
{e list} denotes a polymorphic ADT defined by the user with [t_adt]. *)

| Trecord of trecord
(** Record type. *)
Expand Down Expand Up @@ -176,7 +176,10 @@ val t_adt :
its destructors with their respective types. If [body] is none,
then no definition will be registered for this type. The second
argument is the name of the type. The third one provides its list
of arguments. *)
of arguments.
The flag [enum] is used to annotate ADT whose all the constructors have no
payload. *)

val trecord :
?sort_fields:bool ->
Expand Down

0 comments on commit 226fda1

Please sign in to comment.