Require Import Relation_Operators.
Require Import Sorted.
Require Import Coqlib.
Require Import Maps.
Require Import Utils.
Require Import SSAfastliveprecomputeRT.
Require Import SSAfastliveprecomputeTT.
Require Import SSAfastliveprecomputeTTproof.
Local Open Scope positive_scope.
Export Definitions.
Lemma star_trans_eq :
forall A (
R1 R2:
A->
A->
Prop),
(
forall i j,
R1 i j ->
R2**
i j) ->
forall i j,
R1**
i j ->
R2**
i j.
Proof.
induction 2.
eauto.
constructor 2.
econstructor 3; eassumption.
Qed.
Theorem precompute_t_from_t_up_correct :
forall (
dom_pre :
node ->
Z) (
pre :
node ->
positive)
(
t :
PTree.t (
list (
node *
Z))) (
back :
list (
node *
node))
(
dom_pre_inj :
forall (
u v :
node),
t !
u <>
None \/
In u (
map snd back) ->
t !
v <>
None \/
In v (
map snd back) ->
dom_pre u =
dom_pre v ->
u =
v)
(
t_dom_pre :
forall (
u :
node)
set,
t !
u =
Some set ->
Forall (
fun '(
u,
n) =>
n =
dom_pre u)
set)
(
t_sorted :
forall (
u :
node)
set,
t !
u =
Some set ->
Sorted (
fun '(
_,
n1) '(
_,
n2) =>
n1 <
n2)%
Z set)
(
t_pre :
forall u v,
t_linked'
t u v ->
pre v <
pre u)
(
t_in_back :
forall u v,
t_linked'
t u v ->
In v (
map snd back))
(
pre_inj :
forall u v,
In u (
map snd back) ->
In v (
map snd back) ->
pre u =
pre v ->
u =
v)
(
u :
node) (
u_in_t :
t !
u <>
None)
v,
t_linked (
precompute_t_from_t_up dom_pre pre t back)
u v
<->
clos_refl_trans _ (
t_linked'
t)
u v.
Proof.
Theorem precompute_t_from_t_up_black :
forall dom_pre pre t back u,
t !
u <>
None ->
(
precompute_t_from_t_up dom_pre pre t back) !
u <>
None.
Proof.
Theorem precompute_t_from_t_up_black_2 :
forall dom_pre pre t back u,
(
precompute_t_from_t_up dom_pre pre t back) !
u <>
None ->
t !
u =
None ->
In u (
map snd back).
Proof.
Theorem precompute_t_from_t_up_sorted :
forall dom_pre pre t back
(
t_dom_pre :
forall u set,
t !
u =
Some set ->
Forall (
fun '(
u,
n) =>
n =
dom_pre u)
set)
(
t_sorted :
forall u set,
t !
u =
Some set ->
Sorted (
fun '(
_,
n1) '(
_,
n2) =>
n1 <
n2)%
Z set)
u set,
(
precompute_t_from_t_up dom_pre pre t back) !
u =
Some set ->
Sorted (
fun u v =>
dom_pre u <
dom_pre v)%
Z set.
Proof.