(** One or several transitions.  Also known as the transitive closure. *)
Inductive plus (ge: genv): state -> trace -> state -> Prop :=
| plus_left: forall s1 t1 s2 t2 s3 t,
step ge s1 t1 s2 -> star ge s2 t2 s3 -> t = t1 ** t2 ->
plus ge s1 t s3.

(* Specifications: *)
Lemma plus_one:
forall ge s1 t s2,
step ge s1 t s2 -> plus ge s1 t s2.
Lemma plus_two:
forall ge s1 t1 s2 t2 s3 t,
step ge s1 t1 s2 -> step ge s2 t2 s3 -> t = t1 ** t2 ->
plus ge s1 t s3.
Lemma plus_three:
forall ge s1 t1 s2 t2 s3 t3 s4 t,
step ge s1 t1 s2 -> step ge s2 t2 s3 -> step ge s3 t3 s4 -> t = t1 ** t2 ** t3 ->
plus ge s1 t s4.
Lemma plus_four:
forall ge s1 t1 s2 t2 s3 t3 s4 t4 s5 t,
step ge s1 t1 s2 -> step ge s2 t2 s3 ->
step ge s3 t3 s4 -> step ge s4 t4 s5 -> t = t1 ** t2 ** t3 ** t4 ->
plus ge s1 t s5.
Lemma plus_star:
forall ge s1 t s2, plus ge s1 t s2 -> star ge s1 t s2.
Lemma plus_right:
forall ge s1 t1 s2 t2 s3 t,
star ge s1 t1 s2 -> step ge s2 t2 s3 -> t = t1 ** t2 ->
plus ge s1 t s3.
Lemma plus_left':
forall ge s1 t1 s2 t2 s3 t,
step ge s1 t1 s2 -> plus ge s2 t2 s3 -> t = t1 ** t2 ->
plus ge s1 t s3.
Lemma plus_right':
forall ge s1 t1 s2 t2 s3 t,
plus ge s1 t1 s2 -> step ge s2 t2 s3 -> t = t1 ** t2 ->
plus ge s1 t s3.
Lemma plus_star_trans:
forall ge s1 t1 s2 t2 s3 t,
plus ge s1 t1 s2 -> star ge s2 t2 s3 -> t = t1 ** t2 -> plus ge s1 t s3.
Lemma star_plus_trans:
forall ge s1 t1 s2 t2 s3 t,
star ge s1 t1 s2 -> plus ge s2 t2 s3 -> t = t1 ** t2 -> plus ge s1 t s3.
Lemma plus_trans:
forall ge s1 t1 s2 t2 s3 t,
plus ge s1 t1 s2 -> plus ge s2 t2 s3 -> t = t1 ** t2 -> plus ge s1 t s3.
Lemma plus_inv:
forall ge s1 t s2,
plus ge s1 t s2 ->
step ge s1 t s2 \/ exists s', exists t1, exists t2, step ge s1 t1 s' /\ plus ge s' t2 s2 /\ t = t1 ** t2.
Lemma star_inv:
forall ge s1 t s2,
star ge s1 t s2 ->
(s2 = s1 /\ t = E0) \/ plus ge s1 t s2.
Lemma plus_ind2:
forall ge (P: state -> trace -> state -> Prop),
(forall s1 t s2, step ge s1 t s2 -> P s1 t s2) ->
(forall s1 t1 s2 t2 s3 t,
step ge s1 t1 s2 -> plus ge s2 t2 s3 -> P s2 t2 s3 -> t = t1 ** t2 ->
P s1 t s3) ->
forall s1 t s2, plus ge s1 t s2 -> P s1 t s2.
Lemma plus_E0_ind:
forall ge (P: state -> state -> Prop),
(forall s1 s2 s3, step ge s1 E0 s2 -> star ge s2 E0 s3 -> P s1 s3) ->
forall s1 s2, plus ge s1 E0 s2 -> P s1 s2.