# HG changeset patch # User blanchet # Date 1425553054 -3600 # Node ID 25ae098d8de2481c20dbabf76dcded8425c5400b # Parent 1716da11a11cc5ef865d9c11f8d253c4e0b2a0a5 more precise primcorec messages diff -r 1716da11a11c -r 25ae098d8de2 src/HOL/Tools/BNF/bnf_gfp_rec_sugar.ML --- a/src/HOL/Tools/BNF/bnf_gfp_rec_sugar.ML Thu Mar 05 11:57:34 2015 +0100 +++ b/src/HOL/Tools/BNF/bnf_gfp_rec_sugar.ML Thu Mar 05 11:57:34 2015 +0100 @@ -783,7 +783,9 @@ |> perhaps (try HOLogic.dest_not) |> perhaps (try (fst o HOLogic.dest_eq)) |> head_of; - val rhs_opt = concl |> perhaps (try HOLogic.dest_not) |> try (snd o HOLogic.dest_eq); + val rhs_opt = concl |> perhaps (try HOLogic.dest_not) |> try (HOLogic.dest_eq #> snd); + val _ = is_none rhs_opt orelse not (can dest_funT (fastype_of (the rhs_opt))) orelse + error_at ctxt [eqn] "Expected more arguments to function on left-hand side"; val discs = maps (map #disc) basic_ctr_specss; val sels = maps (maps #sels) basic_ctr_specss;