diff options
author | Chantal Keller <Chantal.Keller@lri.fr> | 2021-05-05 16:07:47 +0200 |
---|---|---|
committer | Chantal Keller <Chantal.Keller@lri.fr> | 2021-05-05 16:07:47 +0200 |
commit | 9d45fd745ecfd02cb21b3f0e93566b6ee864db38 (patch) | |
tree | f358d6a1ca84dd2d71c8dddc20bdfa2444427190 /src | |
parent | 64517cd829de743338ee3df7e94ecd262dc51505 (diff) | |
parent | 907cb562f511e3bbd3f84011e5d3e101f00c4252 (diff) | |
download | smtcoq-9d45fd745ecfd02cb21b3f0e93566b6ee864db38.tar.gz smtcoq-9d45fd745ecfd02cb21b3f0e93566b6ee864db38.zip |
Merge branch 'master' of github.com:smtcoq/smtcoq into coq-8.10
Diffstat (limited to 'src')
-rw-r--r-- | src/PropToBool.v | 25 | ||||
-rw-r--r-- | src/trace/smtAtom.ml | 8 | ||||
-rw-r--r-- | src/trace/smtBtype.ml | 2 |
3 files changed, 32 insertions, 3 deletions
diff --git a/src/PropToBool.v b/src/PropToBool.v index bf0ec46..cbca992 100644 --- a/src/PropToBool.v +++ b/src/PropToBool.v @@ -210,10 +210,33 @@ Ltac prop2bool_hyp H := try clear H; let H := fresh H in assert (H:=H'); clear H' ]. + +Ltac remove_compdec_hyp H := + let TH := type of H in + match TH with + | forall p : CompDec ?A, _ => + match goal with + | [ p' : CompDec A |- _ ] => + let H1 := fresh in + assert (H1 := H p'); clear H; assert (H := H1); clear H1; + remove_compdec_hyp H + | _ => + idtac 1; + let c := fresh "c" in + assert (c : CompDec A); + [ auto with typeclass_instances + | let H1 := fresh in + assert (H1 := H c); clear H; assert (H := H1); clear H1; + remove_compdec_hyp H ] + end + | _ => idtac + end. + + Ltac prop2bool_hyps Hs := lazymatch Hs with | (?Hs1, ?Hs2) => prop2bool_hyps Hs1; [ .. | prop2bool_hyps Hs2] - | ?H => try prop2bool_hyp H + | ?H => remove_compdec_hyp H; try prop2bool_hyp H end. diff --git a/src/trace/smtAtom.ml b/src/trace/smtAtom.ml index ff6db6a..f0a907a 100644 --- a/src/trace/smtAtom.ml +++ b/src/trace/smtAtom.ml @@ -1338,10 +1338,16 @@ module Atom = | _ -> assert false and mk_unknown c args ty = + (* Collecting types and CompDec allows to reify applied + polymorphic functions *) let rec collect_types = function | [] -> ([],[]) | x::xs as l -> - if Constr.iskind (Structures.retyping_get_type_of env sigma x) then + let ty = Structures.retyping_get_type_of env sigma x in + if Constr.iskind ty || + let c, _ = Structures.decompose_app ty in + Structures.eq_constr c (Lazy.force cCompDec) + then let (l1, l2) = collect_types xs in (x::l1, l2) else diff --git a/src/trace/smtBtype.ml b/src/trace/smtBtype.ml index 94339f6..1e05dc4 100644 --- a/src/trace/smtBtype.ml +++ b/src/trace/smtBtype.ml @@ -13,7 +13,7 @@ open SmtMisc open CoqTerms -(** Syntaxified version of Coq type *) +(** Reified version of Coq type *) type uninterpreted_type = (* Uninterpreted type for which a CompDec is already known |