diff options
| author | Alasdair Armstrong | 2019-08-02 16:48:36 +0100 |
|---|---|---|
| committer | Alasdair Armstrong | 2019-08-02 16:48:36 +0100 |
| commit | 8b1c4ce0c3659020e0f2a2e04d70798931dc9b63 (patch) | |
| tree | 635bf2f722f7cf5ecf6dd11b560ca1d96a32623b /src/pattern_completeness.ml | |
| parent | 94e2f401263c7efc69f7d2b731827dc41bd8c1b8 (diff) | |
Fix all warnings (except for two lem warnings)
Remove P_record as it's never been implemented in
parser/typechecker/rewriter, and is not likely to be. This also means
we can get rid of some ugliness with the fpat and mfpat types. Stubs
for P_or and P_not are left as they still may get added to ASL and we
might want to support them, although there are good reasons to keep
our patterns simple.
The lem warning for while -> while0 for ocaml doesn't matter because
it's only used in lem, and the 32-bit number warning is just noise.
Diffstat (limited to 'src/pattern_completeness.ml')
| -rw-r--r-- | src/pattern_completeness.ml | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/src/pattern_completeness.ml b/src/pattern_completeness.ml index 3de0058f..afda3e1a 100644 --- a/src/pattern_completeness.ml +++ b/src/pattern_completeness.ml @@ -68,7 +68,6 @@ type gpat = | GP_cons of gpat * gpat | GP_or of gpat * gpat | GP_app of (gpat Bindings.t) - | GP_record of (gpat Bindings.t) | GP_string_append of gpat list let rec string_of_gpat = function @@ -82,7 +81,6 @@ let rec string_of_gpat = function | GP_or (gpat1, gpat2) -> string_of_gpat gpat1 ^ " | " ^ string_of_gpat gpat2 | GP_app app -> Util.string_of_list "|" (fun (id, gpat) -> string_of_id id ^ string_of_gpat gpat) (Bindings.bindings app) - | GP_record _ -> "GP RECORD" | GP_string_append gpats -> Util.string_of_list " ^^ " string_of_gpat gpats let is_wild = function @@ -135,15 +133,6 @@ let rec generalize ctx (P_aux (p_aux, (l, _)) as pat) = GP_app (Bindings.singleton f GP_wild) else GP_app (Bindings.singleton f (GP_tup gpats)) - | P_record (fpats, flag) -> - let gfpats = List.concat (List.map (generalize_fpat ctx) fpats) in - GP_record (List.fold_left (fun m (fid, gpat) -> Bindings.add fid gpat m) Bindings.empty gfpats) - -and generalize_fpat ctx (FP_aux (FP_Fpat (field_id, pat), annot)) = - let gpat = generalize ctx pat in - if is_wild gpat then [] - else - [(field_id, gpat)] let vector_pat bits = let bit_pat = function |
