From 523a919017f8ec390d130c81de4897bd7c6d3a2c Mon Sep 17 00:00:00 2001 From: Ferruccio Guidi Date: Tue, 20 Feb 2007 16:27:33 +0000 Subject: [PATCH] acic_procedural: changed module compilation order TermAcicContent: bug fix in AMutCase the presence of left parametes was not taken into account --- .../components/acic_content/termAcicContent.ml | 17 +++++++++++------ .../components/acic_procedural/Makefile | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/helm/software/components/acic_content/termAcicContent.ml b/helm/software/components/acic_content/termAcicContent.ml index 622a81618..eaa532590 100644 --- a/helm/software/components/acic_content/termAcicContent.ml +++ b/helm/software/components/acic_content/termAcicContent.ml @@ -44,17 +44,17 @@ type term_info = let get_types uri = let o,_ = CicEnvironment.get_obj CicUniv.empty_ugraph uri in match o with - | Cic.InductiveDefinition (l,_,_,_) -> l + | Cic.InductiveDefinition (l,_,lpsno,_) -> l, lpsno | _ -> assert false let name_of_inductive_type uri i = - let types = get_types uri in + let types, _ = get_types uri in let (name, _, _, _) = try List.nth types i with Not_found -> assert false in name (* returns pairs *) let constructors_of_inductive_type uri i = - let types = get_types uri in + let types, _ = get_types uri in let (_, _, _, constructors) = try List.nth types i with Not_found -> assert false in @@ -66,6 +66,9 @@ let constructor_of_inductive_type uri i j = fst (List.nth (constructors_of_inductive_type uri i) (j-1)) with Not_found -> assert false) + (* returns the number of left parameters *) +let left_params_no_of_inductive_type uri = + snd (get_types uri) let ast_of_acic0 term_info acic k = let k = k term_info in @@ -175,10 +178,12 @@ let ast_of_acic0 term_info acic k = in let case_indty = name, Some (UriManager.uri_of_string puri_str) in let constructors = constructors_of_inductive_type uri typeno in - let rec eat_branch ty pat = + let lpsno = left_params_no_of_inductive_type uri in + let rec eat_branch n ty pat = match (ty, pat) with + | Cic.Prod (_, _, t), _ when n > 0 -> eat_branch (pred n) t pat | Cic.Prod (_, _, t), Cic.ALambda (_, name, s, t') -> - let (cv, rhs) = eat_branch t t' in + let (cv, rhs) = eat_branch 0 t t' in (CicNotationUtil.name_of_cic_name name, Some (k s)) :: cv, rhs | _, _ -> [], k pat in @@ -188,7 +193,7 @@ let ast_of_acic0 term_info acic k = List.map2 (fun (name, ty) pat -> incr j; - let (capture_variables, rhs) = eat_branch ty pat in + let (capture_variables, rhs) = eat_branch lpsno ty pat in ((name, Some (ctor_puri !j), capture_variables), rhs)) constructors patterns with Invalid_argument _ -> assert false diff --git a/helm/software/components/acic_procedural/Makefile b/helm/software/components/acic_procedural/Makefile index ae52b5a20..8b3ea3695 100644 --- a/helm/software/components/acic_procedural/Makefile +++ b/helm/software/components/acic_procedural/Makefile @@ -2,10 +2,10 @@ PACKAGE = acic_procedural PREDICATES = INTERFACE_FILES = \ + proceduralTypes.mli \ proceduralClassify.mli \ proceduralMode.mli \ proceduralConversion.mli \ - proceduralTypes.mli \ acic2Procedural.mli \ $(NULL) IMPLEMENTATION_FILES = \ -- 2.39.2