(* This program is free software; you can redistribute it and/or      *)
(* modify it under the terms of the GNU Lesser General Public License *)
(* as published by the Free Software Foundation; either version 2.1   *)
(* of the License, or (at your option) any later version.             *)
(*                                                                    *)
(* This program is distributed in the hope that it will be useful,    *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of     *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      *)
(* GNU General Public License for more details.                       *)
(*                                                                    *)
(* You should have received a copy of the GNU Lesser General Public   *)
(* License along with this program; if not, write to the Free         *)
(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *)
(* 02110-1301 USA                                                     *)
(* Computation Tree Logic (CTL) and Timed Computation Tree Logic (TCTL) *)
Set Implicit Arguments.
Unset Strict Implicit.
(****************************************************************************)
(* Hypothesis: type Label with label Tick                                   *)
(* Inductive Label : Set := L1 : Label | ... | Ln : Label | Tick : Label.   *)
(****************************************************************************)
Section TemporalOperators_Ind.
(* Temporal operators with inductive types: definitions and properties *)
Variable S : Set.                (* States *)
Variable tr : S -> Label -> S -> Prop.  (* Transitions *)
(* Reachable states form "Sini" with transitions "tr" *)
Inductive RState (Sini : S) : S -> Prop :=
| rsIni : RState Sini Sini
| rsNext :
forall (s1 s2 : S) (l : Label),
RState Sini s1 -> tr s1 l s2 -> RState Sini s2.
(* Reachable states form "Sini" with transitions "tr" in time units *)
Inductive RState_T (Sini : S) : S -> Instant -> Prop :=
| rsIni_T : RState_T Sini Sini time0
| rsTime_T :
forall (s1 s2 : S) (t : Instant),
RState_T Sini s1 t -> tr s1 Tick s2 -> RState_T Sini s2 (Inc t)
| rsNoTime_T :
forall (s1 s2 : S) (l : Label) (t : Instant),
RState_T Sini s1 t -> l <> Tick -> tr s1 l s2 -> RState_T Sini s2 t.
(**************************************************************************)
(*                       Invariants and Reachability                      *)
(**************************************************************************)
(* Init => FA[] P *)
Definition ForAll (Sini : S) (P : S -> Prop) :=
forall s : S, RState Sini s -> P s.
(* Init => FA[](bound t) P *)
Definition ForAll_T (Sini : S) (P : S -> Prop) (bound : Instant -> Prop) :=
forall (s : S) (t : Instant), bound t -> RState_T Sini s t -> P s.
(* Init => EX<> P *)
Inductive Exists (Sini : S) (P : S -> Prop) : Prop :=
exists_ : forall s : S, RState Sini s -> P s -> Exists Sini P.
(* Init => EX<>(bound t) P *)
Inductive Exists_T (Sini : S) (P : S -> Prop) (bound : Instant -> Prop) :
Prop :=
exists_T :
forall (s : S) (t : Instant),
bound t -> RState_T Sini s t -> P s -> Exists_T Sini P bound.
(**************************************************************************)
(*                            Some Properties                             *)
(**************************************************************************)

Theorem Conj :
forall (Sini : S) (P1 P2 : S -> Prop),
ForAll Sini P1 -> ForAll Sini P2 -> ForAll Sini (fun s : S => P1 s /\ P2 s).