aboutsummaryrefslogtreecommitdiffhomepage
path: root/toplevel/himsg.ml
diff options
context:
space:
mode:
authorGravatar barras <barras@85f007b7-540e-0410-9357-904b9bb8a0f7>2003-09-22 10:51:30 +0000
committerGravatar barras <barras@85f007b7-540e-0410-9357-904b9bb8a0f7>2003-09-22 10:51:30 +0000
commit5b108b017031b549a1e0c684d8ec385a3af44fa2 (patch)
tree33f42b1cea6f9134a9c0821898ef2b7dfa68bf09 /toplevel/himsg.ml
parentaf08be9e326fe4b7e76234022fe33b1eea4c06dd (diff)
message d'erreur de garde des cofix
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@4438 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'toplevel/himsg.ml')
-rw-r--r--toplevel/himsg.ml30
1 files changed, 18 insertions, 12 deletions
diff --git a/toplevel/himsg.ml b/toplevel/himsg.ml
index e62df6e76..3270ef451 100644
--- a/toplevel/himsg.ml
+++ b/toplevel/himsg.ml
@@ -254,28 +254,34 @@ let explain_ill_formed_rec_body ctx err names i =
str "Recursive call to " ++ called ++ str " had not enough arguments"
(* CoFixpoint guard errors *)
- (* TODO : récupérer le contexte des termes pour pouvoir les afficher *)
| CodomainNotInductiveType c ->
- str "The codomain is" ++ spc () ++ prterm c ++ spc () ++
+ str "the codomain is" ++ spc () ++ prterm_env ctx c ++ spc () ++
str "which should be a coinductive type"
| NestedRecursiveOccurrences ->
- str "Nested recursive occurrences"
+ str "nested recursive occurrences"
| UnguardedRecursiveCall c ->
- str "Unguarded recursive call"
+ str "unguarded recursive call in" ++ spc() ++ prterm_env ctx c
| RecCallInTypeOfAbstraction c ->
- str "Not allowed recursive call in the domain of an abstraction"
+ str "recursive call forbidden in the domain of an abstraction:" ++
+ spc() ++ prterm_env ctx c
| RecCallInNonRecArgOfConstructor c ->
- str "Not allowed recursive call in a non-recursive argument of constructor"
+ str "recursive call on a non-recursive argument of constructor" ++
+ spc() ++ prterm_env ctx c
| RecCallInTypeOfDef c ->
- str "Not allowed recursive call in the type of a recursive definition"
+ str "recursive call forbidden in the type of a recursive definition" ++
+ spc() ++ prterm_env ctx c
| RecCallInCaseFun c ->
- str "Not allowed recursive call in a branch of cases"
+ str "recursive call in a branch of" ++ spc() ++ prterm_env ctx c
| RecCallInCaseArg c ->
- str "Not allowed recursive call in the argument of cases"
+ str "recursive call in the argument of cases in" ++ spc() ++
+ prterm_env ctx c
| RecCallInCasePred c ->
- str "Not allowed recursive call in the type of cases in"
- | NotGuardedForm ->
- str "Definition not in guarded form"
+ str "recursive call in the type of cases in" ++ spc() ++
+ prterm_env ctx c
+ | NotGuardedForm c ->
+ str "sub-expression " ++ prterm_env ctx c ++ spc() ++
+ str "not in guarded form" ++ spc()++
+ str"(should be a constructor, abstraction, Cases, CoFix or recursive call)"
in
prt_name i ++ str" is ill-formed." ++ fnl() ++
pr_ne_context_of (str "In environment") ctx ++