Theory CSP_F

Up to index of Isabelle/HOL/HOL-Complex/CSP/CSP_T/CSP_F

theory CSP_F
imports CSP_F_tactic CSP_T
begin

           (*-------------------------------------------*
            |        CSP-Prover on Isabelle2004         |
            |               December 2004               |
            |               February 2005  (modified)   |
            |                   June 2005  (modified)   |
            |                                           |
            |        CSP-Prover on Isabelle2005         |
            |               November 2005  (modified)   |
            |                                           |
            |        Yoshinao Isobe (AIST JAPAN)        |
            *-------------------------------------------*)

theory CSP_F = CSP_F_tactic + CSP_T:

(*-------------------------------------------------------*
 |                                                       |
 |  The folloing def have already added in CSP_T         |
 |                                                       |
 |   Procfun_def                                         |
 |   ProcX_def                                           |
 |   gSKIPX_def                                          |
 |   gProcX_def                                          |
 |   nohideX_def                                         |
 |                                                       |
 *-------------------------------------------------------*)

(*----------------------------------------------------------------------*
 |                                                                      |
 |  To unfold (resp. fold) syntactic-sugar for Ext_ and Int_pre_choices |
 |  choices, use "unfold csp_prefix_ss_def"                             |
 |                                                                      |
 *----------------------------------------------------------------------*)

(*------------------------------------*
 |                                    |
 |    laws automatically applied      |
 |                                    |
 *------------------------------------*)

(* intro! intro? are automatically applied by "rule".     *)
(* intro! is automatically applied by "rules" and "auto". *)

(* CSP_F_law_basic *)

declare cspF_commut                                  [simp]

(* CSP_F_law_ref *)

declare cspF_Int_choice_right                        [intro!]
declare cspF_Rep_int_choice_right                    [intro!]

(* CSP_F_law_SKIP *)

declare cspF_SKIP_DIV_resolve                        [simp]
lemmas  cspF_SKIP_DIV_resolve_sym                    [simp]
      = cspF_SKIP_DIV_resolve[THEN cspF_sym]

(* CSP_F_law_decompo *)

declare cspF_rm_head                                 [intro!]
declare cspF_decompo                                 [simp]

(* CSP_F_law_dist *)

declare cspF_all_dist                                [simp]
lemmas  cspF_all_dist_sym                            [simp]
      = cspF_all_dist[THEN cspF_sym]

declare cspF_unwind                                  [simp]
lemmas  cspF_unwind_sym                              [simp]
      = cspF_unwind[THEN cspF_sym]

(* CSP_F_law_step *)

declare cspF_step                                    [simp]
lemmas  cspF_step_sym                                [simp]
      = cspF_step[THEN cspF_sym]

(* CSP_F_law_etc *)

declare cspF_choice_IF                               [simp]

end

