From: Claudio Sacerdoti Coen Date: Sun, 28 Oct 2007 22:25:56 +0000 (+0000) Subject: New syntax for match patterns in terms and in patterns. X-Git-Tag: 0.4.95@7852~78 X-Git-Url: http://matita.cs.unibo.it/gitweb/?p=helm.git;a=commitdiff_plain;h=9b0a0de27822f36e172e383ccca4d89b035a8800 New syntax for match patterns in terms and in patterns. --- diff --git a/matita/help/C/sec_terms.xml b/matita/help/C/sec_terms.xml index 05385f666..3cae2f84c 100644 --- a/matita/help/C/sec_terms.xml +++ b/matita/help/C/sec_terms.xml @@ -393,6 +393,12 @@ &id; &id; [&id;]… n-ary constructor (binds the n arguments) + + + | + _ + any remaining constructor (ignoring its arguments) + @@ -568,7 +574,7 @@ | - in match &term; + in match &path; [in [&id;[: &path;]]… [⊢ &path;]] @@ -584,7 +590,7 @@ &path; ::= - 〈〈any &sterm; whithout occurrences of Set, Prop, CProp, Type, &id;, &uri; and user provided notation; however, % is now an additional production for &sterm;〉〉 + 〈〈any &sterm; without occurrences of Set, Prop, CProp, Type, &id;, &uri; and user provided notation; however, % is now an additional production for &sterm;〉〉 @@ -597,6 +603,26 @@ that can be represented by ?. + Warning: the format for a path for a match … with + expression is restricted to: match &path; + with + [ + _ + ⇒ + &path; + | … + | + _ + ⇒ + &path; + ] + Its semantics is the following: the n-th + "_ + ⇒ + &path;" branch is matched against the n-th constructor of the + inductive data type. The head λ-abstractions of &path; are matched + against the corresponding constructor arguments. + For instance, the path ∀_,_:?.(? ? % ?)→(? ? ? %) locates at once the subterms