aboutsummaryrefslogtreecommitdiffstats
path: root/common/Unityping.v
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@college-de-france.fr>2020-06-21 18:22:00 +0200
committerXavier Leroy <xavier.leroy@college-de-france.fr>2020-12-29 15:29:56 +0100
commitaba0e740f25ffa5c338dfa76cab71144802cebc2 (patch)
tree746115009aa60b802a2b5369a5106a2e971eb22f /common/Unityping.v
parent2e202e2b17cc3ae909628b7b3ae0b8ede3117d82 (diff)
downloadcompcert-kvx-aba0e740f25ffa5c338dfa76cab71144802cebc2.tar.gz
compcert-kvx-aba0e740f25ffa5c338dfa76cab71144802cebc2.zip
Replace `omega` tactic with `lia`
Since Coq 8.12, `omega` is flagged as deprecated and scheduled for removal. Also replace CompCert's homemade tactics `omegaContradiction`, `xomega`, and `xomegaContradiction` with `lia` and `extlia`. Turn back on the deprecation warning for uses of `omega`. Make the proof of `Ctypes.sizeof_pos` more robust to variations in `lia`.
Diffstat (limited to 'common/Unityping.v')
-rw-r--r--common/Unityping.v16
1 files changed, 8 insertions, 8 deletions
diff --git a/common/Unityping.v b/common/Unityping.v
index 28bcfb5c..878e5943 100644
--- a/common/Unityping.v
+++ b/common/Unityping.v
@@ -126,12 +126,12 @@ Lemma length_move:
length e'.(te_equ) + (if changed then 1 else 0) <= S(length e.(te_equ)).
Proof.
unfold move; intros.
- destruct (peq r1 r2). inv H. omega.
+ destruct (peq r1 r2). inv H. lia.
destruct e.(te_typ)!r1 as [ty1|]; destruct e.(te_typ)!r2 as [ty2|]; inv H; simpl.
- destruct (T.eq ty1 ty2); inv H1. omega.
- omega.
- omega.
- omega.
+ destruct (T.eq ty1 ty2); inv H1. lia.
+ lia.
+ lia.
+ lia.
Qed.
Lemma length_solve_rec:
@@ -140,14 +140,14 @@ Lemma length_solve_rec:
length e'.(te_equ) + (if ch' && negb ch then 1 else 0) <= length e.(te_equ) + length q.
Proof.
induction q; simpl; intros.
-- inv H. replace (ch' && negb ch') with false. omega. destruct ch'; auto.
+- inv H. replace (ch' && negb ch') with false. lia. destruct ch'; auto.
- destruct a as [r1 r2]; monadInv H. rename x0 into e0. rename x into ch0.
exploit IHq; eauto. intros A.
exploit length_move; eauto. intros B.
set (X := (if ch' && negb (ch || ch0) then 1 else 0)) in *.
set (Y := (if ch0 then 1 else 0)) in *.
set (Z := (if ch' && negb ch then 1 else 0)) in *.
- cut (Z <= X + Y). intros. omega.
+ cut (Z <= X + Y). intros. lia.
unfold X, Y, Z. destruct ch'; destruct ch; destruct ch0; simpl; auto.
Qed.
@@ -164,7 +164,7 @@ Function solve_constraints (e: typenv) {measure weight_typenv e}: res typenv :=
end.
Proof.
intros. exploit length_solve_rec; eauto. simpl. intros.
- unfold weight_typenv. omega.
+ unfold weight_typenv. lia.
Qed.
Definition typassign := positive -> T.t.