Skip to content
Open
Show file tree
Hide file tree
Changes from 66 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
e1da18b
Refactored ml4 to mlg and changed dependencies.
agrarpan Sep 19, 2023
12c3c29
Changed dependencies.
agrarpan Sep 19, 2023
0545e6f
Changed dependencies.
agrarpan Sep 20, 2023
9271154
Updated submodule dependencies.
agrarpan Sep 20, 2023
99b250e
Updated submodule dependencies.
agrarpan Sep 20, 2023
1461ab9
Fixed some type errors.
agrarpan Sep 20, 2023
5af2342
Fixed some type errors.
agrarpan Sep 20, 2023
67dcf4b
Added Makefile.local file to supress warnings.
agrarpan Sep 25, 2023
1c8630b
Updated submodule dependencies.
agrarpan Sep 25, 2023
2ac5b30
Changed order of build instructions.
agrarpan Sep 25, 2023
2446311
Updated submodule dependencies
agrarpan Oct 4, 2023
b96e572
Refactored the usage of binder_name to follow the changes in coq-plug…
agrarpan Oct 5, 2023
8fe0d92
Use the tactic string for name.
agrarpan Oct 5, 2023
354c091
Return the updated evar_map instead of using an evar_map ref and glob…
agrarpan Oct 9, 2023
7a92ea6
Updated submodule dependencies
agrarpan Oct 23, 2023
612664e
Updated submodule dependencies
agrarpan Oct 23, 2023
d16e6ad
Filter out SProp sorts to prevent call to Indrec.lookup_eliminator.
agrarpan Oct 25, 2023
c4ffa30
Updated submodule dependencies
agrarpan Oct 25, 2023
ed6c653
Revert "Updated submodule dependencies"
agrarpan Oct 25, 2023
9820f73
Updated submodule dependencies
agrarpan Oct 25, 2023
4e8d6fc
Updated submodule dependencies
agrarpan Oct 25, 2023
1435654
Updated submodule dependencies
agrarpan Oct 25, 2023
ad2a46d
Changed the arguments to declare_structure to reflect the API change.
agrarpan Oct 25, 2023
acf69f2
Updated submodule dependencies
agrarpan Oct 26, 2023
5faa96b
Changed the dependency to 8.11 version of fix-to-elim and coq-plugin-…
agrarpan Oct 26, 2023
905a39d
Updated submodule dependencies
agrarpan Oct 26, 2023
f6ca519
Updated submodule dependencies
agrarpan Oct 26, 2023
df7c298
Pulled in Max's changes from 8.11 branch of pumpkin-pi
agrarpan Oct 26, 2023
225f699
Temporarily add warning 60 to ignored warnings.
agrarpan Nov 17, 2023
3a1f98d
Calling inductiveops.sorts_below to get all sorts we need instead of …
agrarpan Dec 1, 2023
3603525
Updated submodule dependencies
agrarpan Dec 4, 2023
069fe20
Updated submodule dependencies
agrarpan Dec 4, 2023
a380d36
Refactored to use 8.12 API
agrarpan Jan 2, 2024
6e46680
Refactored to use qualified loadpath
agrarpan Jan 8, 2024
b379e69
Using -R flag for coq folder, not sure if this works.
agrarpan Jan 9, 2024
7a426eb
Added Test.v and Infrastructure.v to _CoqProject
agrarpan Jan 10, 2024
b237447
Using unqualified names
agrarpan Jan 17, 2024
f1dd629
Going back to 8.11 style imports for testing
agrarpan Jan 23, 2024
a4ef233
Added -R to coqproject for coq folder
agrarpan Jan 25, 2024
91eb798
Added Test.v and Infrastructure.v to coqproject
agrarpan Feb 8, 2024
b70985b
Changed -R to -Q for coq folder
agrarpan Feb 14, 2024
bfd5891
Lots of print debugging
agrarpan Feb 22, 2024
efd2932
Added file types to gitignore
agrarpan Feb 22, 2024
a634067
Passing false flag to EConstr.to_constr for unification
agrarpan Mar 5, 2024
41769a9
Undoing print debugs.
agrarpan Mar 5, 2024
63f7bd8
Updated submodule dependencies.
agrarpan Mar 27, 2024
282aece
Passing false flag to EConstr.to_constr everywhere
agrarpan Mar 27, 2024
45b1d58
Updated submodule dependencies.
agrarpan Mar 27, 2024
a1aa099
Updated submodule dependencies.
agrarpan Mar 27, 2024
0bdd193
Updated submodule dependencies
agrarpan Apr 3, 2024
c58d20c
Install TestLift and removed debug statements for fixed bug.
agrarpan Apr 3, 2024
a847286
Changed test and build scripts and refactored tests to use the new im…
agrarpan Apr 4, 2024
46a6e8c
Installing theories files.
agrarpan Apr 5, 2024
021e777
Reordered build file and cleaned up tests.
agrarpan Apr 9, 2024
e612b7e
Updated submodule dependencies.
agrarpan Apr 11, 2024
966f30d
Added a constant to Example.v
agrarpan Apr 15, 2024
44ff322
Updated submodule dependecies version numbers to 8.13
agrarpan Apr 15, 2024
82f8cdc
Updated submodule dependencies.
agrarpan Apr 17, 2024
a544da2
API changes for 8.13
agrarpan Apr 17, 2024
71f24cc
Updated submodule dependencies.
agrarpan Apr 23, 2024
deeb0e6
Updated submodule dependencies.
agrarpan Apr 30, 2024
14ada73
Updated submodule dependencies.
agrarpan Apr 30, 2024
0c3ce7c
Removed the refresh argument from calls to define_term.
agrarpan Apr 30, 2024
728fdcc
Updated submodule dependencies.
agrarpan May 1, 2024
59b2f2b
Updated submodule dependencies.
agrarpan May 29, 2024
efea470
Revert "Updated submodule dependencies."
agrarpan May 29, 2024
76ea00c
Update .gitmodules
agrarpan Jul 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ plugin/Makefile
plugin/.merlin
*.out
_opam
*.vok
*.vos
6 changes: 4 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[submodule "plugin/src/coq-plugin-lib"]
path = plugin/src/coq-plugin-lib
url = https://github.com/uwplse/coq-plugin-lib.git
url = https://github.com/agrarpan/coq-plugin-lib.git
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pointing to a local copy

