Commit 0b843fa1 authored by Michael Sammler's avatar Michael Sammler
Browse files

upgrade to coq 8.14.0

parent aa80dd32
Pipeline #55549 passed with stage
in 30 minutes and 46 seconds
...@@ -6,7 +6,7 @@ stages: ...@@ -6,7 +6,7 @@ stages:
variables: variables:
# dune takes care of parallelization itself and does not like running in parallel # dune takes care of parallelization itself and does not like running in parallel
CPU_CORES: "1" CPU_CORES: "1"
MAKE_TARGET: "all_with_examples" MAKE_TARGET: "ci"
OCAML: "ocaml-base-compiler.4.07.1" OCAML: "ocaml-base-compiler.4.07.1"
.template: &template .template: &template
...@@ -30,10 +30,10 @@ variables: ...@@ -30,10 +30,10 @@ variables:
- api - api
## Build jobs ## Build jobs
build-coq.8.13.2-timing: build-coq.8.14.0-timing:
<<: *template <<: *template
variables: variables:
OPAM_PINS: "coq version 8.13.2 cerberus git git+https://github.com/rems-project/cerberus.git#7eb94d628845555cb5425f4f4b48890b345efdc5" OPAM_PINS: "coq version 8.14.0 cerberus git git+https://github.com/rems-project/cerberus.git#7eb94d628845555cb5425f4f4b48890b345efdc5"
DENY_WARNINGS: "1" DENY_WARNINGS: "1"
OPAM_PKG: "1" OPAM_PKG: "1"
only: only:
...@@ -43,10 +43,10 @@ build-coq.8.13.2-timing: ...@@ -43,10 +43,10 @@ build-coq.8.13.2-timing:
tags: tags:
- fp-timing - fp-timing
build-coq.8.13.2: build-coq.8.14.0:
<<: *template <<: *template
variables: variables:
OPAM_PINS: "coq version 8.13.2 cerberus git git+https://github.com/rems-project/cerberus.git#7eb94d628845555cb5425f4f4b48890b345efdc5" OPAM_PINS: "coq version 8.14.0 cerberus git git+https://github.com/rems-project/cerberus.git#7eb94d628845555cb5425f4f4b48890b345efdc5"
DENY_WARNINGS: "1" DENY_WARNINGS: "1"
only: only:
- /^ci/@iris/refinedc - /^ci/@iris/refinedc
...@@ -54,7 +54,7 @@ build-coq.8.13.2: ...@@ -54,7 +54,7 @@ build-coq.8.13.2:
trigger-iris.dev: trigger-iris.dev:
<<: *template <<: *template
variables: variables:
OPAM_PINS: "coq version 8.13.dev coq-stdpp.dev git git+https://gitlab.mpi-sws.org/iris/stdpp.git#$STDPP_REV coq-iris.dev git git+https://gitlab.mpi-sws.org/iris/iris.git#$IRIS_REV cerberus git git+https://github.com/rems-project/cerberus.git#7eb94d628845555cb5425f4f4b48890b345efdc5" OPAM_PINS: "coq version 8.14.dev coq-stdpp.dev git git+https://gitlab.mpi-sws.org/iris/stdpp.git#$STDPP_REV coq-iris.dev git git+https://gitlab.mpi-sws.org/iris/iris.git#$IRIS_REV cerberus git git+https://github.com/rems-project/cerberus.git#7eb94d628845555cb5425f4f4b48890b345efdc5"
except: except:
only: only:
- triggers - triggers
......
...@@ -6,6 +6,10 @@ all_with_examples: generate_all ...@@ -6,6 +6,10 @@ all_with_examples: generate_all
@dune build --display short @dune build --display short
.PHONY: all_with_examples .PHONY: all_with_examples
ci: restore_dune_project all_with_examples
@true
.PHONY: ci_all
install: install:
@dune install @dune install
.PHONY: install .PHONY: install
...@@ -37,9 +41,18 @@ clean: clean_generated ...@@ -37,9 +41,18 @@ clean: clean_generated
.PHONY: clean .PHONY: clean
builddep-opamfiles: builddep/refinedc-builddep.opam builddep-opamfiles: builddep/refinedc-builddep.opam
@echo "# Renaming dune-project to work around coq#15044"
@mv dune-project dune-project.tmp
@true @true
.PHONY: builddep-opamfiles .PHONY: builddep-opamfiles
restore_dune_project:
@if [ -f dune-project.tmp ] && ! [ -e dune-project ]; then \
echo "# Renaming dune-project back";\
mv dune-project.tmp dune-project;\
fi
.PHONY: restore_dune_project
# Create a virtual Opam package with the same deps as RefinedC, but no # Create a virtual Opam package with the same deps as RefinedC, but no
# build. Uses a very ugly hack to use sed for removing the last 4 # build. Uses a very ugly hack to use sed for removing the last 4
# lines since head -n -4 does not work on MacOS # lines since head -n -4 does not work on MacOS
...@@ -54,8 +67,12 @@ builddep/refinedc-builddep.opam: refinedc.opam Makefile ...@@ -54,8 +67,12 @@ builddep/refinedc-builddep.opam: refinedc.opam Makefile
# 2) they will remain satisfied even if other packages are updated/installed, # 2) they will remain satisfied even if other packages are updated/installed,
# 3) we do not have to pin the RefinedC package itself (which takes time). # 3) we do not have to pin the RefinedC package itself (which takes time).
builddep: builddep/refinedc-builddep.opam builddep: builddep/refinedc-builddep.opam
@echo "# Renaming dune-project to work around coq#15044"
@mv dune-project dune-project.tmp
@echo "# Installing package $^." @echo "# Installing package $^."
@opam install $(OPAMFLAGS) $^ @opam install $(OPAMFLAGS) $^
@echo "# Renaming dune-project back"
@mv dune-project.tmp dune-project
.PHONY: builddep .PHONY: builddep
# FIXME # FIXME
......
(lang dune 2.7) (lang dune 2.9)
(name refinedc) (name refinedc)
(using coq 0.2) (using coq 0.3)
...@@ -61,13 +61,13 @@ Inductive range : Type := ...@@ -61,13 +61,13 @@ Inductive range : Type :=
| ei : nat nat range (* (l, r] *) | ei : nat nat range (* (l, r] *)
. .
Instance range_elem_of : ElemOf nat range := λ i I, Global Instance range_elem_of : ElemOf nat range := λ i I,
match I with match I with
| ie l r => l i i < r | ie l r => l i i < r
| ei l r => l < i i r | ei l r => l < i i r
end. end.
Instance range_elem_of_decision (i : nat) (I : range) : Decision (i I). Global Instance range_elem_of_decision (i : nat) (I : range) : Decision (i I).
Proof. Proof.
destruct I as [l r | l r]. destruct I as [l r | l r].
- destruct (decide (l i i < r)); by [ left | right ]. - destruct (decide (l i i < r)); by [ left | right ].
......
...@@ -7,7 +7,7 @@ Definition WrappingAdd (it1 it2 : int_type) (es : list expr) : expr := ...@@ -7,7 +7,7 @@ Definition WrappingAdd (it1 it2 : int_type) (es : list expr) : expr :=
| _ => Val VOID | _ => Val VOID
end%E. end%E.
Program Instance WrappingAdd_wf it1 it2 : MacroWfSubst (WrappingAdd it1 it2). Global Program Instance WrappingAdd_wf it1 it2 : MacroWfSubst (WrappingAdd it1 it2).
Next Obligation. move => ???? [|?[|?[|??]]]//. Qed. Next Obligation. move => ???? [|?[|?[|??]]]//. Qed.
Typeclasses Opaque WrappingAdd. Typeclasses Opaque WrappingAdd.
...@@ -5,7 +5,7 @@ Set Default Proof Using "Type". ...@@ -5,7 +5,7 @@ Set Default Proof Using "Type".
Lemma shift_12_eq_mul_4096 n : Lemma shift_12_eq_mul_4096 n :
(n 12) = n * 4096. (n 12) = n * 4096.
Proof. by rewrite Z.shiftl_mul_pow2. Qed. Proof. by rewrite Z.shiftl_mul_pow2. Qed.
Hint Rewrite shift_12_eq_mul_4096 : lithium_rewrite. #[export] Hint Rewrite shift_12_eq_mul_4096 : lithium_rewrite.
Lemma ly_size_PAGES i : ly_size (PAGES i) = (i * Z.to_nat PAGE_SIZE)%nat. Lemma ly_size_PAGES i : ly_size (PAGES i) = (i * Z.to_nat PAGE_SIZE)%nat.
Proof. by rewrite /PAGES /ly_with_align /ly_size. Qed. Proof. by rewrite /PAGES /ly_with_align /ly_size. Qed.
...@@ -38,12 +38,12 @@ Proof. rewrite !ly_size_PAGES. lia. Qed. ...@@ -38,12 +38,12 @@ Proof. rewrite !ly_size_PAGES. lia. Qed.
Typeclasses Opaque PAGES. Typeclasses Opaque PAGES.
Global Opaque PAGES. Global Opaque PAGES.
Hint Rewrite ly_size_ly_offset : lithium_rewrite. #[export] Hint Rewrite ly_size_ly_offset : lithium_rewrite.
Hint Rewrite ly_size_PAGES_sub : lithium_rewrite. #[export] Hint Rewrite ly_size_PAGES_sub : lithium_rewrite.
Hint Rewrite ly_size_PAGES : lithium_rewrite. #[export] Hint Rewrite ly_size_PAGES : lithium_rewrite.
Hint Rewrite ly_offset_PAGES : lithium_rewrite. #[export] Hint Rewrite ly_offset_PAGES : lithium_rewrite.
Hint Rewrite ly_size_ly_offset : refinedc_loc_eq_rewrite. #[export] Hint Rewrite ly_size_ly_offset : refinedc_loc_eq_rewrite.
Hint Rewrite ly_size_PAGES_sub : refinedc_loc_eq_rewrite. #[export] Hint Rewrite ly_size_PAGES_sub : refinedc_loc_eq_rewrite.
Hint Rewrite ly_size_PAGES : refinedc_loc_eq_rewrite. #[export] Hint Rewrite ly_size_PAGES : refinedc_loc_eq_rewrite.
Hint Rewrite ly_offset_PAGES : refinedc_loc_eq_rewrite. #[export] Hint Rewrite ly_offset_PAGES : refinedc_loc_eq_rewrite.
...@@ -25,7 +25,7 @@ Class spinlockG Σ := SpinLockG { ...@@ -25,7 +25,7 @@ Class spinlockG Σ := SpinLockG {
Definition spinlockΣ : gFunctors := Definition spinlockΣ : gFunctors :=
#[GFunctor (constRF (gmapR Z (exclR unitO))); #[GFunctor (constRF (gmapR Z (exclR unitO)));
GFunctor (constRF (excl_authR ZO))]. GFunctor (constRF (excl_authR ZO))].
Instance subG_spinlockG {Σ} : subG spinlockΣ Σ spinlockG Σ. Global Instance subG_spinlockG {Σ} : subG spinlockΣ Σ spinlockG Σ.
Proof. solve_inG. Qed. Proof. solve_inG. Qed.
Section type. Section type.
......
...@@ -16,9 +16,9 @@ bug-reports: "https://gitlab.mpi-sws.org/iris/refinedc/issues" ...@@ -16,9 +16,9 @@ bug-reports: "https://gitlab.mpi-sws.org/iris/refinedc/issues"
dev-repo: "git+https://gitlab.mpi-sws.org/iris/refinedc.git" dev-repo: "git+https://gitlab.mpi-sws.org/iris/refinedc.git"
depends: [ depends: [
"coq" { (>= "8.13.2" & < "8.15~") } "coq" { (>= "8.14.0" & < "8.15~") }
"coq-iris" { (= "dev.2021-09-13.0.6575260a") | (= "dev") } "coq-iris" { (= "dev.2021-09-13.0.6575260a") | (= "dev") }
"dune" {>= "2.7.0"} "dune" {>= "2.9.1"}
"cerberus" {= "~dev"} "cerberus" {= "~dev"}
"cmdliner" {>= "1.0.4"} "cmdliner" {>= "1.0.4"}
"earley" {= "3.0.0"} "earley" {= "3.0.0"}
......
...@@ -277,27 +277,27 @@ Qed. ...@@ -277,27 +277,27 @@ Qed.
(* rewrite & simpl rules *) (* rewrite & simpl rules *)
Create HintDb bitfield_rewrite discriminated. Create HintDb bitfield_rewrite discriminated.
Hint Rewrite bf_land_nil : bitfield_rewrite. #[export] Hint Rewrite bf_land_nil : bitfield_rewrite.
Hint Rewrite bf_land_mask_cons using can_solve_tac : bitfield_rewrite. #[export] Hint Rewrite bf_land_mask_cons using can_solve_tac : bitfield_rewrite.
Hint Rewrite bf_land_mask_flip using can_solve_tac : bitfield_rewrite. #[export] Hint Rewrite bf_land_mask_flip using can_solve_tac : bitfield_rewrite.
Hint Rewrite bf_lor_nil_l : bitfield_rewrite. #[export] Hint Rewrite bf_lor_nil_l : bitfield_rewrite.
Hint Rewrite bf_lor_nil_r : bitfield_rewrite. #[export] Hint Rewrite bf_lor_nil_r : bitfield_rewrite.
Hint Rewrite bf_lor_update using lia : bitfield_rewrite. #[export] Hint Rewrite bf_lor_update using lia : bitfield_rewrite.
Hint Rewrite bf_lor_update_ne using lia : bitfield_rewrite. #[export] Hint Rewrite bf_lor_update_ne using lia : bitfield_rewrite.
Hint Rewrite bf_lor_mask_cons_l using lia : bitfield_rewrite. #[export] Hint Rewrite bf_lor_mask_cons_l using lia : bitfield_rewrite.
Hint Rewrite bf_lor_mask_cons_ne_l using lia : bitfield_rewrite. #[export] Hint Rewrite bf_lor_mask_cons_ne_l using lia : bitfield_rewrite.
Hint Rewrite bf_lor_mask_cons_r using lia : bitfield_rewrite. #[export] Hint Rewrite bf_lor_mask_cons_r using lia : bitfield_rewrite.
Hint Rewrite bf_lor_mask_cons_ne_r using lia : bitfield_rewrite. #[export] Hint Rewrite bf_lor_mask_cons_ne_r using lia : bitfield_rewrite.
Hint Rewrite bf_lor_mask_cons using lia : bitfield_rewrite. #[export] Hint Rewrite bf_lor_mask_cons using lia : bitfield_rewrite.
Hint Rewrite bf_slice_nil : bitfield_rewrite. #[export] Hint Rewrite bf_slice_nil : bitfield_rewrite.
Hint Rewrite bf_slice_cons using can_solve_tac : bitfield_rewrite. #[export] Hint Rewrite bf_slice_cons using can_solve_tac : bitfield_rewrite.
Hint Rewrite bf_slice_cons_ne using lia : bitfield_rewrite. #[export] Hint Rewrite bf_slice_cons_ne using lia : bitfield_rewrite.
Hint Rewrite bf_update_nil : bitfield_rewrite. #[export] Hint Rewrite bf_update_nil : bitfield_rewrite.
Hint Rewrite bf_update_cons using can_solve_tac : bitfield_rewrite. #[export] Hint Rewrite bf_update_cons using can_solve_tac : bitfield_rewrite.
Hint Rewrite bf_update_cons_ne using lia : bitfield_rewrite. #[export] Hint Rewrite bf_update_cons_ne using lia : bitfield_rewrite.
Definition normalize_bitfield (bv norm : Z) : Prop := bv = norm. Definition normalize_bitfield (bv norm : Z) : Prop := bv = norm.
Typeclasses Opaque normalize_bitfield. Typeclasses Opaque normalize_bitfield.
......
...@@ -17,7 +17,7 @@ Record byte := ...@@ -17,7 +17,7 @@ Record byte :=
Program Definition byte0 : byte := {| byte_val := 0; |}. Program Definition byte0 : byte := {| byte_val := 0; |}.
Next Obligation. done. Qed. Next Obligation. done. Qed.
Instance byte_eq_dec : EqDecision byte. #[export] Instance byte_eq_dec : EqDecision byte.
Proof. Proof.
move => [b1 H1] [b2 H2]. destruct (decide (b1 = b2)) as [->|]. move => [b1 H1] [b2 H2]. destruct (decide (b1 = b2)) as [->|].
- left. assert (H1 = H2) as ->; [|done]. apply proof_irrel. - left. assert (H1 = H2) as ->; [|done]. apply proof_irrel.
......
...@@ -188,7 +188,7 @@ Qed. ...@@ -188,7 +188,7 @@ Qed.
(** An allocation can either be a stack allocation or a heap allocation. *) (** An allocation can either be a stack allocation or a heap allocation. *)
Inductive alloc_kind : Set := Inductive alloc_kind : Set :=
| HeapAlloc | HeapAlloc
| StackAlloc | StackAlloc
| GlobalAlloc. | GlobalAlloc.
Record allocation := Record allocation :=
...@@ -222,7 +222,7 @@ memory (e.g., does not contain NULL). *) ...@@ -222,7 +222,7 @@ memory (e.g., does not contain NULL). *)
Definition allocation_in_range (al : allocation) : Prop := Definition allocation_in_range (al : allocation) : Prop :=
min_alloc_start al.(al_start) al_end al max_alloc_end. min_alloc_start al.(al_start) al_end al max_alloc_end.
Instance elem_of_alloc : ElemOf addr allocation := Global Instance elem_of_alloc : ElemOf addr allocation :=
λ a al, al.(al_start) a < al_end al. λ a al, al.(al_start) a < al_end al.
(** ** Representation of the state of the heap and allocation operations. *) (** ** Representation of the state of the heap and allocation operations. *)
......
...@@ -669,7 +669,7 @@ Lemma val_stuck e1 σ1 κ e2 σ2 ef : ...@@ -669,7 +669,7 @@ Lemma val_stuck e1 σ1 κ e2 σ2 ef :
runtime_step e1 σ1 κ e2 σ2 ef to_val e1 = None. runtime_step e1 σ1 κ e2 σ2 ef to_val e1 = None.
Proof. destruct 1 => //. revert select (expr_step _ _ _ _ _ _). by destruct 1. Qed. Proof. destruct 1 => //. revert select (expr_step _ _ _ _ _ _). by destruct 1. Qed.
Instance fill_item_inj Ki : Inj (=) (=) (lang_fill_item Ki). Global Instance fill_item_inj Ki : Inj (=) (=) (lang_fill_item Ki).
Proof. destruct Ki as [E|E ?]; destruct E; intros ???; simplify_eq/=; auto with f_equal. Qed. Proof. destruct Ki as [E|E ?]; destruct E; intros ???; simplify_eq/=; auto with f_equal. Qed.
Lemma fill_item_val Ki e : Lemma fill_item_val Ki e :
...@@ -705,15 +705,15 @@ Canonical Structure c_lang := LanguageOfEctx c_ectx_lang. ...@@ -705,15 +705,15 @@ Canonical Structure c_lang := LanguageOfEctx c_ectx_lang.
(** * Useful instances and canonical structures *) (** * Useful instances and canonical structures *)
Instance mbyte_inhabited : Inhabited mbyte := populate (MPoison). Global Instance mbyte_inhabited : Inhabited mbyte := populate (MPoison).
Instance val_inhabited : Inhabited val := _. Global Instance val_inhabited : Inhabited val := _.
Instance expr_inhabited : Inhabited expr := populate (Val inhabitant). Global Instance expr_inhabited : Inhabited expr := populate (Val inhabitant).
Instance stmt_inhabited : Inhabited stmt := populate (Goto "a"). Global Instance stmt_inhabited : Inhabited stmt := populate (Goto "a").
Instance function_inhabited : Inhabited function := Global Instance function_inhabited : Inhabited function :=
populate {| f_args := []; f_local_vars := []; f_code := ; f_init := "" |}. populate {| f_args := []; f_local_vars := []; f_code := ; f_init := "" |}.
Instance heap_state_inhabited : Inhabited heap_state := Global Instance heap_state_inhabited : Inhabited heap_state :=
populate {| hs_heap := inhabitant; hs_allocs := inhabitant; |}. populate {| hs_heap := inhabitant; hs_allocs := inhabitant; |}.
Instance state_inhabited : Inhabited state := Global Instance state_inhabited : Inhabited state :=
populate {| st_heap := inhabitant; st_fntbl := inhabitant; |}. populate {| st_heap := inhabitant; st_fntbl := inhabitant; |}.
Canonical Structure mbyteO := leibnizO mbyte. Canonical Structure mbyteO := leibnizO mbyte.
......
...@@ -11,7 +11,7 @@ Class refinedcG Σ := RefinedCG { ...@@ -11,7 +11,7 @@ Class refinedcG Σ := RefinedCG {
refinedcG_gen_heapG :> heapG Σ refinedcG_gen_heapG :> heapG Σ
}. }.
Instance c_irisG `{!refinedcG Σ} : irisGS c_lang Σ := { Global Instance c_irisG `{!refinedcG Σ} : irisGS c_lang Σ := {
iris_invGS := refinedcG_invG; iris_invGS := refinedcG_invG;
state_interp σ κs _ _ := state_ctx σ; state_interp σ κs _ _ := state_ctx σ;
fork_post _ := True%I; fork_post _ := True%I;
...@@ -20,7 +20,7 @@ Instance c_irisG `{!refinedcG Σ} : irisGS c_lang Σ := { ...@@ -20,7 +20,7 @@ Instance c_irisG `{!refinedcG Σ} : irisGS c_lang Σ := {
}. }.
Global Opaque iris_invGS. Global Opaque iris_invGS.
Instance into_val_val v : IntoVal (to_rtexpr (Val v)) v. Global Instance into_val_val v : IntoVal (to_rtexpr (Val v)) v.
Proof. done. Qed. Proof. done. Qed.
Global Instance wp_expr_wp `{!refinedcG Σ} : Wp (iProp Σ) expr val stuckness := Global Instance wp_expr_wp `{!refinedcG Σ} : Wp (iProp Σ) expr val stuckness :=
...@@ -36,13 +36,13 @@ Local Ltac solve_atomic := ...@@ -36,13 +36,13 @@ Local Ltac solve_atomic :=
[inversion 1; unfold coerce_rtexpr in *; simplify_eq; inv_expr_step; naive_solver [inversion 1; unfold coerce_rtexpr in *; simplify_eq; inv_expr_step; naive_solver
|unfold coerce_rtexpr in *;apply ectxi_language_sub_redexes_are_values; intros [[]|[]] **; naive_solver]. |unfold coerce_rtexpr in *;apply ectxi_language_sub_redexes_are_values; intros [[]|[]] **; naive_solver].
Instance cas_atomic s ot (v1 v2 v3 : val) : Atomic s (coerce_rtexpr (CAS ot v1 v2 v3)). Global Instance cas_atomic s ot (v1 v2 v3 : val) : Atomic s (coerce_rtexpr (CAS ot v1 v2 v3)).
Proof. solve_atomic. Qed. Proof. solve_atomic. Qed.
Instance skipe_atomic s (v : val) : Atomic s (coerce_rtexpr (SkipE v)). Global Instance skipe_atomic s (v : val) : Atomic s (coerce_rtexpr (SkipE v)).
Proof. solve_atomic. Qed. Proof. solve_atomic. Qed.
Instance deref_atomic s (l : loc) ly : Atomic s (coerce_rtexpr (Deref ScOrd ly l)). Global Instance deref_atomic s (l : loc) ly : Atomic s (coerce_rtexpr (Deref ScOrd ly l)).
Proof. solve_atomic. Qed. Proof. solve_atomic. Qed.
Instance use_atomic s (l : loc) ly : Atomic s (coerce_rtexpr (Use ScOrd ly l)). Global Instance use_atomic s (l : loc) ly : Atomic s (coerce_rtexpr (Use ScOrd ly l)).
Proof. solve_atomic. Qed. Proof. solve_atomic. Qed.
(*** General lifting lemmas *) (*** General lifting lemmas *)
......
...@@ -201,5 +201,5 @@ Proof. ...@@ -201,5 +201,5 @@ Proof.
apply: (Zdivide_mult_l _ n1). by rewrite Z.mul_comm -Nat2Z.inj_mul. apply: (Zdivide_mult_l _ n1). by rewrite Z.mul_comm -Nat2Z.inj_mul.
Qed. Qed.
Instance aligned_to_dec l n : Decision (l `aligned_to` n). #[export] Instance aligned_to_dec l n : Decision (l `aligned_to` n).
Proof. apply Znumtheory.Zdivide_dec. Qed. Proof. apply Znumtheory.Zdivide_dec. Qed.
...@@ -10,7 +10,7 @@ Inductive mbyte : Set := ...@@ -10,7 +10,7 @@ Inductive mbyte : Set :=
| MPtrFrag (l : loc) (n : nat) (** Fragment [n] for location [l]. *) | MPtrFrag (l : loc) (n : nat) (** Fragment [n] for location [l]. *)
| MPoison. | MPoison.
Instance mbyte_dec_eq : EqDecision mbyte. #[export] Instance mbyte_dec_eq : EqDecision mbyte.
Proof. solve_decision. Qed. Proof. solve_decision. Qed.
Program Definition mbyte_to_byte (mb : mbyte) : option (byte * option alloc_id) := Program Definition mbyte_to_byte (mb : mbyte) : option (byte * option alloc_id) :=
......
...@@ -10,7 +10,7 @@ Local Open Scope Z_scope. ...@@ -10,7 +10,7 @@ Local Open Scope Z_scope.
Create HintDb simplify_bool_eq_db discriminated. Create HintDb simplify_bool_eq_db discriminated.
Hint Rewrite #[export] Hint Rewrite
Bool.andb_false_r Bool.andb_false_r
Bool.andb_true_r Bool.andb_true_r
Bool.andb_false_l Bool.andb_false_l
...@@ -29,7 +29,7 @@ Ltac simplify_bool_eq := autorewrite with simplify_bool_eq_db. ...@@ -29,7 +29,7 @@ Ltac simplify_bool_eq := autorewrite with simplify_bool_eq_db.
Create HintDb simplify_index_db discriminated. Create HintDb simplify_index_db discriminated.
Hint Rewrite #[export] Hint Rewrite
Z.sub_add Z.sub_add
Z.add_simpl_r Z.add_simpl_r
: simplify_index_db. : simplify_index_db.
...@@ -48,7 +48,7 @@ Qed. ...@@ -48,7 +48,7 @@ Qed.
Create HintDb rewrite_bits_db discriminated. Create HintDb rewrite_bits_db discriminated.
Hint Rewrite #[export] Hint Rewrite
(* 0 *) (* 0 *)
Z.bits_0 Z.bits_0
(* 1 *) (* 1 *)
......
...@@ -6,31 +6,31 @@ Create HintDb lithium_rewrite discriminated. ...@@ -6,31 +6,31 @@ Create HintDb lithium_rewrite discriminated.
Ltac normalize_autorewrite := Ltac normalize_autorewrite :=
autorewrite with lithium_rewrite; exact: eq_refl. autorewrite with lithium_rewrite; exact: eq_refl.
Hint Rewrite @drop_0 @take_ge using can_solve_tac : lithium_rewrite. #[export] Hint Rewrite @drop_0 @take_ge using can_solve_tac : lithium_rewrite.
Hint Rewrite @take_app_le @drop_app_ge using can_solve_tac : lithium_rewrite. #[export] Hint Rewrite @take_app_le @drop_app_ge using can_solve_tac : lithium_rewrite.
Hint Rewrite @insert_length @app_length @fmap_length @rotate_length @replicate_length @drop_length : lithium_rewrite. #[export] Hint Rewrite @insert_length @app_length @fmap_length @rotate_length @replicate_length @drop_length : lithium_rewrite.
Hint Rewrite <- @fmap_take @fmap_drop : lithium_rewrite. #[export] Hint Rewrite <- @fmap_take @fmap_drop : lithium_rewrite.
Hint Rewrite @list_insert_fold : lithium_rewrite. #[export] Hint Rewrite @list_insert_fold : lithium_rewrite.
Hint Rewrite @list_insert_insert : lithium_rewrite. #[export] Hint Rewrite @list_insert_insert : lithium_rewrite.
Hint Rewrite @drop_drop : lithium_rewrite. #[export] Hint Rewrite @drop_drop : lithium_rewrite.
Hint Rewrite @tail_replicate @take_replicate @drop_replicate : lithium_rewrite. #[export] Hint Rewrite @tail_replicate @take_replicate @drop_replicate : lithium_rewrite.
Hint Rewrite <- @app_assoc @cons_middle : lithium_rewrite. #[export] Hint Rewrite <- @app_assoc @cons_middle : lithium_rewrite.
Hint Rewrite @app_nil_r @rev_involutive : lithium_rewrite. #[export] Hint Rewrite @app_nil_r @rev_involutive : lithium_rewrite.
Hint Rewrite <- @list_fmap_insert : lithium_rewrite. #[export] Hint Rewrite <- @list_fmap_insert : lithium_rewrite.
Hint Rewrite <- minus_n_O plus_n_O minus_n_n : lithium_rewrite. #[export] Hint Rewrite <- minus_n_O plus_n_O minus_n_n : lithium_rewrite.
Hint Rewrite Nat2Z.id : lithium_rewrite. #[export] Hint Rewrite Nat2Z.id : lithium_rewrite.
Hint Rewrite Z2Nat.inj_mul Z2Nat.inj_sub Z2Nat.id using can_solve_tac : lithium_rewrite. #[export] Hint Rewrite Z2Nat.inj_mul Z2Nat.inj_sub Z2Nat.id using can_solve_tac : lithium_rewrite.
Hint Rewrite Nat.succ_pred_pos using can_solve_tac : lithium_rewrite. #[export] Hint Rewrite Nat.succ_pred_pos using can_solve_tac : lithium_rewrite.
Hint Rewrite Nat.add_assoc Nat.min_id : lithium_rewrite. #[export] Hint Rewrite Nat.add_assoc Nat.min_id : lithium_rewrite.
Hint Rewrite Z.quot_mul using can_solve_tac : lithium_rewrite. #[export] Hint Rewrite Z.quot_mul using can_solve_tac : lithium_rewrite.
Hint Rewrite <-Nat.mul_sub_distr_r Z.mul_add_distr_r Z.mul_sub_distr_r : lithium_rewrite. #[export] Hint Rewrite <-Nat.mul_sub_distr_r Z.mul_add_distr_r Z.mul_sub_distr_r : lithium_rewrite.
Hint Rewrite @bool_decide_eq_x_x_true @if_bool_decide_eq_branches : lithium_rewrite. #[export] Hint Rewrite @bool_decide_eq_x_x_true @if_bool_decide_eq_branches : lithium_rewrite.
Hint Rewrite @bool_decide_eq_true_2 @bool_decide_eq_false_2 using fast_done : lithium_rewrite. #[export] Hint Rewrite @bool_decide_eq_true_2 @bool_decide_eq_false_2 using fast_done : lithium_rewrite.
Hint Rewrite keep_factor2_is_power_of_two keep_factor2_min_eq using can_solve_tac : lithium_rewrite. #[export] Hint Rewrite keep_factor2_is_power_of_two keep_factor2_min_eq using can_solve_tac : lithium_rewrite.
Hint Rewrite keep_factor2_min_1 keep_factor2_twice : lithium_rewrite. #[export] Hint Rewrite keep_factor2_min_1 keep_factor2_twice : lithium_rewrite.
Local Definition lookup_insert_gmap A K `{Countable K} := lookup_insert (M := gmap K) (A := A). Local Definition lookup_insert_gmap A K `{Countable K} := lookup_insert (M := gmap K) (A := A).
Hint Rewrite lookup_insert_gmap : lithium_rewrite. #[export] Hint Rewrite lookup_insert_gmap : lithium_rewrite.
(** * Second version of normalization based on typeclasses *) (** * Second version of normalization based on typeclasses *)
Class NormalizeWalk {A} (progress : bool) (a b : A) : Prop := normalize_walk: a = b. Class NormalizeWalk {A} (progress : bool) (a b : A) : Prop := normalize_walk: a = b.
......
...@@ -21,7 +21,7 @@ Definition typeΣ : gFunctors := ...@@ -21,7 +21,7 @@ Definition typeΣ : gFunctors :=
ghost_mapΣ alloc_id (Z * nat * alloc_kind); ghost_mapΣ alloc_id (Z * nat *