lemmas cspF_SKIP_DIV_resolve_sym:

  ? x:(Y1 - X1) -> (SKIP |[X1]| Qf1 x) =F SKIP |[X1]| ? :Y1 -> Qf1
  ? x:(Y1 - X1) -> (Pf1 x |[X1]| SKIP) =F ? :Y1 -> Pf1 |[X1]| SKIP
  ? x:(Y1 - X1) -> (DIV |[X1]| Qf1 x) [+] DIV =F DIV |[X1]| ? :Y1 -> Qf1
  ? x:(Y1 - X1) -> (Qf1 x |[X1]| DIV) [+] DIV =F ? :Y1 -> Qf1 |[X1]| DIV
  SKIP =F SKIP [+] DIV
  SKIP =F DIV [+] SKIP
  DIV =F SKIP |[X1]| DIV
  DIV =F DIV |[X1]| SKIP
  SKIP =F SKIP |[X1]| SKIP
  DIV =F DIV |[X1]| DIV
  ? x:(Y1 - X1) -> (Pf1 x |[X1]| SKIP) [+] SKIP =F 
  (? :Y1 -> Pf1 [+] SKIP) |[X1]| SKIP
  ? x:(Y1 - X1) -> (SKIP |[X1]| Pf1 x) [+] SKIP =F 
  SKIP |[X1]| (? :Y1 -> Pf1 [+] SKIP)
  ? x:(Y1 - X1) -> (Pf1 x |[X1]| SKIP) [+] DIV =F 
  (? :Y1 -> Pf1 [+] DIV) |[X1]| SKIP
  ? x:(Y1 - X1) -> (SKIP |[X1]| Pf1 x) [+] DIV =F 
  SKIP |[X1]| (? :Y1 -> Pf1 [+] DIV)
  P1 |[X1]| DIV =F (P1 [+] SKIP) |[X1]| DIV
  DIV |[X1]| P1 =F DIV |[X1]| (P1 [+] SKIP)
  P1 |[X1]| DIV =F (P1 [+] DIV) |[X1]| DIV
  DIV |[X1]| P1 =F DIV |[X1]| (P1 [+] DIV)
  SKIP =F SKIP -- X1
  DIV =F DIV -- X1
  ? x:(Y1 - X1) -> Pf1 x -- X1 [+] DIV |~| ! x:(Y1X1) .. Pf1 x -- X1 =F 
  (? :Y1 -> Pf1 [+] DIV) -- X1
  ? x:(Y1 - X1) -> Pf1 x -- X1 [+] SKIP |~| ! x:(Y1X1) .. Pf1 x -- X1 =F 
  (? :Y1 -> Pf1 [+] SKIP) -- X1
  SKIP =F SKIP [[r1]]
  DIV =F DIV [[r1]]
  P2.0 =F SKIP ;; P2.0
  P2.0 =F P2.0 ;; SKIP
  DIV =F DIV ;; P1
  ? x:X1 -> (Pf1 x ;; Q1) [> Q1 =F (? :X1 -> Pf1 [> SKIP) ;; Q1
  ? x:X1 -> (Pf1 x ;; Q1) [> DIV =F (? :X1 -> Pf1 [> DIV) ;; Q1
  SKIP =F SKIP |. Suc n1
  DIV =F DIV |. n1
  ? x:(X1Y1Z1 ∪ (Y1 - X1) ∪ (Z1 - X1)) 
   -> IF (xX1) THEN Pf1 x |[X1]| Qf1 x 
      ELSE IF (xY1xZ1) 
           THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] SKIP) 
                 |~| (? :Y1 -> Pf1 [+] SKIP) |[X1]| Qf1 x 
           ELSE IF (xY1) THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] SKIP) 
                ELSE (? :Y1 -> Pf1 [+] SKIP) |[X1]| Qf1 x 
   [> (SKIP |[X1]| (? :Z1 -> Qf1 [+] SKIP) 
        |~| (? :Y1 -> Pf1 [+] SKIP) |[X1]| SKIP) 
  =F (? :Y1 -> Pf1 [+] SKIP) |[X1]| (? :Z1 -> Qf1 [+] SKIP)
  ? x:(X1Y1Z1 ∪ (Y1 - X1) ∪ (Z1 - X1)) 
   -> IF (xX1) THEN Pf1 x |[X1]| Qf1 x 
      ELSE IF (xY1xZ1) 
           THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] DIV) 
                 |~| (? :Y1 -> Pf1 [+] DIV) |[X1]| Qf1 x 
           ELSE IF (xY1) THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] DIV) 
                ELSE (? :Y1 -> Pf1 [+] DIV) |[X1]| Qf1 x 
   [> (DIV |[X1]| (? :Z1 -> Qf1 [+] DIV) |~| (? :Y1 -> Pf1 [+] DIV) |[X1]| DIV) 
  =F (? :Y1 -> Pf1 [+] DIV) |[X1]| (? :Z1 -> Qf1 [+] DIV)
  ? x:(X1Y1Z1 ∪ (Y1 - X1) ∪ (Z1 - X1)) 
   -> IF (xX1) THEN Pf1 x |[X1]| Qf1 x 
      ELSE IF (xY1xZ1) 
           THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] DIV) 
                 |~| (? :Y1 -> Pf1 [+] SKIP) |[X1]| Qf1 x 
           ELSE IF (xY1) THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] DIV) 
                ELSE (? :Y1 -> Pf1 [+] SKIP) |[X1]| Qf1 x 
   [> (SKIP |[X1]| (? :Z1 -> Qf1 [+] DIV) |~| (? :Y1 -> Pf1 [+] SKIP) |[X1]| DIV) 
  =F (? :Y1 -> Pf1 [+] SKIP) |[X1]| (? :Z1 -> Qf1 [+] DIV)
  ? x:(X1Y1Z1 ∪ (Y1 - X1) ∪ (Z1 - X1)) 
   -> IF (xX1) THEN Pf1 x |[X1]| Qf1 x 
      ELSE IF (xY1xZ1) 
           THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] SKIP) 
                 |~| (? :Y1 -> Pf1 [+] DIV) |[X1]| Qf1 x 
           ELSE IF (xY1) THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] SKIP) 
                ELSE (? :Y1 -> Pf1 [+] DIV) |[X1]| Qf1 x 
   [> (DIV |[X1]| (? :Z1 -> Qf1 [+] SKIP) |~| (? :Y1 -> Pf1 [+] DIV) |[X1]| SKIP) 
  =F (? :Y1 -> Pf1 [+] DIV) |[X1]| (? :Z1 -> Qf1 [+] SKIP)
  ? x:(X1Y1Z1 ∪ (Y1 - X1) ∪ (Z1 - X1)) 
   -> IF (xX1) THEN Pf1 x |[X1]| Qf1 x 
      ELSE IF (xY1xZ1) 
           THEN Pf1 x |[X1]| ? :Z1 -> Qf1 
                 |~| (? :Y1 -> Pf1 [+] SKIP) |[X1]| Qf1 x 
           ELSE IF (xY1) THEN Pf1 x |[X1]| ? :Z1 -> Qf1 
                ELSE (? :Y1 -> Pf1 [+] SKIP) |[X1]| Qf1 x 
   [> SKIP |[X1]| ? :Z1 -> Qf1 
  =F (? :Y1 -> Pf1 [+] SKIP) |[X1]| ? :Z1 -> Qf1
  ? x:(X1Y1Z1 ∪ (Y1 - X1) ∪ (Z1 - X1)) 
   -> IF (xX1) THEN Pf1 x |[X1]| Qf1 x 
      ELSE IF (xY1xZ1) 
           THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] SKIP) 
                 |~| ? :Y1 -> Pf1 |[X1]| Qf1 x 
           ELSE IF (xY1) THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] SKIP) 
                ELSE ? :Y1 -> Pf1 |[X1]| Qf1 x 
   [> ? :Y1 -> Pf1 |[X1]| SKIP 
  =F ? :Y1 -> Pf1 |[X1]| (? :Z1 -> Qf1 [+] SKIP)
  ? x:(X1Y1Z1 ∪ (Y1 - X1) ∪ (Z1 - X1)) 
   -> IF (xX1) THEN Pf1 x |[X1]| Qf1 x 
      ELSE IF (xY1xZ1) 
           THEN Pf1 x |[X1]| ? :Z1 -> Qf1 |~| (? :Y1 -> Pf1 [+] DIV) |[X1]| Qf1 x 
           ELSE IF (xY1) THEN Pf1 x |[X1]| ? :Z1 -> Qf1 
                ELSE (? :Y1 -> Pf1 [+] DIV) |[X1]| Qf1 x 
   [> DIV |[X1]| ? :Z1 -> Qf1 
  =F (? :Y1 -> Pf1 [+] DIV) |[X1]| ? :Z1 -> Qf1
  ? x:(X1Y1Z1 ∪ (Y1 - X1) ∪ (Z1 - X1)) 
   -> IF (xX1) THEN Pf1 x |[X1]| Qf1 x 
      ELSE IF (xY1xZ1) 
           THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] DIV) |~| ? :Y1 -> Pf1 |[X1]| Qf1 x 
           ELSE IF (xY1) THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] DIV) 
                ELSE ? :Y1 -> Pf1 |[X1]| Qf1 x 
   [> ? :Y1 -> Pf1 |[X1]| DIV 
  =F ? :Y1 -> Pf1 |[X1]| (? :Z1 -> Qf1 [+] DIV)
  ? x:X1 -> (Pf1 x ;; Q1) [> Q1 =F (? :X1 -> Pf1 [+] SKIP) ;; Q1
  ? x:X1 -> (Pf1 x ;; Q1) [+] DIV =F (? :X1 -> Pf1 [+] DIV) ;; Q1

lemmas cspF_SKIP_DIV_resolve_sym:

  ? x:(Y1 - X1) -> (SKIP |[X1]| Qf1 x) =F SKIP |[X1]| ? :Y1 -> Qf1
  ? x:(Y1 - X1) -> (Pf1 x |[X1]| SKIP) =F ? :Y1 -> Pf1 |[X1]| SKIP
  ? x:(Y1 - X1) -> (DIV |[X1]| Qf1 x) [+] DIV =F DIV |[X1]| ? :Y1 -> Qf1
  ? x:(Y1 - X1) -> (Qf1 x |[X1]| DIV) [+] DIV =F ? :Y1 -> Qf1 |[X1]| DIV
  SKIP =F SKIP [+] DIV
  SKIP =F DIV [+] SKIP
  DIV =F SKIP |[X1]| DIV
  DIV =F DIV |[X1]| SKIP
  SKIP =F SKIP |[X1]| SKIP
  DIV =F DIV |[X1]| DIV
  ? x:(Y1 - X1) -> (Pf1 x |[X1]| SKIP) [+] SKIP =F 
  (? :Y1 -> Pf1 [+] SKIP) |[X1]| SKIP
  ? x:(Y1 - X1) -> (SKIP |[X1]| Pf1 x) [+] SKIP =F 
  SKIP |[X1]| (? :Y1 -> Pf1 [+] SKIP)
  ? x:(Y1 - X1) -> (Pf1 x |[X1]| SKIP) [+] DIV =F 
  (? :Y1 -> Pf1 [+] DIV) |[X1]| SKIP
  ? x:(Y1 - X1) -> (SKIP |[X1]| Pf1 x) [+] DIV =F 
  SKIP |[X1]| (? :Y1 -> Pf1 [+] DIV)
  P1 |[X1]| DIV =F (P1 [+] SKIP) |[X1]| DIV
  DIV |[X1]| P1 =F DIV |[X1]| (P1 [+] SKIP)
  P1 |[X1]| DIV =F (P1 [+] DIV) |[X1]| DIV
  DIV |[X1]| P1 =F DIV |[X1]| (P1 [+] DIV)
  SKIP =F SKIP -- X1
  DIV =F DIV -- X1
  ? x:(Y1 - X1) -> Pf1 x -- X1 [+] DIV |~| ! x:(Y1X1) .. Pf1 x -- X1 =F 
  (? :Y1 -> Pf1 [+] DIV) -- X1
  ? x:(Y1 - X1) -> Pf1 x -- X1 [+] SKIP |~| ! x:(Y1X1) .. Pf1 x -- X1 =F 
  (? :Y1 -> Pf1 [+] SKIP) -- X1
  SKIP =F SKIP [[r1]]
  DIV =F DIV [[r1]]
  P2.0 =F SKIP ;; P2.0
  P2.0 =F P2.0 ;; SKIP
  DIV =F DIV ;; P1
  ? x:X1 -> (Pf1 x ;; Q1) [> Q1 =F (? :X1 -> Pf1 [> SKIP) ;; Q1
  ? x:X1 -> (Pf1 x ;; Q1) [> DIV =F (? :X1 -> Pf1 [> DIV) ;; Q1
  SKIP =F SKIP |. Suc n1
  DIV =F DIV |. n1
  ? x:(X1Y1Z1 ∪ (Y1 - X1) ∪ (Z1 - X1)) 
   -> IF (xX1) THEN Pf1 x |[X1]| Qf1 x 
      ELSE IF (xY1xZ1) 
           THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] SKIP) 
                 |~| (? :Y1 -> Pf1 [+] SKIP) |[X1]| Qf1 x 
           ELSE IF (xY1) THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] SKIP) 
                ELSE (? :Y1 -> Pf1 [+] SKIP) |[X1]| Qf1 x 
   [> (SKIP |[X1]| (? :Z1 -> Qf1 [+] SKIP) 
        |~| (? :Y1 -> Pf1 [+] SKIP) |[X1]| SKIP) 
  =F (? :Y1 -> Pf1 [+] SKIP) |[X1]| (? :Z1 -> Qf1 [+] SKIP)
  ? x:(X1Y1Z1 ∪ (Y1 - X1) ∪ (Z1 - X1)) 
   -> IF (xX1) THEN Pf1 x |[X1]| Qf1 x 
      ELSE IF (xY1xZ1) 
           THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] DIV) 
                 |~| (? :Y1 -> Pf1 [+] DIV) |[X1]| Qf1 x 
           ELSE IF (xY1) THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] DIV) 
                ELSE (? :Y1 -> Pf1 [+] DIV) |[X1]| Qf1 x 
   [> (DIV |[X1]| (? :Z1 -> Qf1 [+] DIV) |~| (? :Y1 -> Pf1 [+] DIV) |[X1]| DIV) 
  =F (? :Y1 -> Pf1 [+] DIV) |[X1]| (? :Z1 -> Qf1 [+] DIV)
  ? x:(X1Y1Z1 ∪ (Y1 - X1) ∪ (Z1 - X1)) 
   -> IF (xX1) THEN Pf1 x |[X1]| Qf1 x 
      ELSE IF (xY1xZ1) 
           THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] DIV) 
                 |~| (? :Y1 -> Pf1 [+] SKIP) |[X1]| Qf1 x 
           ELSE IF (xY1) THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] DIV) 
                ELSE (? :Y1 -> Pf1 [+] SKIP) |[X1]| Qf1 x 
   [> (SKIP |[X1]| (? :Z1 -> Qf1 [+] DIV) |~| (? :Y1 -> Pf1 [+] SKIP) |[X1]| DIV) 
  =F (? :Y1 -> Pf1 [+] SKIP) |[X1]| (? :Z1 -> Qf1 [+] DIV)
  ? x:(X1Y1Z1 ∪ (Y1 - X1) ∪ (Z1 - X1)) 
   -> IF (xX1) THEN Pf1 x |[X1]| Qf1 x 
      ELSE IF (xY1xZ1) 
           THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] SKIP) 
                 |~| (? :Y1 -> Pf1 [+] DIV) |[X1]| Qf1 x 
           ELSE IF (xY1) THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] SKIP) 
                ELSE (? :Y1 -> Pf1 [+] DIV) |[X1]| Qf1 x 
   [> (DIV |[X1]| (? :Z1 -> Qf1 [+] SKIP) |~| (? :Y1 -> Pf1 [+] DIV) |[X1]| SKIP) 
  =F (? :Y1 -> Pf1 [+] DIV) |[X1]| (? :Z1 -> Qf1 [+] SKIP)
  ? x:(X1Y1Z1 ∪ (Y1 - X1) ∪ (Z1 - X1)) 
   -> IF (xX1) THEN Pf1 x |[X1]| Qf1 x 
      ELSE IF (xY1xZ1) 
           THEN Pf1 x |[X1]| ? :Z1 -> Qf1 
                 |~| (? :Y1 -> Pf1 [+] SKIP) |[X1]| Qf1 x 
           ELSE IF (xY1) THEN Pf1 x |[X1]| ? :Z1 -> Qf1 
                ELSE (? :Y1 -> Pf1 [+] SKIP) |[X1]| Qf1 x 
   [> SKIP |[X1]| ? :Z1 -> Qf1 
  =F (? :Y1 -> Pf1 [+] SKIP) |[X1]| ? :Z1 -> Qf1
  ? x:(X1Y1Z1 ∪ (Y1 - X1) ∪ (Z1 - X1)) 
   -> IF (xX1) THEN Pf1 x |[X1]| Qf1 x 
      ELSE IF (xY1xZ1) 
           THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] SKIP) 
                 |~| ? :Y1 -> Pf1 |[X1]| Qf1 x 
           ELSE IF (xY1) THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] SKIP) 
                ELSE ? :Y1 -> Pf1 |[X1]| Qf1 x 
   [> ? :Y1 -> Pf1 |[X1]| SKIP 
  =F ? :Y1 -> Pf1 |[X1]| (? :Z1 -> Qf1 [+] SKIP)
  ? x:(X1Y1Z1 ∪ (Y1 - X1) ∪ (Z1 - X1)) 
   -> IF (xX1) THEN Pf1 x |[X1]| Qf1 x 
      ELSE IF (xY1xZ1) 
           THEN Pf1 x |[X1]| ? :Z1 -> Qf1 |~| (? :Y1 -> Pf1 [+] DIV) |[X1]| Qf1 x 
           ELSE IF (xY1) THEN Pf1 x |[X1]| ? :Z1 -> Qf1 
                ELSE (? :Y1 -> Pf1 [+] DIV) |[X1]| Qf1 x 
   [> DIV |[X1]| ? :Z1 -> Qf1 
  =F (? :Y1 -> Pf1 [+] DIV) |[X1]| ? :Z1 -> Qf1
  ? x:(X1Y1Z1 ∪ (Y1 - X1) ∪ (Z1 - X1)) 
   -> IF (xX1) THEN Pf1 x |[X1]| Qf1 x 
      ELSE IF (xY1xZ1) 
           THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] DIV) |~| ? :Y1 -> Pf1 |[X1]| Qf1 x 
           ELSE IF (xY1) THEN Pf1 x |[X1]| (? :Z1 -> Qf1 [+] DIV) 
                ELSE ? :Y1 -> Pf1 |[X1]| Qf1 x 
   [> ? :Y1 -> Pf1 |[X1]| DIV 
  =F ? :Y1 -> Pf1 |[X1]| (? :Z1 -> Qf1 [+] DIV)
  ? x:X1 -> (Pf1 x ;; Q1) [> Q1 =F (? :X1 -> Pf1 [+] SKIP) ;; Q1
  ? x:X1 -> (Pf1 x ;; Q1) [+] DIV =F (? :X1 -> Pf1 [+] DIV) ;; Q1

lemmas cspF_all_dist_sym:

  P1.1 [+] Q1 |~| P2.1 [+] Q1 =F (P1.1 |~| P2.1) [+] Q1
  P1 [+] Q1.1 |~| P1 [+] Q2.1 =F P1 [+] (Q1.1 |~| Q2.1)
  P1.1 |[X1]| Q1 |~| P2.1 |[X1]| Q1 =F (P1.1 |~| P2.1) |[X1]| Q1
  P1 |[X1]| Q1.1 |~| P1 |[X1]| Q2.1 =F P1 |[X1]| (Q1.1 |~| Q2.1)
  P1.1 -- X1 |~| P2.1 -- X1 =F (P1.1 |~| P2.1) -- X1
  P1.1 [[r1]] |~| P2.1 [[r1]] =F (P1.1 |~| P2.1) [[r1]]
  P1.1 ;; Q1 |~| P2.1 ;; Q1 =F (P1.1 |~| P2.1) ;; Q1
  P1.1 |. n1 |~| P2.1 |. n1 =F (P1.1 |~| P2.1) |. n1
  !! :C1 .. Pf1 |~| !! :C1 .. Qf1 =F !! c:C1 .. (Pf1 c |~| Qf1 c)
  IF (C1 = {}) THEN DIV [+] Q1 ELSE !! c:C1 .. Pf1 c [+] Q1 =F 
  (!! :C1 .. Pf1) [+] Q1
  IF (C1 = {}) THEN P1 [+] DIV ELSE !! c:C1 .. P1 [+] Qf1 c =F 
  P1 [+] (!! :C1 .. Qf1)
  IF (C1 = {}) THEN DIV |[X1]| Q1 ELSE !! c:C1 .. Pf1 c |[X1]| Q1 =F 
  (!! :C1 .. Pf1) |[X1]| Q1
  IF (C1 = {}) THEN P1 |[X1]| DIV ELSE !! c:C1 .. P1 |[X1]| Qf1 c =F 
  P1 |[X1]| (!! :C1 .. Qf1)
  !! c:C1 .. Pf1 c -- X1 =F (!! :C1 .. Pf1) -- X1
  !! c:C1 .. Pf1 c [[r1]] =F (!! :C1 .. Pf1) [[r1]]
  !! c:C1 .. Pf1 c ;; Q1 =F (!! :C1 .. Pf1) ;; Q1
  !! c:C1 .. Pf1 c |. n1 =F (!! :C1 .. Pf1) |. n1
  IF (X1 = {}) THEN DIV [+] Q1 ELSE !!<f1> x:X1 .. Pf1 x [+] Q1 =F 
  (!!<f1> :X1 .. Pf1) [+] Q1
  IF (X1 = {}) THEN P1 [+] DIV ELSE !!<f1> x:X1 .. P1 [+] Qf1 x =F 
  P1 [+] (!!<f1> :X1 .. Qf1)
  IF (Y1 = {}) THEN DIV |[X1]| Q1 ELSE !!<f1> x:Y1 .. Pf1 x |[X1]| Q1 =F 
  (!!<f1> :Y1 .. Pf1) |[X1]| Q1
  IF (Y1 = {}) THEN P1 |[X1]| DIV ELSE !!<f1> x:Y1 .. P1 |[X1]| Qf1 x =F 
  P1 |[X1]| (!!<f1> :Y1 .. Qf1)
  inj f1 ==> !!<f1> x:Y1 .. Pf1 x -- X1 =F (!!<f1> :Y1 .. Pf1) -- X1
  inj f1 ==> !!<f1> x:X1 .. Pf1 x [[r1]] =F (!!<f1> :X1 .. Pf1) [[r1]]
  inj f1 ==> !!<f1> x:X1 .. Pf1 x ;; Q1 =F (!!<f1> :X1 .. Pf1) ;; Q1
  inj f1 ==> !!<f1> x:X1 .. Pf1 x |. n1 =F (!!<f1> :X1 .. Pf1) |. n1
  IF (X1 = {}) THEN DIV [+] Q1 ELSE ! x:X1 .. Pf1 x [+] Q1 =F 
  (! :X1 .. Pf1) [+] Q1
  IF (X1 = {}) THEN P1 [+] DIV ELSE ! x:X1 .. P1 [+] Qf1 x =F 
  P1 [+] (! :X1 .. Qf1)
  IF (Y1 = {}) THEN DIV |[X1]| Q1 ELSE ! x:Y1 .. Pf1 x |[X1]| Q1 =F 
  (! :Y1 .. Pf1) |[X1]| Q1
  IF (Y1 = {}) THEN P1 |[X1]| DIV ELSE ! x:Y1 .. P1 |[X1]| Qf1 x =F 
  P1 |[X1]| (! :Y1 .. Qf1)
  ! x:Y1 .. Pf1 x -- X1 =F (! :Y1 .. Pf1) -- X1
  ! x:X1 .. Pf1 x [[r1]] =F (! :X1 .. Pf1) [[r1]]
  ! x:X1 .. Pf1 x ;; Q1 =F (! :X1 .. Pf1) ;; Q1
  ! x:X1 .. Pf1 x |. n1 =F (! :X1 .. Pf1) |. n1
  P1.1 [[r1]] [+] P2.1 [[r1]] =F (P1.1 [+] P2.1) [[r1]]
  P1.1 |. n1 [+] P2.1 |. n1 =F (P1.1 [+] P2.1) |. n1

lemmas cspF_all_dist_sym:

  P1.1 [+] Q1 |~| P2.1 [+] Q1 =F (P1.1 |~| P2.1) [+] Q1
  P1 [+] Q1.1 |~| P1 [+] Q2.1 =F P1 [+] (Q1.1 |~| Q2.1)
  P1.1 |[X1]| Q1 |~| P2.1 |[X1]| Q1 =F (P1.1 |~| P2.1) |[X1]| Q1
  P1 |[X1]| Q1.1 |~| P1 |[X1]| Q2.1 =F P1 |[X1]| (Q1.1 |~| Q2.1)
  P1.1 -- X1 |~| P2.1 -- X1 =F (P1.1 |~| P2.1) -- X1
  P1.1 [[r1]] |~| P2.1 [[r1]] =F (P1.1 |~| P2.1) [[r1]]
  P1.1 ;; Q1 |~| P2.1 ;; Q1 =F (P1.1 |~| P2.1) ;; Q1
  P1.1 |. n1 |~| P2.1 |. n1 =F (P1.1 |~| P2.1) |. n1
  !! :C1 .. Pf1 |~| !! :C1 .. Qf1 =F !! c:C1 .. (Pf1 c |~| Qf1 c)
  IF (C1 = {}) THEN DIV [+] Q1 ELSE !! c:C1 .. Pf1 c [+] Q1 =F 
  (!! :C1 .. Pf1) [+] Q1
  IF (C1 = {}) THEN P1 [+] DIV ELSE !! c:C1 .. P1 [+] Qf1 c =F 
  P1 [+] (!! :C1 .. Qf1)
  IF (C1 = {}) THEN DIV |[X1]| Q1 ELSE !! c:C1 .. Pf1 c |[X1]| Q1 =F 
  (!! :C1 .. Pf1) |[X1]| Q1
  IF (C1 = {}) THEN P1 |[X1]| DIV ELSE !! c:C1 .. P1 |[X1]| Qf1 c =F 
  P1 |[X1]| (!! :C1 .. Qf1)
  !! c:C1 .. Pf1 c -- X1 =F (!! :C1 .. Pf1) -- X1
  !! c:C1 .. Pf1 c [[r1]] =F (!! :C1 .. Pf1) [[r1]]
  !! c:C1 .. Pf1 c ;; Q1 =F (!! :C1 .. Pf1) ;; Q1
  !! c:C1 .. Pf1 c |. n1 =F (!! :C1 .. Pf1) |. n1
  IF (X1 = {}) THEN DIV [+] Q1 ELSE !!<f1> x:X1 .. Pf1 x [+] Q1 =F 
  (!!<f1> :X1 .. Pf1) [+] Q1
  IF (X1 = {}) THEN P1 [+] DIV ELSE !!<f1> x:X1 .. P1 [+] Qf1 x =F 
  P1 [+] (!!<f1> :X1 .. Qf1)
  IF (Y1 = {}) THEN DIV |[X1]| Q1 ELSE !!<f1> x:Y1 .. Pf1 x |[X1]| Q1 =F 
  (!!<f1> :Y1 .. Pf1) |[X1]| Q1
  IF (Y1 = {}) THEN P1 |[X1]| DIV ELSE !!<f1> x:Y1 .. P1 |[X1]| Qf1 x =F 
  P1 |[X1]| (!!<f1> :Y1 .. Qf1)
  inj f1 ==> !!<f1> x:Y1 .. Pf1 x -- X1 =F (!!<f1> :Y1 .. Pf1) -- X1
  inj f1 ==> !!<f1> x:X1 .. Pf1 x [[r1]] =F (!!<f1> :X1 .. Pf1) [[r1]]
  inj f1 ==> !!<f1> x:X1 .. Pf1 x ;; Q1 =F (!!<f1> :X1 .. Pf1) ;; Q1
  inj f1 ==> !!<f1> x:X1 .. Pf1 x |. n1 =F (!!<f1> :X1 .. Pf1) |. n1
  IF (X1 = {}) THEN DIV [+] Q1 ELSE ! x:X1 .. Pf1 x [+] Q1 =F 
  (! :X1 .. Pf1) [+] Q1
  IF (X1 = {}) THEN P1 [+] DIV ELSE ! x:X1 .. P1 [+] Qf1 x =F 
  P1 [+] (! :X1 .. Qf1)
  IF (Y1 = {}) THEN DIV |[X1]| Q1 ELSE ! x:Y1 .. Pf1 x |[X1]| Q1 =F 
  (! :Y1 .. Pf1) |[X1]| Q1
  IF (Y1 = {}) THEN P1 |[X1]| DIV ELSE ! x:Y1 .. P1 |[X1]| Qf1 x =F 
  P1 |[X1]| (! :Y1 .. Qf1)
  ! x:Y1 .. Pf1 x -- X1 =F (! :Y1 .. Pf1) -- X1
  ! x:X1 .. Pf1 x [[r1]] =F (! :X1 .. Pf1) [[r1]]
  ! x:X1 .. Pf1 x ;; Q1 =F (! :X1 .. Pf1) ;; Q1
  ! x:X1 .. Pf1 x |. n1 =F (! :X1 .. Pf1) |. n1
  P1.1 [[r1]] [+] P2.1 [[r1]] =F (P1.1 [+] P2.1) [[r1]]
  P1.1 |. n1 [+] P2.1 |. n1 =F (P1.1 [+] P2.1) |. n1

lemmas cspF_unwind_sym:

  PF1 ∈ ProcFun ==> PF1 (FIX PF1) p1 =F (FIX PF1) p1
  PF1 ∈ gProcFun ==> PF1 (FIX! PF1) p1 =F (FIX! PF1) p1

lemmas cspF_unwind_sym:

  PF1 ∈ ProcFun ==> PF1 (FIX PF1) p1 =F (FIX PF1) p1
  PF1 ∈ gProcFun ==> PF1 (FIX! PF1) p1 =F (FIX! PF1) p1

lemmas cspF_step_sym:

  ? :{} -> Pf1 =F STOP
  ? x:{a1} -> P1 =F a1 -> P1
  ? x:(X1Y1) 
   -> IF (xX1xY1) THEN Pf1 x |~| Qf1 x 
      ELSE IF (xX1) THEN Pf1 x ELSE Qf1 x 
  =F ? :X1 -> Pf1 [+] ? :Y1 -> Qf1
  ? x:(X1Y1Z1 ∪ (Y1 - X1) ∪ (Z1 - X1)) 
   -> IF (xX1) THEN Pf1 x |[X1]| Qf1 x 
      ELSE IF (xY1xZ1) 
           THEN Pf1 x |[X1]| ? :Z1 -> Qf1 |~| ? :Y1 -> Pf1 |[X1]| Qf1 x 
           ELSE IF (xY1) THEN Pf1 x |[X1]| ? :Z1 -> Qf1 
                ELSE ? :Y1 -> Pf1 |[X1]| Qf1 x 
  =F ? :Y1 -> Pf1 |[X1]| ? :Z1 -> Qf1
  IF (Y1X1 = {}) THEN ? x:Y1 -> Pf1 x -- X1 
  ELSE ? x:(Y1 - X1) -> Pf1 x -- X1 [> (! x:(Y1X1) .. Pf1 x -- X1) 
  =F (? :Y1 -> Pf1) -- X1
  ? y:(r1 `` X1) -> (! x:{x : X1. (x, y) ∈ r1} .. Pf1 x [[r1]]) =F 
  (? :X1 -> Pf1) [[r1]]
  ? x:X1 -> (Pf1 x ;; Q1) =F ? :X1 -> Pf1 ;; Q1
  ? x:X1 -> Pf1 x |. n1 =F (? :X1 -> Pf1) |. Suc n1

lemmas cspF_step_sym:

  ? :{} -> Pf1 =F STOP
  ? x:{a1} -> P1 =F a1 -> P1
  ? x:(X1Y1) 
   -> IF (xX1xY1) THEN Pf1 x |~| Qf1 x 
      ELSE IF (xX1) THEN Pf1 x ELSE Qf1 x 
  =F ? :X1 -> Pf1 [+] ? :Y1 -> Qf1
  ? x:(X1Y1Z1 ∪ (Y1 - X1) ∪ (Z1 - X1)) 
   -> IF (xX1) THEN Pf1 x |[X1]| Qf1 x 
      ELSE IF (xY1xZ1) 
           THEN Pf1 x |[X1]| ? :Z1 -> Qf1 |~| ? :Y1 -> Pf1 |[X1]| Qf1 x 
           ELSE IF (xY1) THEN Pf1 x |[X1]| ? :Z1 -> Qf1 
                ELSE ? :Y1 -> Pf1 |[X1]| Qf1 x 
  =F ? :Y1 -> Pf1 |[X1]| ? :Z1 -> Qf1
  IF (Y1X1 = {}) THEN ? x:Y1 -> Pf1 x -- X1 
  ELSE ? x:(Y1 - X1) -> Pf1 x -- X1 [> (! x:(Y1X1) .. Pf1 x -- X1) 
  =F (? :Y1 -> Pf1) -- X1
  ? y:(r1 `` X1) -> (! x:{x : X1. (x, y) ∈ r1} .. Pf1 x [[r1]]) =F 
  (? :X1 -> Pf1) [[r1]]
  ? x:X1 -> (Pf1 x ;; Q1) =F ? :X1 -> Pf1 ;; Q1
  ? x:X1 -> Pf1 x |. n1 =F (? :X1 -> Pf1) |. Suc n1