branch = coq-8.13
[submodule "plugin/deps/fix-to-elim"]
path = plugin/deps/fix-to-elim
url = https://github.com/uwplse/fix-to-elim.git
url = https://github.com/agrarpan/fix-to-elim.git
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pointing to a local copy as well

branch = coq-8.13
1 change: 1 addition & 0 deletions plugin/Makefile.local
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OCAMLWARN=-warn-error +a-3-8-40-32-28-33-60
7 changes: 4 additions & 3 deletions plugin/_CoqProject
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
-I src/automation/search
-I src/automation/lift
-I src
-R theories Ornamental
-Q theories Ornamental
-R coq Foo

src/coq-plugin-lib/src/utilities/utilities.ml
src/coq-plugin-lib/src/utilities/utilities.mli
Expand Down Expand Up @@ -148,12 +149,12 @@ src/automation/lift/lift.mli

src/frontend.ml
src/frontend.mli
src/ornamental.ml4
src/ornamental.mlg
src/ornaments.mlpack

theories/Adjoint.v
theories/Unpack.v
theories/Prod.v
theories/Eliminators.v
theories/Equivalences.v
theories/Ornaments.v
theories/Ornaments.v
9 changes: 5 additions & 4 deletions plugin/build.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/usr/bin/env bash
git submodule init
git submodule update
echo "making makefile and cleaning"
make uninstall
make clean
coq_makefile -f _CoqProject -o Makefile
echo "building dependencies"
cd deps/fix-to-elim/plugin
./build.sh
cd ../../..
echo "building DEVOID"

coq_makefile -f _CoqProject -o Makefile
make clean && make && make install

make && make install
3 changes: 1 addition & 2 deletions plugin/coq/Indtype.v
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Add LoadPath "coq".
Require Import Ornamental.Ornaments.
Require Import List Sorting.Permutation.
Require Import Test TestLift.
Require Import Foo.Test Foo.TestLift.

Notation "( x ; y )" := (existT _ x y) (no associativity).
Notation "p .1" := (projT1 p) (left associativity, at level 8, format "p .1").
Expand Down
17 changes: 8 additions & 9 deletions plugin/coq/NoSmartCache.v
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Add LoadPath "coq".
Require Import Ornamental.Ornaments.
Require Import List.
Require Import minimal_records.
Require Import Foo.minimal_records.
Require Import Coq.Bool.Bool.

