equal
deleted
inserted
replaced
52 let |
52 let |
53 val ctxt = LocalTheory.target_of lthy; |
53 val ctxt = LocalTheory.target_of lthy; |
54 val thy = ProofContext.theory_of ctxt; |
54 val thy = ProofContext.theory_of ctxt; |
55 val ctxt_thy = ProofContext.init thy; |
55 val ctxt_thy = ProofContext.init thy; |
56 val sup = prep_class thy raw_sup; |
56 val sup = prep_class thy raw_sup; |
57 val sub = case Option.mapPartial (Class.class_of_locale thy) (TheoryTarget.peek lthy) |
57 val sub = case TheoryTarget.peek lthy |
58 of NONE => error "not in class context" |
58 of {is_class = false, ...} => error "No class context" |
59 | SOME sub => sub; |
59 | {target, ...} => target; |
60 val sub_params = map fst (Class.these_params thy [sub]); |
60 val sub_params = map fst (Class.these_params thy [sub]); |
61 val sup_params = map fst (Class.these_params thy [sup]); |
61 val sup_params = map fst (Class.these_params thy [sup]); |
62 val err_params = subtract (op =) sub_params sup_params; |
62 val err_params = subtract (op =) sub_params sup_params; |
63 val _ = if null err_params then [] else |
63 val _ = if null err_params then [] else |
64 error ("Class " ^ Sign.string_of_sort thy [sub] ^ " lacks parameter(s) " ^ |
64 error ("Class " ^ Sign.string_of_sort thy [sub] ^ " lacks parameter(s) " ^ |