336336
337337(* CoqArt's decomposition lemma (or Chlipala's [frob]) for [colist]s.
338338 For CoqArt's decomposition lemma, see CoqArt's chapter on coinductives:
339- https://www.labri.fr/perso/casteran/CoqArt/chapter13.pdf
339+ https://www.labri.fr/perso/casteran/CoqArt/chapter13.pdf
340340 For Chlipala's [frob], see http://adam.chlipala.net/cpdt/html/Cpdt.Coinductive.html
341341 An identity function that pattern matches on the [colist] and reconstructs the original.
342342 It induces a reduction context that allows guardedness checks to succeed. *)
@@ -815,30 +815,30 @@ Qed.
815815
816816(* A relation between two game states
817817 where the game state [y] occurs after the game state [x]. *)
818- Definition step
818+ Definition costep
819819 {A : Type }
820820 (next : forall (a : A), colist A)
821821 (x y : A) : Prop :=
822822 In_colist y (next x).
823823
824- (* There is a sequence of steps from x to y in zero or more steps ,
824+ (* There is a sequence of costeps from x to y in zero or more costeps ,
825825 where a one-step edge is "y appears in [next] x". *)
826- Definition reachable
826+ Definition coreachable
827827 {A : Type }
828828 (next : forall (a : A), colist A) : A -> A -> Prop :=
829- clos_refl_trans A (step next).
829+ clos_refl_trans A (costep next).
830830
831- (* Same as [reachable ], but the transitive closure is right-stepping . *)
832- Definition reachable_n1
831+ (* Same as [coreachable ], but the transitive closure is right-costepping . *)
832+ Definition coreachable_n1
833833 {A : Type }
834834 (next : forall (a : A), colist A) : A -> A -> Prop :=
835- clos_refl_trans_n1 A (step next).
835+ clos_refl_trans_n1 A (costep next).
836836
837- (* Same as [reachable ], but the transitive closure is left-stepping . *)
838- Definition reachable_1n
837+ (* Same as [coreachable ], but the transitive closure is left-costepping . *)
838+ Definition coreachable_1n
839839 {A : Type }
840840 (next : forall (a : A), colist A) : A -> A -> Prop :=
841- clos_refl_trans_1n A (step next).
841+ clos_refl_trans_1n A (costep next).
842842
843843(* An explicit unfolding of a call to [unfold_cotree] is bisimilar to the original. *)
844844Lemma unfold_cotree_unwrap :
@@ -856,15 +856,15 @@ Proof.
856856 reflexivity.
857857Qed .
858858
859- (* If [mid] is [reachable ] from [init],
860- then every node produced by [unfold_cotree next mid] is [reachable ] from [mid]. *)
859+ (* If [mid] is [coreachable ] from [init],
860+ then every node produced by [unfold_cotree next mid] is [coreachable ] from [mid]. *)
861861Lemma unfold_cotree_sound_aux :
862862 forall
863863 {A : Type }
864864 (next : A -> colist A),
865865 forall (init mid : A),
866- reachable next init mid ->
867- Forall_conodes (reachable next init) (unfold_cotree next mid).
866+ coreachable next init mid ->
867+ Forall_conodes (coreachable next init) (unfold_cotree next mid).
868868Proof .
869869 intros A next.
870870 cofix C1.
@@ -881,7 +881,7 @@ Proof.
881881 rewrite colist_decompose_eq; simpl.
882882 constructor.
883883 eapply C1.
884- eapply rt_trans; [eapply pf | eapply rt_step; unfold step ; rewrite eq; eleft; auto].
884+ eapply rt_trans; [eapply pf | eapply rt_step; unfold costep ; rewrite eq; eleft; auto].
885885 assert (H : coincl c (next mid)).
886886 { rewrite eq. eapply coincl_tl; eapply coincl_refl. }
887887 clear eq.
@@ -902,31 +902,31 @@ Proof.
902902Qed .
903903
904904(* If a state is the unfolded game tree,
905- then that state must be [reachable ] in a game from the initial state. *)
905+ then that state must be [coreachable ] in a game from the initial state. *)
906906Theorem unfold_cotree_sound :
907907 forall
908908 {A : Type }
909909 (next : forall (a : A), colist A)
910910 (init : A),
911911 forall (a : A),
912912 In_cotree a (unfold_cotree next init) ->
913- reachable next init a.
913+ coreachable next init a.
914914Proof .
915915 intros A next init.
916916 rewrite <- Forall_conodes_In_cotree.
917917 eapply (unfold_cotree_sound_aux next init init).
918918 eapply rt_refl.
919919Qed .
920920
921- (* Any game state left-steppingly reachable from the initial state
921+ (* Any game state left-steppingly coreachable from the initial state
922922 must be in the unfolded game tree. *)
923923Theorem unfold_cotree_complete_1n :
924924 forall
925925 {A : Type }
926926 (next : forall (a : A), colist A)
927927 (init : A),
928928 forall (a : A),
929- reachable_1n next init a ->
929+ coreachable_1n next init a ->
930930 In_cotree a (unfold_cotree next init).
931931Proof .
932932 intros A next init a ch.
@@ -942,20 +942,20 @@ Proof.
942942 { rewrite <- unfold_cotree_unwrap in *; eauto. }
943943Qed .
944944
945- (* Any game state [reachable ] from the initial state
945+ (* Any game state [coreachable ] from the initial state
946946 must be in the unfolded game tree. *)
947947Theorem unfold_cotree_complete :
948948 forall
949949 {A : Type }
950950 (next : forall (a : A), colist A)
951951 (init : A),
952952 forall (a : A),
953- reachable next init a ->
953+ coreachable next init a ->
954954 In_cotree a (unfold_cotree next init).
955955Proof .
956956 intros A next init a.
957957 pose proof (unfold_cotree_complete_1n next init a).
958- unfold reachable, reachable_1n in *.
958+ unfold coreachable, coreachable_1n in *.
959959 rewrite <- clos_rt_rt1n_iff in *; auto.
960960Qed .
961961
0 commit comments