diff options
| author | Pierre-Marie Pédrot | 2020-07-06 16:18:33 +0200 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2020-07-06 16:18:33 +0200 |
| commit | 8907a5b7d2b91bff0b573956a05e4679b5238161 (patch) | |
| tree | 2fff532e687a8e82543044352aeaf3168434aac1 /plugins/extraction/extraction.ml | |
| parent | 3244b9c6e4159042bae0cd2ad48aba77928d7b2d (diff) | |
| parent | 0ea2d0ff4ed84e1cc544c958b8f6e98f6ba2e9b6 (diff) | |
Merge PR #11604: Primitive persistent arrays
Ack-by: JasonGross
Ack-by: SkySkimmer
Ack-by: ejgallego
Ack-by: gares
Reviewed-by: ppedrot
Ack-by: proux01
Ack-by: silene
Diffstat (limited to 'plugins/extraction/extraction.ml')
| -rw-r--r-- | plugins/extraction/extraction.ml | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/extraction/extraction.ml b/plugins/extraction/extraction.ml index a7c926f50c..2dca1d5e49 100644 --- a/plugins/extraction/extraction.ml +++ b/plugins/extraction/extraction.ml @@ -351,7 +351,7 @@ let rec extract_type env sg db j c args = | (Info, TypeScheme) -> extract_type_app env sg db (r, type_sign env sg ty) args | (Info, Default) -> Tunknown)) - | Cast _ | LetIn _ | Construct _ | Int _ | Float _ -> assert false + | Cast _ | LetIn _ | Construct _ | Int _ | Float _ | Array _ -> assert false (*s Auxiliary function dealing with type application. Precondition: [r] is a type scheme represented by the signature [s], @@ -693,6 +693,12 @@ let rec extract_term env sg mle mlt c args = extract_app env sg mle mlt extract_var args | Int i -> assert (args = []); MLuint i | Float f -> assert (args = []); MLfloat f + | Array (_u,t,def,_ty) -> + assert (args = []); + let a = new_meta () in + let ml_arr = Array.map (fun c -> extract_term env sg mle a c []) t in + let def = extract_term env sg mle a def [] in + MLparray(ml_arr, def) | Ind _ | Prod _ | Sort _ -> assert false (*s [extract_maybe_term] is [extract_term] for usual terms, else [MLdummy] *) |
