src/HOL/Tools/Function/fundef_datatype.ML
changeset 33002 f3f02f36a3e2
parent 32950 5d5e123443b3
child 33083 1fad3160d873
equal deleted inserted replaced
33001:82382652e5e7 33002:f3f02f36a3e2
    52                                        
    52                                        
    53       val _ = if not (null gs) then err "Conditional equations" else ()
    53       val _ = if not (null gs) then err "Conditional equations" else ()
    54       val _ = map check_constr_pattern args
    54       val _ = map check_constr_pattern args
    55                   
    55                   
    56                   (* just count occurrences to check linearity *)
    56                   (* just count occurrences to check linearity *)
    57       val _ = if fold (fold_aterms (fn Bound _ => curry (op +) 1 | _ => I)) args 0 > length qs
    57       val _ = if fold (fold_aterms (fn Bound _ => Integer.add 1 | _ => I)) args 0 > length qs
    58               then err "Nonlinear patterns" else ()
    58               then err "Nonlinear patterns" else ()
    59     in
    59     in
    60       ()
    60       ()
    61     end
    61     end
    62     
    62