Commit 758ad9f5 authored by Ralf Jung's avatar Ralf Jung

write an interface to world_prop, and make iris_core (assertion logic + world...

write an interface to world_prop, and make iris_core (assertion logic + world satisfaction) work with it
parent 3ecc3dc6
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# #
# This Makefile was generated by the command line : # This Makefile was generated by the command line :
# coq_makefile lib/ModuRes -R lib/ModuRes ModuRes core_lang.v iris.v lang.v masks.v world_prop.v -o Makefile # coq_makefile lib/ModuRes -R lib/ModuRes ModuRes core_lang.v iris.v iris_core.v lang.v masks.v world_prop.v world_prop_old.v world_prop_sig.v -o Makefile
# #
.DEFAULT_GOAL := all .DEFAULT_GOAL := all
...@@ -82,9 +82,12 @@ endif ...@@ -82,9 +82,12 @@ endif
VFILES:=core_lang.v\ VFILES:=core_lang.v\
iris.v\ iris.v\
# iris_core.v\
lang.v\ lang.v\
masks.v\ masks.v\
world_prop.v world_prop.v\
world_prop_old.v\
world_prop_sig.v
-include $(addsuffix .d,$(VFILES)) -include $(addsuffix .d,$(VFILES))
.SECONDARY: $(addsuffix .d,$(VFILES)) .SECONDARY: $(addsuffix .d,$(VFILES))
...@@ -108,7 +111,7 @@ endif ...@@ -108,7 +111,7 @@ endif
# # # #
####################################### #######################################
all: ./lib/ModuRes $(VOFILES) all: $(VOFILES) ./lib/ModuRes
spec: $(VIFILES) spec: $(VIFILES)
......
...@@ -25,22 +25,7 @@ Module Iris (RL : PCM_T) (C : CORE_LANG). ...@@ -25,22 +25,7 @@ Module Iris (RL : PCM_T) (C : CORE_LANG).
Instance Props_BI : ComplBI Props | 0 := _. Instance Props_BI : ComplBI Props | 0 := _.
Instance Props_Later : Later Props | 0 := _. Instance Props_Later : Later Props | 0 := _.
(* Benchmark: How large is thid type? *)
Section Benchmark.
Local Open Scope mask_scope.
Local Open Scope pcm_scope.
Local Open Scope bi_scope.
Local Open Scope lang_scope.
Local Instance _bench_expr_type : Setoid expr := discreteType.
Local Instance _bench_expr_metr : metric expr := discreteMetric.
Local Instance _bench_cmetr : cmetric expr := discreteCMetric.
Set Printing All. Set Printing All.
Check (expr -n> (value -n> Props) -n> Props).
Check ((expr -n> (value -n> Props) -n> Props) -n> expr -n> (value -n> Props) -n> Props).
End Benchmark.
(** And now we're ready to build the IRIS-specific connectives! *) (** And now we're ready to build the IRIS-specific connectives! *)
......
This diff is collapsed.
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
Require Import ModuRes.PreoMet ModuRes.MetricRec ModuRes.CBUltInst. Require Import ModuRes.PreoMet ModuRes.MetricRec ModuRes.CBUltInst.
Require Import ModuRes.Finmap ModuRes.Constr. Require Import ModuRes.Finmap ModuRes.Constr.
Require Import ModuRes.PCM ModuRes.UPred ModuRes.BI. Require Import ModuRes.PCM ModuRes.UPred ModuRes.BI.
Require Import world_prop_sig.
Module WorldProp (Res : PCM_T). Module WorldProp (Res : PCM_T) <: WORLD_PROP Res.
(** The construction is parametric in the monoid we choose *) (** The construction is parametric in the monoid we choose *)
Import Res. Import Res.
...@@ -72,6 +73,7 @@ Module WorldProp (Res : PCM_T). ...@@ -72,6 +73,7 @@ Module WorldProp (Res : PCM_T).
Definition Props := FProp PreProp. Definition Props := FProp PreProp.
Definition Wld := (nat -f> PreProp). Definition Wld := (nat -f> PreProp).
(* Establish the isomorphism (FIXME: do it only once...) *)
Definition ı : PreProp -t> halve (cmfromType Props) := Unfold. Definition ı : PreProp -t> halve (cmfromType Props) := Unfold.
Definition ı' : halve (cmfromType Props) -t> PreProp := Fold. Definition ı' : halve (cmfromType Props) -t> PreProp := Fold.
...@@ -80,12 +82,8 @@ Module WorldProp (Res : PCM_T). ...@@ -80,12 +82,8 @@ Module WorldProp (Res : PCM_T).
Lemma isoR T : ı (ı' T) == T. Lemma isoR T : ı (ı' T) == T.
Proof. apply (UF_id T). Qed. Proof. apply (UF_id T). Qed.
Set Printing All. (* Define an order on PreProp. *)
(* PreProp has an equivalence and a complete metric. It also has a preorder that fits to everything else. *) Instance PProp_preo: preoType PreProp := disc_preo PreProp.
Instance PProp_ty : Setoid PreProp := _.
Instance PProp_m : metric PreProp := _.
Instance PProp_cm : cmetric PreProp := _.
Instance PProp_preo : preoType PreProp := disc_preo PreProp.
Instance PProp_pcm : pcmType PreProp := disc_pcm PreProp. Instance PProp_pcm : pcmType PreProp := disc_pcm PreProp.
Instance PProp_ext : extensible PreProp := disc_ext PreProp. Instance PProp_ext : extensible PreProp := disc_ext PreProp.
......
(* For some reason, the order matters. We cannot import Constr last. *) (* For some reason, the order matters. We cannot import Constr last. *)
Require Import ModuRes.Finmap ModuRes.Constr ModuRes.PCM ModuRes.UPred ModuRes.BI ModuRes.PreoMet. Require Import ModuRes.Finmap ModuRes.Constr ModuRes.MetricRec.
Require Import ModuRes.PCM ModuRes.UPred ModuRes.BI ModuRes.PreoMet.
Module Type WorldPropSig (Res : PCM_T). Module Type WORLD_PROP (Res : PCM_T).
(** The construction is parametric in the monoid we choose *)
Import Res. Import Res.
(* The functor is fixed *) (* PreProp: The solution to the recursive equation. Equipped with a discrete order *)
Section Definitions. Parameter PreProp : cmtyp.
(** We'll be working with complete metric spaces, so whenever Instance PProp_preo: preoType PreProp := disc_preo PreProp.
something needs an additional preorder, we'll just take a Instance PProp_pcm : pcmType PreProp := disc_pcm PreProp.
discrete one. *) Instance PProp_ext : extensible PreProp := disc_ext PreProp.
Local Instance pt_disc P `{cmetric P} : preoType P | 2000 := disc_preo P.
Local Instance pcm_disc P `{cmetric P} : pcmType P | 2000 := disc_pcm P.
Definition FProp P `{cmP : cmetric P} :=
(nat -f> P) -m> UPred res.
End Definitions.
Parameter PreProp : Type.
Parameter PrePropS : Setoid PreProp.
Parameter PrePropM : metric PreProp.
Parameter PrePropCM: cmetric PreProp.
Definition Props := FProp PreProp. (* Defines Worlds, Propositions *)
Parameter PropS : Setoid Props. Definition Wld := nat -f> PreProp.
Parameter PropM : metric Props. Definition Props := Wld -m> UPred res.
Parameter PropCM : cmetric Props.
Definition Wld := (nat -f> PreProp).
Parameter ı : PreProp -> halve (cmfromType Props).
Parameter ı' : halve (cmfromType Props) -> PreProp.
(* Establish the recursion isomorphism *)
Parameter ı : PreProp -t> halve (cmfromType Props).
Parameter ı' : halve (cmfromType Props) -t> PreProp.
Axiom iso : forall P, ı' (ı P) == P. Axiom iso : forall P, ı' (ı P) == P.
Axiom isoR : forall T, ı (ı' T) == T. Axiom isoR : forall T, ı (ı' T) == T.
(*Parameter PProp_preo : preoType PreProp. (* Define all the things on Props, so they have names - this shortens the terms later *)
Parameter PProp_pcm : pcmType PreProp. Instance Props_ty : Setoid Props := _.
Parameter PProp_ext : extensible PreProp.*) Instance Props_m : metric Props := _.
Instance Props_cm : cmetric Props := _.
End WorldPropSig. Instance Props_preo : preoType Props := _.
Instance Props_pcm : pcmType Props := _.
End WORLD_PROP.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment