Library liblayers.simrel.AbstractData
Require Export compcert.lib.Coqlib.
Require Export compcert.lib.Integers.
Require Export compcert.common.Values.
Require Export compcert.common.Memdata.
Require Export compcert.common.Memtype.
Require Export compcertx.common.MemoryX.
Require Export liblayers.lib.Lens.
Require Export liblayers.lib.Lift.
Require Import liblayers.compcertx.CompcertStructures.
Require Import liblayers.compcertx.LiftMemX.
Require Export compcert.lib.Integers.
Require Export compcert.common.Values.
Require Export compcert.common.Memdata.
Require Export compcert.common.Memtype.
Require Export compcertx.common.MemoryX.
Require Export liblayers.lib.Lens.
Require Export liblayers.lib.Lift.
Require Import liblayers.compcertx.CompcertStructures.
Require Import liblayers.compcertx.LiftMemX.
Types of abstract data
Class AbstractDataOps data :=
{
init_data : data;
data_inv: data → Prop;
data_inject (ι: meminj): relation data
}.
Class AbstractData data `{data_ops: AbstractDataOps data}: Prop :=
{
init_data_inv:
data_inv init_data;
init_data_inject:
Monotonic init_data (data_inject (Mem.flat_inj glob_threshold));
May need when Mem.inject uses data_inject <
data_inject_compose ι ι' d1 d2 d3:
data_inject ι d1 d2 ->
data_inject ι' d2 d3 ->
data_inject (compose_meminj ι ι') d1 d3;
>
By contrast this is already used for inject-neutral properties:
data_inject_incr :>
Monotonic data_inject (inject_incr ++> subrel)
}.
Global Instance data_inject_incr_params:
Params (@data_inject) 3.
Monotonic data_inject (inject_incr ++> subrel)
}.
Global Instance data_inject_incr_params:
Params (@data_inject) 3.
Once we have this extra information, we can package it into a
layerdata object. From then on, you should only use the packaged
version (including as a type through the ldata_type coercion).
You should use the underlying type directly.
Record layerdata :=
ldata {
ldata_type :> Type;
ldata_ops : AbstractDataOps ldata_type;
ldata_prf : AbstractData ldata_type
}.
Global Arguments ldata _ {_ _}.
Existing Instance ldata_ops.
Existing Instance ldata_prf.