Set DEVOID search prove equivalence. (* <-- Correctness proofs for search *)
Expand All @@ -11,20 +10,20 @@ Unset DEVOID smart cache. (* <-- Disable the smart cache! *)

Module leb.

Lemma leb_implb : forall b1 b2, leb b1 b2 -> implb b1 b2 = true.
Lemma leb_implb : forall b1 b2, Bool.le b1 b2 -> implb b1 b2 = true.
Proof.
apply leb_implb.
apply Bool.le_implb.
Qed.

End leb.

Preprocess Module leb as leb' { opaque Bool.leb_implb }.
Preprocess Module leb as leb' { opaque Bool.le_implb }.
Definition leb_implb := leb'.leb_implb.

Definition f (b1 b2 b3 b4 : bool) (H : leb true false) (H0 : leb_implb true false H = leb_implb true false H) := ifb (eqb (negb (andb b1 (orb b2 (xorb b3 b4)))) true) false b4.
Definition g (b1 b2 b3 b4 : bool) (H : leb true false) (H0 : leb_implb true false H = leb_implb true false H) := ifb (eqb (negb (orb b1 (andb b2 (xorb b3 b4)))) true) false b4.
Definition h (b1 b2 b3 b4 : bool) (H : leb true false) (H0 : leb_implb true false H = leb_implb true false H) := ifb (eqb (negb (orb (andb b1 b2) (xorb b3 b4))) true) false b4.
Definition i (b1 b2 b3 b4 : bool) (H : leb true false) (H0 : leb_implb true false H = leb_implb true false H) := ifb (eqb (negb (andb (orb b1 b2) (xorb b3 b4))) true) false b4.
Definition f (b1 b2 b3 b4 : bool) (H : Bool.le true false) (H0 : leb_implb true false H = leb_implb true false H) := ifb (eqb (negb (andb b1 (orb b2 (xorb b3 b4)))) true) false b4.
Definition g (b1 b2 b3 b4 : bool) (H : Bool.le true false) (H0 : leb_implb true false H = leb_implb true false H) := ifb (eqb (negb (orb b1 (andb b2 (xorb b3 b4)))) true) false b4.
Definition h (b1 b2 b3 b4 : bool) (H : Bool.le true false) (H0 : leb_implb true false H = leb_implb true false H) := ifb (eqb (negb (orb (andb b1 b2) (xorb b3 b4))) true) false b4.
Definition i (b1 b2 b3 b4 : bool) (H : Bool.le true false) (H0 : leb_implb true false H = leb_implb true false H) := ifb (eqb (negb (andb (orb b1 b2) (xorb b3 b4))) true) false b4.

Time Lift Generated'.output Handwritten'.output in f as f'.
Time Lift Generated'.output Handwritten'.output in g as g'.
Expand Down
17 changes: 8 additions & 9 deletions plugin/coq/SmartCache.v
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Add LoadPath "coq".
Require Import Ornamental.Ornaments.
Require Import List.
Require Import minimal_records.
Require Import Foo.minimal_records.
Require Import Coq.Bool.Bool.

Set DEVOID search prove equivalence. (* <-- Correctness proofs for search *)
Expand All @@ -11,20 +10,20 @@ Set DEVOID smart cache.

Module leb.

Lemma leb_implb : forall b1 b2, leb b1 b2 -> implb b1 b2 = true.
Lemma leb_implb : forall b1 b2, Bool.le b1 b2 -> implb b1 b2 = true.
Proof.
apply leb_implb.
apply Bool.le_implb.
Qed.

End leb.

Preprocess Module leb as leb' { opaque Bool.leb_implb }.
Preprocess Module leb as leb' { opaque Bool.le_implb }.
Definition leb_implb := leb'.leb_implb.

