You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In module merge, we prove sth like this: ctx [ModTuple mdl mdr] >= ctx[mdl ++ mdr]
Here, source's Midx.ts are ctx ++ mdl while target's are ctx ++ mdl ++ mdr.
Therefore, source can have less undefined behavior in linking.
To solve this nicely, we can put dummy module that only has Midx.t but nothing else.
Then, we can prove something like this: ctx [ModTuple mdl mdr ++ dummy mdr] >= ctx[mdl ++ mdr].
Problem
In order to define such dummy module, we should have identity element of Sk.t.
(i.e. we need sth like this: forall sk, link sk Sk.empty = Some sk)
However, CompCert's PTree does not support intentional equality, so we can't get such identity element.
Solution
Extend PTree theorems.
Use some equivalence class rather than leibniz equality --> it is an expensive solution...
Do not link Sk.t, instead link prog_defmap Sk.t whose identity element is easily PTree.empty
Put dummy_midxs: list Midx.t in Mod.t, just to evoke UB
Just quantify mdr.(midx) \notin ctx
The text was updated successfully, but these errors were encountered:
Let x :=
let t0 := (PTree.set 1%positive 10 (PTree.set 3%positive 30 (PTree.set 2%positive 20 (@PTree.empty _)))) in
let t1 := PTree.set 2%positive 20 (PTree.set 5%positive 50 (PTree.remove 2%positive t0)) in
t1
.
Let p := Eval compute in x.
Let q := Eval compute in (PTree_Properties.of_list (PTree.elements x)).
Print p.
Print q.
Goal p = q. refl. Qed.
Use case
In module merge, we prove sth like this:
ctx [ModTuple mdl mdr] >= ctx[mdl ++ mdr]
Here, source's
Midx.t
s arectx ++ mdl
while target's arectx ++ mdl ++ mdr
.Therefore, source can have less undefined behavior in linking.
To solve this nicely, we can put dummy module that only has
Midx.t
but nothing else.Then, we can prove something like this:
ctx [ModTuple mdl mdr ++ dummy mdr] >= ctx[mdl ++ mdr]
.Problem
In order to define such dummy module, we should have identity element of
Sk.t
.(i.e. we need sth like this:
forall sk, link sk Sk.empty = Some sk
)However, CompCert's
PTree
does not support intentional equality, so we can't get such identity element.Solution
Sk.t
, instead linkprog_defmap Sk.t
whose identity element is easily PTree.emptydummy_midxs: list Midx.t
in Mod.t, just to evoke UBmdr.(midx) \notin ctx
The text was updated successfully, but these errors were encountered: