diff options
| author | barras | 2003-11-13 18:02:09 +0000 |
|---|---|---|
| committer | barras | 2003-11-13 18:02:09 +0000 |
| commit | 9aab7ae10aa1d535734f336c4bce16d908576d65 (patch) | |
| tree | 34c92bbeaae2cc973dfbec48d921eae6934d9cdc /interp | |
| parent | 4c18a78b54ff33361990a6f19bcad69bb7a4417c (diff) | |
moins unaire au niveau 35, tactiques simple_induction et simple_destruct, Local devient Let
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@4897 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'interp')
| -rw-r--r-- | interp/constrextern.ml | 18 | ||||
| -rw-r--r-- | interp/constrintern.ml | 4 |
2 files changed, 20 insertions, 2 deletions
diff --git a/interp/constrextern.ml b/interp/constrextern.ml index 1fe371f855..cf62d81230 100644 --- a/interp/constrextern.ml +++ b/interp/constrextern.ml @@ -724,6 +724,20 @@ let same c d = try check_same_type c d; true with _ -> false let make_current_scopes (scopt,scopes) = option_fold_right push_scope scopt scopes +let make_notation loc ntn l = + match ntn,l with + (* Special case to avoid writing "- 3" for e.g. (Zopp 3) *) + | "- _", [CNumeral(_,Bignat.POS p)] -> CNotation (loc,"- ( _ )",l) + | _ -> CNotation (loc,ntn,l) + +let make_pat_notation loc ntn l = + match ntn,l with + (* Special case to avoid writing "- 3" for e.g. (Zopp 3) *) + | "- _", [CPatNumeral(_,Bignat.POS p)] -> + CPatNotation (loc,"- ( _ )",l) + | _ -> CPatNotation (loc,ntn,l) + + (* let rec cases_pattern_expr_of_constr_expr = function | CRef r -> CPatAtom (dummy_loc,Some r) @@ -837,7 +851,7 @@ and extern_symbol_pattern (tmp_scope,scopes as allscopes) vars t = function extern_cases_pattern_in_scope (scopt,List.fold_right push_scope scl scopes) vars c) subst in - insert_pat_delimiters (CPatNotation (loc,ntn,l)) key) + insert_pat_delimiters (make_pat_notation loc ntn l) key) | SynDefRule kn -> CPatAtom (loc,Some (Qualid (loc, shortest_qualid_of_syndef kn))) with @@ -1154,7 +1168,7 @@ and extern_symbol (tmp_scope,scopes as allscopes) vars t = function extern (* assuming no overloading: *) true (scopt,List.fold_right push_scope scl scopes) vars c) subst in - insert_delimiters (CNotation (loc,ntn,l)) key) + insert_delimiters (make_notation loc ntn l) key) | SynDefRule kn -> CRef (Qualid (loc, shortest_qualid_of_syndef kn)) in if args = [] then e diff --git a/interp/constrintern.ml b/interp/constrintern.ml index f27b7e4ca5..44a0d3b1f7 100644 --- a/interp/constrintern.ml +++ b/interp/constrintern.ml @@ -613,7 +613,11 @@ let internalise sigma env allow_soapp lvar c = | CLetIn (loc,(_,na),c1,c2) -> RLetIn (loc, na, intern (reset_tmp_scope env) c1, intern (push_name_env lvar env na) c2) + | CNotation (loc,"- _",[CNumeral(_,Bignat.POS p)]) -> + let scopes = option_cons tmp_scope scopes in + Symbols.interp_numeral loc (Bignat.NEG p) scopes | CNotation (loc,ntn,args) -> + let ntn = if ntn = "- ( _ )" then "- _" else ntn in let scopes = option_cons tmp_scope scopes in let (ids,c) = Symbols.interp_notation ntn scopes in let subst = List.map2 (fun (id,scl) a -> (id,(a,scl))) ids args in |