Definition f (b1 b2 b3 b4 : bool) (H : leb true false) (H0 : leb_implb true false H = leb_implb true false H) := ifb (eqb (negb (andb b1 (orb b2 (xorb b3 b4)))) true) false b4.
Definition g (b1 b2 b3 b4 : bool) (H : leb true false) (H0 : leb_implb true false H = leb_implb true false H) := ifb (eqb (negb (orb b1 (andb b2 (xorb b3 b4)))) true) false b4.
Definition h (b1 b2 b3 b4 : bool) (H : leb true false) (H0 : leb_implb true false H = leb_implb true false H) := ifb (eqb (negb (orb (andb b1 b2) (xorb b3 b4))) true) false b4.
Definition i (b1 b2 b3 b4 : bool) (H : leb true false) (H0 : leb_implb true false H = leb_implb true false H) := ifb (eqb (negb (andb (orb b1 b2) (xorb b3 b4))) true) false b4.
Definition f (b1 b2 b3 b4 : bool) (H : Bool.le true false) (H0 : leb_implb true false H = leb_implb true false H) := ifb (eqb (negb (andb b1 (orb b2 (xorb b3 b4)))) true) false b4.
Definition g (b1 b2 b3 b4 : bool) (H : Bool.le true false) (H0 : leb_implb true false H = leb_implb true false H) := ifb (eqb (negb (orb b1 (andb b2 (xorb b3 b4)))) true) false b4.
Definition h (b1 b2 b3 b4 : bool) (H : Bool.le true false) (H0 : leb_implb true false H = leb_implb true false H) := ifb (eqb (negb (orb (andb b1 b2) (xorb b3 b4))) true) false b4.
Definition i (b1 b2 b3 b4 : bool) (H : Bool.le true false) (H0 : leb_implb true false H = leb_implb true false H) := ifb (eqb (negb (andb (orb b1 b2) (xorb b3 b4))) true) false b4.

Time Lift Generated'.output Handwritten'.output in f as f'.
Time Lift Generated'.output Handwritten'.output in g as g'.
Expand Down
3 changes: 2 additions & 1 deletion plugin/coq/Swap.v
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ opaque (* ignore these, just for speed *)
Nat.lt_irrefl
Nat.le_refl
Nat.bi_induction
Nat.central_induction;
Nat.central_induction
Nat.sub_succ;
hint (* some tacic hints for better scripts *)
"auto"
}.
Expand Down
1 change: 0 additions & 1 deletion plugin/coq/TestFindLift.v
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Add LoadPath "coq".
Require Import List.
Require Import Ornamental.Ornaments.

Expand Down
5 changes: 2 additions & 3 deletions plugin/coq/TestLift.v
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Add LoadPath "coq".
Require Import List.
Require Import Ornamental.Ornaments.
Require Import Test.
Require Import Infrastructure.
Require Import Foo.Test.
Require Import Foo.Infrastructure.

(*
* Test lifting directly
Expand Down
7 changes: 3 additions & 4 deletions plugin/coq/TestUnpack.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
* Basic lifting tests for unpack, building on TestLift.v
*)

Add LoadPath "coq".
Require Import Vector.
Require Import List.
Require Import Test.
Require Import TestLift.
Require Import Foo.Test.
Require Import Foo.TestLift.
Require Import Ornamental.Ornaments.
Require Import Infrastructure.
Require Import Foo.Infrastructure.

Set DEVOID lift type.

Expand Down
1 change: 0 additions & 1 deletion plugin/coq/examples/Assumptions.v
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* See issue #37 for the status of lifting restrictions that Search makes.
*)

Add LoadPath "coq/examples".
Require Import Ornamental.Ornaments.
Require Import List ZArith Nat.
Require Import Search.
Expand Down
3 changes: 1 addition & 2 deletions plugin/coq/examples/Example.v
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* take a look at the state of this file in the ITP release.
*)

Add LoadPath "coq/examples".
Require Import Vector.
Require Import List.
Require Import Ornamental.Ornaments.
Expand Down Expand Up @@ -309,7 +308,7 @@ Configure Lift packed vector { opaque Eqdep_dec.UIP_dec Nat.eq_dec }.
(*
* Then we repair (lifting hs_to_coqV_p first makes this faster and makes the result prettier):
*)
Lift Module packed vector in hs_to_coqV_p as hs_to_coqV_u.
Lift Module packed vector in hs_to_coqV_p as hs_to_coqV_u {opaque hs_to_coqV_p.list_to_t_adjunction}.
Repair Module packed vector in packed_vector as uf.

(* We are done. Here are our final types: *)
Expand Down
1 change: 0 additions & 1 deletion plugin/coq/examples/Lift.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Walkthrough of lifting for Section 4
*)

Add LoadPath "coq/examples".
Require Import Vector.
Require Import List.
Require Import Ornamental.Ornaments.
Expand Down
1 change: 0 additions & 1 deletion plugin/coq/examples/LiftSpec.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Section 3.2 Examples
*)

