updated
authorChristian Urban <christian.urban@kcl.ac.uk>
Thu, 13 Nov 2025 23:41:39 +0000
changeset 1023 fa3e3d00b802
parent 1022 53889239df4a
child 1024 c54cba4e59e7
updated
progs/Matcher2.thy
slides/slides06.pdf
slides/slides06.tex
--- a/progs/Matcher2.thy	Sat Nov 08 09:51:49 2025 +0000
+++ b/progs/Matcher2.thy	Thu Nov 13 23:41:39 2025 +0000
@@ -14,6 +14,7 @@
 | ALT rexp rexp
 | STAR rexp
 
+| AND rexp rexp
 | NOT rexp
 | PLUS rexp
 | OPT rexp
@@ -135,6 +136,7 @@
 | "L (CH c) = {[c]}"
 | "L (SEQ r1 r2) = (L r1) ;; (L r2)"
 | "L (ALT r1 r2) = (L r1) \<union> (L r2)"
+| "L (AND r1 r2) = (L r1) \<inter> (L r2)"
 | "L (STAR r) = (L r)\<star>"
 | "L (NOT r) = UNIV - (L r)"
 | "L (PLUS r) = (L r) ;; ((L r)\<star>)"
@@ -156,6 +158,7 @@
 | "nullable (ONE) = True"
 | "nullable (CH c) = False"
 | "nullable (ALT r1 r2) = (nullable r1 \<or> nullable r2)"
+| "nullable (AND r1 r2) = (nullable r1 \<and> nullable r2)"
 | "nullable (SEQ r1 r2) = (nullable r1 \<and> nullable r2)"
 | "nullable (STAR r) = True"
 | "nullable (NOT r) = (\<not>(nullable r))"
@@ -172,6 +175,7 @@
 | "der c (ONE) = ZERO"
 | "der c (CH d) = (if c = d then ONE else ZERO)"
 | "der c (ALT r1 r2) = ALT (der c r1) (der c r2)"
+| "der c (AND r1 r2) = AND (der c r1) (der c r2)"
 | "der c (SEQ r1 r2) = ALT (SEQ (der c r1) r2) (if nullable r1 then der c r2 else ZERO)"
 | "der c (STAR r) = SEQ (der c r) (STAR r)"
 | "der c (NOT r) = NOT(der c r)"
@@ -229,7 +233,12 @@
 lemma Der_union [simp]:
   shows "Der c (A \<union> B) = Der c A \<union> Der c B"
 unfolding Der_def
-by auto
+  by auto
+
+lemma Der_inter [simp]:
+  shows "Der c (A \<inter> B) = Der c A \<inter> Der c B"
+unfolding Der_def
+  by auto
 
 lemma Der_insert_nil [simp]:
   shows "Der c (insert [] A) = Der c A"
@@ -329,6 +338,9 @@
   case (ALT r1 r2)
   then show ?case by simp
 next
+  case (AND r1 r2)
+  then show ?case by(simp)
+next
   case (STAR r)
   then show ?case
     by simp 
@@ -383,4 +395,11 @@
 by (induct s arbitrary: r)
    (simp_all add: nullable_correctness der_correctness Der_def)
 
+
+lemma
+  "L(AND r ZERO) = {}" and
+  "L(AND r r) = L(r)" 
+  by(auto)
+
+
 end    
\ No newline at end of file
Binary file slides/slides06.pdf has changed
--- a/slides/slides06.tex	Sat Nov 08 09:51:49 2025 +0000
+++ b/slides/slides06.tex	Thu Nov 13 23:41:39 2025 +0000
@@ -36,10 +36,10 @@
   \begin{center}
   \begin{tabular}{ll}
     Email:  & christian.urban at kcl.ac.uk\\
-     Office Hour: & Fridays 12 -- 14\\  
+     Office Hour: & Fridays 11:30 -- 12:30\\  
   Location: & N7.07 (North Wing, Bush House)\\
   Slides \& Progs: & KEATS\\
-  Pollev: & \texttt{\alert{https://pollev.com/cfltutoratki576}}\\  
+  %Pollev: & \texttt{\alert{https://pollev.com/cfltutoratki576}}\\  
   \end{tabular}
   \end{center}