Skip to content

Commit d3773e4

Browse files
authored
Merge pull request #1481 from GaloisInc/saw-core-coq/fix-universe-constraints
[saw-core-coq] Fix weird universe constraints generated in SAWCorePreludeExtra
2 parents 83af6c1 + 07481e1 commit d3773e4

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

saw-core-coq/coq/_CoqProject

+2
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ handwritten/CryptolToCoq/SAWCorePrelude_proofs.v
1313
handwritten/CryptolToCoq/SAWCorePreludeExtra.v
1414
handwritten/CryptolToCoq/SAWCoreScaffolding.v
1515
handwritten/CryptolToCoq/SAWCoreVectorsAsCoqVectors.v
16+
17+
handwritten/CryptolToCoq/Everything.v
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
(* This file imports everything together in order to make sure
2+
that there are no universe inconsistencies *)
3+
4+
(* generated *)
5+
From CryptolToCoq Require Import CryptolPrimitivesForSAWCore.
6+
From CryptolToCoq Require Import SAWCorePrelude.
7+
8+
(* handwritten *)
9+
From CryptolToCoq Require Import CompM.
10+
From CryptolToCoq Require Import CompMExtra.
11+
From CryptolToCoq Require Import CoqVectorsExtra.
12+
From CryptolToCoq Require Import CryptolPrimitivesForSAWCoreExtra.
13+
From CryptolToCoq Require Import SAWCoreBitvectors.
14+
From CryptolToCoq Require Import SAWCorePrelude_proofs.
15+
From CryptolToCoq Require Import SAWCorePreludeExtra.
16+
From CryptolToCoq Require Import SAWCoreScaffolding.
17+
From CryptolToCoq Require Import SAWCoreVectorsAsCoqVectors.

saw-core-coq/coq/handwritten/CryptolToCoq/SAWCorePreludeExtra.v

+7-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ Qed.
7272

7373
Theorem unfold_fold_IRT As Ds D : forall u, unfoldIRT As Ds D (foldIRT As Ds D u) = u.
7474
Proof.
75-
revert Ds; induction D; try destruct u; simpl; f_equal; try easy.
75+
revert Ds; induction D; intros; try destruct u; simpl(*; f_equal; try easy*).
76+
(* For some reason using `f_equal` above generates universe constraints like
77+
`prod.u0 < eq.u0` which cause problems later on when it is assumed that
78+
`eq.u0 = Coq.Relations.Relation_Definitions.1 <= prod.u0` by
79+
`returnM_injective`. The easiest solution is just to not use `f_equal`
80+
here, and rewrite by the relevant induction hypotheses instead. *)
81+
all: try rewrite IHD; try rewrite IHD1; try rewrite IHD2; try rewrite H; try easy.
7682
(* All that remains is the IRT_BVVec case, which requires functional extensionality
7783
and the fact that genBVVec and atBVVec define an isomorphism *)
7884
intros; rewrite <- (gen_at_BVVec _ _ _ u).

0 commit comments

Comments
 (0)