Add LoadPath "coq/examples".
Require Import Vector.
Require Import List.
Require Import Ornamental.Ornaments.
Expand Down
1 change: 0 additions & 1 deletion plugin/coq/examples/Search.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Walkthrough of search for Section 4
*)

Add LoadPath "coq/examples".
Require Import Vector.
Require Import List.
Require Import Ornamental.Ornaments.
Expand Down
2 changes: 1 addition & 1 deletion plugin/coq/prod_rect.v
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
From Ornamental Require Import Ornaments.
Require Import Infrastructure.
Require Import Foo.Infrastructure.

Set DEVOID search prove equivalence.
Set DEVOID lift type.
Expand Down
11 changes: 6 additions & 5 deletions plugin/src/automation/depelim.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ open Nameops
open Declarations
open Apputils
open Sigmautils
open Contextutils

(*
* Given a relative context quantifying an inductive family's indices, assemble
Expand Down Expand Up @@ -85,16 +86,16 @@ let eta_guard_motive ncons nindex typ =
in
let { index_type; packer } = dest_sigT domain in
let packed_type = Reduction.beta_app (Vars.lift 1 packer) (mkRel 1) in
let name_1 = Name.map (fun id -> add_suffix id "_1") name in
let name_2 = Name.map (fun id -> add_suffix id "_2") name in
let name_1 = Name.map (fun id -> add_suffix id "_1") (Context.binder_name name) in
let name_2 = Name.map (fun id -> add_suffix id "_2") (Context.binder_name name) in
mkApp
(sigT_rect,
[|index_type; packer;
mkLambda (name, domain, codomain);
mkLambda (name_1, index_type,
mkLambda (name_2, packed_type, body))|])
mkLambda (get_rel_ctx_name name_1, index_type,
mkLambda (get_rel_ctx_name name_2, packed_type, body))|])
else
mkLambda (name, domain, body)
mkLambda ( name, domain, body)
in
Vars.lift (ncons + nindex + 1) typ |> aux 0

Expand Down
31 changes: 16 additions & 15 deletions plugin/src/automation/lift/lift.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ open Promotion
open Liftconfig
open Liftrules
open Evd
open Record

