diff -r 426a93160f4a -r 09a57446696a thys2/SizeBoundStrong.thy --- a/thys2/SizeBoundStrong.thy Sat Mar 05 11:31:59 2022 +0000 +++ b/thys2/SizeBoundStrong.thy Mon Mar 07 12:27:27 2022 +0000 @@ -621,12 +621,15 @@ where "dBStrong [] acc = []" | "dBStrong (r # rs) acc = (if (erase r) \ (set acc) then dBStrong rs acc - else (case (pruneRexp r (addToAcc r acc)) of - AZERO \ dBStrong rs ((addToAcc r acc) @ acc) | - r1 \ r1 # (dBStrong rs ((addToAcc r acc) @ acc)) + else let newSubRexps = (addToAcc r acc) in + (case (pruneRexp r newSubRexps) of + AZERO \ dBStrong rs (newSubRexps @ acc) | + r1 \ r1 # (dBStrong rs (newSubRexps @ acc)) ) ) " + + fun bsimpStrong :: "arexp \ arexp " where "bsimpStrong (ASEQ bs1 r1 r2) = bsimp_ASEQ bs1 (bsimpStrong r1) (bsimpStrong r2)" @@ -937,6 +940,22 @@ apply(simp_all) done +fun pAKC_aux :: "arexp list \ arexp \ rexp \ arexp" + where +"pAKC_aux rsa r ctx = (if (L (SEQ (erase r) ctx)) \ (L (erase (AALTs [] rsa))) then AZERO else + case r of (ASEQ bs r1 r2) \ pAKC_aux rsa r1 (SEQ (erase r1) ctx) | + (AALTs bs rs) \ AALTs bs (map (\r. pAKC_aux rsa r ctx) rs) | + r \ r +)" + +|"pAKC_aux rsa (ASEQ bs1 a1 a2) ctx = (if (L (SEQ (SEQ (erase a1) (erase a2)) ctx)) \ + L (erase (AALTs [] rsa)) + then AZERO + else (pAKC_aux rsa a1 (ASEQ bs1 a2 ctx)))" +| "pAKC_aux rsa (AALTs bs1 rs1) ctx = ctx " + +fun pruneAwayKnownComponents :: "arexp list \ arexp \ arexp" where +"pruneAwayKnownComponents rsa (ASEQ bs r1 r2) = (pAKC_aux rsa r1 r2)" @@ -955,6 +974,7 @@ | "AALTs bs [] \ AZERO" | "AALTs bs [r] \ fuse bs r" | "erase a1 = erase a2 \ AALTs bs (rsa@[a1]@rsb@[a2]@rsc) \ AALTs bs (rsa@[a1]@rsb@rsc)" +| "pruneAwayKnownComponents rsa a2 = a2' \ AALTs bs (rsa @ [a2] @ rsb) \ AALTs bs (rsa @ [a2'] @ rsb)" inductive