Memory safety


Require Import Vbase Varith.
Require Import Relations Classical ClassicalDescription.
Require Import List Permutation Vlistbase Vlist extralib.
Require Import c11 fslassn fslmodel fslassnlemmas.
Require Import fslhmap stepback.

Set Implicit Arguments.

Lemma alloc_always_before:
   lab sb rf mo hmap V
    (ACYCLIC: IrreflexiveHBuRF sb rf)
    (CONS_RF: ConsistentRF_basic lab sb rf mo)
    (HC: hist_closed sb rf V)
    (VALID: hmap_valids lab sb rf hmap V)
    edge (EV: edge_valid lab sb rf edge) (IN: In (hb_fst edge) V)
    hf (MAP: hmap edge = Hdef hf) l (ALL: hf l HVnone)
    lbl (LAB: HVlabeled (hf l) lbl),
   a, << ALLOC: lab a = Aalloc l >>
    ((<< LBL: lbl = HLnormal >> << HB: clos_refl_trans _ (happens_before lab sb rf mo) a (hb_fst edge) >>)
     (<< LBL: lbl = HLtriangle >> b, << REL: is_release_fence (lab b) >>
                                               << HB: happens_before lab sb rf mo a b >>
                                               << SB: clos_refl_trans _ sb b (hb_fst edge) >>)
     (<< LBL: lbl = HLnabla >> << SB: ¬ is_rf edge >>
                                   b c, << REL: is_release_write (lab b) >>
                                                 << HB: happens_before lab sb rf mo a b >>
                                                 << RF: rf c = Some b >>
                                                 << SB: clos_refl_trans _ sb c (hb_fst edge) >>)
     (<< LBL: lbl = HLnabla >> << SB: ¬ is_rf edge >>
                                   b c d, << REL: is_release_fence (lab b) >>
                                                   << HB: happens_before lab sb rf mo a b >>
                                                   << SB1: clos_trans _ sb b c >>
                                                   << RF: rf d = Some c >>
                                                   << SB2: clos_refl_trans _ sb d (hb_fst edge) >>)
     (<< LBL: lbl = HLnabla >> << RF: ¬ is_sb edge >> << REL: is_release_write (lab (hb_fst edge)) >>
                                  << HB: happens_before lab sb rf mo a (hb_fst edge) >>)
     (<< LBL: lbl = HLnabla >> << RF: ¬ is_sb edge >> b, << REL: is_release_fence (lab b) >>
                                                                      << HB: happens_before lab sb rf mo a b >>
                                                                      << SB: clos_trans _ sb b (hb_fst edge) >>)).
Theorem valid_implies_mem_safe :
   lab sb rf mo hmap V
    (ACYCLIC: IrreflexiveHBuRF sb rf)
    (CONS_RF: ConsistentRF_basic lab sb rf mo)
    (HC: hist_closed sb rf V)
    (VALID: hmap_valids lab sb rf hmap V),
  mem_safe V lab sb rf mo.

This page has been generated by coqdoc