From 2bd1dbc6fdad64f989089165a4e7367c072d2656 Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Sat, 12 Jul 2008 11:43:21 +0000 Subject: [PATCH] New feature/bug fixed (hopefully): it is now possible to use fixed (term) variables in fold bodies. The notation for exists is now fully working as expected. --- helm/software/components/content_pres/termContentPres.ml | 4 ++++ helm/software/matita/core_notation.moo | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/helm/software/components/content_pres/termContentPres.ml b/helm/software/components/content_pres/termContentPres.ml index 691d4426d..a1f9268e4 100644 --- a/helm/software/components/content_pres/termContentPres.ml +++ b/helm/software/components/content_pres/termContentPres.ml @@ -511,6 +511,8 @@ let head_names names env = (match ty, v with | Env.ListType ty, Env.ListValue (v :: _) -> aux ((name, (ty, v)) :: acc) tl + | Env.TermType _, Env.TermValue _ -> + aux ((name, (ty, v)) :: acc) tl | _ -> assert false) | _ :: tl -> aux acc tl (* base pattern may contain only meta names, thus we trash all others *) @@ -524,6 +526,8 @@ let tail_names names env = (match ty, v with | Env.ListType ty, Env.ListValue (_ :: vtl) -> aux ((name, (Env.ListType ty, Env.ListValue vtl)) :: acc) tl + | Env.TermType _, Env.TermValue _ -> + aux ((name, (ty, v)) :: acc) tl | _ -> assert false) | binding :: tl -> aux (binding :: acc) tl | [] -> acc diff --git a/helm/software/matita/core_notation.moo b/helm/software/matita/core_notation.moo index c7f1e5021..0043825ce 100644 --- a/helm/software/matita/core_notation.moo +++ b/helm/software/matita/core_notation.moo @@ -7,7 +7,10 @@ for @{ 'exists ${default (* Bugged notation: $T is not used if provided *) notation > "\exists list1 ident x sep , opt (: T). term 19 Px" with precedence 20 - for ${fold right @{$Px} rec acc @{'exists (λ${ident x}.$acc)}}. + for ${ default + @{ ${ fold right @{$Px} rec acc @{'exists (λ${ident x}:$T.$acc)} } } + @{ ${ fold right @{$Px} rec acc @{'exists (λ${ident x}.$acc)} } } + }. notation "hvbox(\langle term 19 a, break term 19 b\rangle)" with precedence 90 for @{ 'pair $a $b}. -- 2.39.2