aboutsummaryrefslogtreecommitdiffstats
path: root/mppa_k1c/abstractbb
diff options
context:
space:
mode:
authorSylvain Boulmé <sylvain.boulme@univ-grenoble-alpes.fr>2019-04-08 17:39:28 +0200
committerSylvain Boulmé <sylvain.boulme@univ-grenoble-alpes.fr>2019-04-08 17:39:28 +0200
commit5619eec808bdb9066c5e26b41956fc4534e103fa (patch)
treed4d48a7b4eb53e829f46a3b75193235f4eacd64b /mppa_k1c/abstractbb
parent5e06ed3a94dcd7f46b3e087e72e725579d3dd765 (diff)
downloadcompcert-kvx-5619eec808bdb9066c5e26b41956fc4534e103fa.tar.gz
compcert-kvx-5619eec808bdb9066c5e26b41956fc4534e103fa.zip
moving iandb from ImpCore to ImpPrelude
Diffstat (limited to 'mppa_k1c/abstractbb')
-rw-r--r--mppa_k1c/abstractbb/Impure/ImpCore.v9
-rw-r--r--mppa_k1c/abstractbb/Impure/ImpPrelude.v32
2 files changed, 18 insertions, 23 deletions
diff --git a/mppa_k1c/abstractbb/Impure/ImpCore.v b/mppa_k1c/abstractbb/Impure/ImpCore.v
index 9745e35c..55e67608 100644
--- a/mppa_k1c/abstractbb/Impure/ImpCore.v
+++ b/mppa_k1c/abstractbb/Impure/ImpCore.v
@@ -185,11 +185,4 @@ Ltac wlp_xsimplify hint :=
Create HintDb wlp discriminated.
-Ltac wlp_simplify := wlp_xsimplify ltac:(intuition eauto with wlp).
-
-(* impure lazy andb of booleans *)
-Definition iandb (k1 k2: ??bool): ?? bool :=
- DO r1 <~ k1 ;;
- if r1 then k2 else RET false.
-
-Extraction Inline iandb. (* Juste pour l'efficacité à l'extraction ! *) \ No newline at end of file
+Ltac wlp_simplify := wlp_xsimplify ltac:(intuition eauto with wlp). \ No newline at end of file
diff --git a/mppa_k1c/abstractbb/Impure/ImpPrelude.v b/mppa_k1c/abstractbb/Impure/ImpPrelude.v
index 8d904be6..0efa042c 100644
--- a/mppa_k1c/abstractbb/Impure/ImpPrelude.v
+++ b/mppa_k1c/abstractbb/Impure/ImpPrelude.v
@@ -6,10 +6,23 @@ Require Import BinNums.
Require Export ImpCore.
Require Export PArith.
+
+Import Notations.
+Local Open Scope impure.
+
+(** Impure lazy andb of booleans *)
+Definition iandb (k1 k2: ??bool): ?? bool :=
+ DO r1 <~ k1 ;;
+ if r1 then k2 else RET false.
+
+Extraction Inline iandb. (* Juste pour l'efficacité à l'extraction ! *)
+
+(** Strings for pretty-printing *)
+
Axiom caml_string: Type.
Extract Constant caml_string => "string".
-(** New line *)
+(* New line *)
Definition nl: string := String (ascii_of_pos 10%positive) EmptyString.
Inductive pstring: Type :=
@@ -25,9 +38,6 @@ Notation "x +; y" := (Concat x y)
(** Coq references *)
-Import Notations.
-Local Open Scope impure.
-
Record cref {A} := {
set: A -> ?? unit;
get: unit -> ?? A
@@ -52,20 +62,15 @@ Extract Constant count_logger => "(fun () -> let count = ref 0 in { log_insert =
(** Axioms of Physical equality *)
-Module Type PhysEq.
-
Axiom phys_eq: forall {A}, A -> A -> ?? bool.
Axiom phys_eq_correct: forall A (x y:A), WHEN phys_eq x y ~> b THEN b=true -> x=y.
-End PhysEq.
-
-
(* We only check here that above axioms are not trivially inconsistent...
(but this does not prove the correctness of the extraction directive below).
*)
-Module PhysEqModel: PhysEq.
+Module PhysEqModel.
Definition phys_eq {A} (x y: A) := ret false.
@@ -76,16 +81,13 @@ Qed.
End PhysEqModel.
-
-Export PhysEqModel.
-
-Extract Constant phys_eq => "(==)".
+Extract Inlined Constant phys_eq => "(==)".
Hint Resolve phys_eq_correct: wlp.
Axiom struct_eq: forall {A}, A -> A -> ?? bool.
Axiom struct_eq_correct: forall A (x y:A), WHEN struct_eq x y ~> b THEN if b then x=y else x<>y.
-Extract Constant struct_eq => "(=)".
+Extract Inlined Constant struct_eq => "(=)".
Hint Resolve struct_eq_correct: wlp.