1059 declared by hand. Thus variant versions of rules that have been |
1059 declared by hand. Thus variant versions of rules that have been |
1060 derived manually become ready to use in advanced case analysis |
1060 derived manually become ready to use in advanced case analysis |
1061 later. |
1061 later. |
1062 |
1062 |
1063 @{rail \<open> |
1063 @{rail \<open> |
1064 @@{command case} (caseref | '(' caseref (('_' | @{syntax name}) *) ')') |
1064 @@{command case} @{syntax thmdecl}? (nameref | '(' nameref (('_' | @{syntax name}) *) ')') |
1065 ; |
1065 ; |
1066 caseref: nameref attributes? |
|
1067 ; |
|
1068 |
|
1069 @@{attribute case_names} ((@{syntax name} ( '[' (('_' | @{syntax name}) +) ']' ) ? ) +) |
1066 @@{attribute case_names} ((@{syntax name} ( '[' (('_' | @{syntax name}) +) ']' ) ? ) +) |
1070 ; |
1067 ; |
1071 @@{attribute case_conclusion} @{syntax name} (@{syntax name} * ) |
1068 @@{attribute case_conclusion} @{syntax name} (@{syntax name} * ) |
1072 ; |
1069 ; |
1073 @@{attribute params} ((@{syntax name} * ) + @'and') |
1070 @@{attribute params} ((@{syntax name} * ) + @'and') |
1075 @@{attribute consumes} @{syntax int}? |
1072 @@{attribute consumes} @{syntax int}? |
1076 \<close>} |
1073 \<close>} |
1077 |
1074 |
1078 \begin{description} |
1075 \begin{description} |
1079 |
1076 |
1080 \item @{command "case"}~@{text "(c x\<^sub>1 \<dots> x\<^sub>m)"} invokes a named local |
1077 \item @{command "case"}~@{text "a: (c x\<^sub>1 \<dots> x\<^sub>m)"} invokes a named local |
1081 context @{text "c: x\<^sub>1, \<dots>, x\<^sub>m, \<phi>\<^sub>1, \<dots>, \<phi>\<^sub>m"}, as provided by an |
1078 context @{text "c: x\<^sub>1, \<dots>, x\<^sub>m, \<phi>\<^sub>1, \<dots>, \<phi>\<^sub>m"}, as provided by an |
1082 appropriate proof method (such as @{method_ref cases} and |
1079 appropriate proof method (such as @{method_ref cases} and @{method_ref |
1083 @{method_ref induct}). The command ``@{command "case"}~@{text "(c |
1080 induct}). The command ``@{command "case"}~@{text "a: (c x\<^sub>1 \<dots> x\<^sub>m)"}'' |
1084 x\<^sub>1 \<dots> x\<^sub>m)"}'' abbreviates ``@{command "fix"}~@{text "x\<^sub>1 \<dots> |
1081 abbreviates ``@{command "fix"}~@{text "x\<^sub>1 \<dots> x\<^sub>m"}~@{command |
1085 x\<^sub>m"}~@{command "assume"}~@{text "c: \<phi>\<^sub>1 \<dots> \<phi>\<^sub>n"}''. |
1082 "assume"}~@{text "a.c: \<phi>\<^sub>1 \<dots> \<phi>\<^sub>n"}''. Each local fact is qualified by the |
|
1083 prefix @{text "a"}, and all such facts are collectively bound to the name |
|
1084 @{text a}. |
|
1085 |
|
1086 The fact name is specification @{text a} is optional, the default is to |
|
1087 re-use @{text c}. So @{command "case"}~@{text "(c x\<^sub>1 \<dots> x\<^sub>m)"} is the same |
|
1088 as @{command "case"}~@{text "c: (c x\<^sub>1 \<dots> x\<^sub>m)"}. |
1086 |
1089 |
1087 \item @{command "print_cases"} prints all local contexts of the |
1090 \item @{command "print_cases"} prints all local contexts of the |
1088 current state, using Isar proof language notation. |
1091 current state, using Isar proof language notation. |
1089 |
1092 |
1090 \item @{attribute case_names}~@{text "c\<^sub>1 \<dots> c\<^sub>k"} declares names for |
1093 \item @{attribute case_names}~@{text "c\<^sub>1 \<dots> c\<^sub>k"} declares names for |