(*
* The top-level lifting algorithm
Expand Down Expand Up @@ -144,13 +145,13 @@ let lift_evar c env trm lift_rec sigma =
match info.evar_body with
| Evar_empty -> sigma, Evar_empty
| Evar_defined bod ->
let bod = EConstr.to_constr sigma bod in
let bod = EConstr.to_constr ~abort_on_undefined_evars:false sigma bod in
let sigma, lifted_bod = lift_rec env sigma c bod in
sigma, Evar_defined (EConstr.of_constr lifted_bod)
in
let sigma, evar_candidates =
if Option.has_some info.evar_candidates then
let candidates = List.map (EConstr.to_constr sigma) (Option.get info.evar_candidates) in
let candidates = List.map (EConstr.to_constr ~abort_on_undefined_evars:false sigma) (Option.get info.evar_candidates) in
let sigma, lifted_candidates = map_rec_args_list lift_rec env sigma c candidates in
sigma, Some (List.map EConstr.of_constr lifted_candidates)
else
Expand Down Expand Up @@ -201,28 +202,28 @@ let lift_core env c trm sigma =
| Prod (n, t, b) ->
(* PROD *)
let sigma, t' = lift_rec en sigma c t in
let en_b = push_local (n, t) en in
let en_b = push_local (n.binder_name, t) en in
let sigma, b' = lift_rec en_b sigma (zoom c) b in
(sigma, mkProd (n, t', b'))
| Lambda (n, t, b) ->
(* LAMBDA *)
let sigma, t' = lift_rec en sigma c t in
let en_b = push_local (n, t) en in
let en_b = push_local (n.binder_name, t) en in
let sigma, b' = lift_rec en_b sigma (zoom c) b in
(sigma, mkLambda (n, t', b'))
| LetIn (n, trm, typ, e) ->
(* LETIN *)
let sigma, trm' = lift_rec en sigma c trm in
let sigma, typ' = lift_rec en sigma c typ in
let en_e = push_let_in (n, trm, typ) en in
let en_e = push_let_in (n.binder_name, trm, typ) en in
let sigma, e' = lift_rec en_e sigma (zoom c) e in
(sigma, mkLetIn (n, trm', typ', e'))
| Case (ci, ct, m, bs) ->
| Case (ci, ct, iv, m, bs) ->
(* CASE (will not work if this destructs over A; preprocess first) *)
let sigma, ct' = lift_rec en sigma c ct in
let sigma, m' = lift_rec en sigma c m in
let sigma, bs' = map_rec_args lift_rec en sigma c bs in
(sigma, mkCase (ci, ct', m', bs'))
(sigma, mkCase (ci, ct', iv, m', bs'))
| Fix ((is, i), (ns, ts, ds)) ->
(* FIX (will not work if this destructs over A; preprocess first) *)
let sigma, ts' = map_rec_args lift_rec en sigma c ts in
Expand Down Expand Up @@ -272,17 +273,17 @@ let define_lifted_eliminator ?(suffix="_sigT") l ind0 ind sort =
let raw_ident = Indrec.make_elimination_ident ind_name sort in
Nameops.add_suffix raw_ident suffix
in
let elim0 = Indrec.lookup_eliminator ind0 sort in
let elim = Indrec.lookup_eliminator ind sort in
let elim0 = Indrec.lookup_eliminator env ind0 sort in
let elim = Indrec.lookup_eliminator env ind sort in
let sigma, (eta_term, eta_type) =
let sigma, term = Evarutil.new_global (Evd.from_env env) elim in
let sigma, typ = Typing.type_of env sigma term in
let typ = Reductionops.nf_betaiotazeta env sigma typ in
let term, typ = EConstr.(to_constr sigma term, to_constr sigma typ) in
sigma, Depelim.eta_guard_eliminator mind_specif term typ
in
let elim' = UnivGen.constr_of_global (Defutils.define_term ~typ:eta_type ident sigma eta_term true) in
let elim0 = UnivGen.constr_of_global elim0 in
let elim' = UnivGen.constr_of_monomorphic_global (Defutils.define_term ~typ:eta_type ident sigma eta_term) in
let elim0 = UnivGen.constr_of_monomorphic_global elim0 in
save_lifting (lift_to l, lift_back l, elim0) elim';
save_lifting (lift_back l, lift_to l, elim') elim0

Expand Down Expand Up @@ -314,7 +315,7 @@ let do_lift_ind env sigma l typename suffix ind ignores is_lift_module =
else
let _ = check_inductive_supported mind_body in
let env, univs, arity, constypes = open_inductive ~global:true env mind_specif in
let sigma = Evd.update_sigma_env sigma env in
let sigma = Evd.update_sigma_univs (Global.universes ()) sigma in
let nparam = mind_body.mind_nparams_rec in
let sigma, arity' = do_lift_term env sigma l arity ignores in
let sigma, constypes' = map_state (fun trm sigma -> do_lift_term env sigma l trm ignores) constypes sigma in
Expand All @@ -325,7 +326,7 @@ let do_lift_ind env sigma l typename suffix ind ignores is_lift_module =
let ind' =
declare_inductive typename consnames is_template univs nparam arity' constypes'
in
List.iter (define_lifted_eliminator l ind ind') ind_body.mind_kelim;
List.iter (define_lifted_eliminator l ind ind') (Inductiveops.sorts_below ind_body.mind_kelim);
declare_inductive_liftings l ind ind' (List.length constypes);
(* Lift record projections *)
try
Expand All @@ -350,14 +351,14 @@ let do_lift_ind env sigma l typename suffix ind ignores is_lift_module =
let c = mkConst p in
let sigma, p_lifted = do_lift_term env sigma l c ignores in
let n = Names.Label.to_id (Names.Constant.label p) in
let def = Defutils.define_term n sigma p_lifted true in
let def = Defutils.define_term n sigma p_lifted in
Feedback.msg_info
(Pp.str (Printf.sprintf "DEVOID generated %s" (Names.Id.to_string n)));
def))
r.s_PROJ
in
(try
declare_structure (ind', (ind', 1), pks, ps);
Record.Internal.declare_structure_entry {s_CONST = (ind',1); s_EXPECTEDPARAM = r.s_EXPECTEDPARAM; s_PROJKIND = pks; s_PROJ = ps};
ind'
with _ ->
Feedback.msg_warning
Expand Down
Loading