equal
deleted
inserted
replaced
196 locale_notes loc kind facts #> context_notes kind facts; |
196 locale_notes loc kind facts #> context_notes kind facts; |
197 |
197 |
198 |
198 |
199 (* declarations *) |
199 (* declarations *) |
200 |
200 |
201 fun term_syntax "" f = LocalTheory.theory (Context.theory_map f) |
201 (* FIXME proper morphisms *) |
202 | term_syntax loc f = LocalTheory.target (Locale.add_term_syntax loc (Context.proof_map f)); |
202 fun decl _ "" f = LocalTheory.theory (Context.theory_map (f Morphism.identity)) |
203 |
203 | decl add loc f = LocalTheory.target (add loc (Context.proof_map o f)); |
204 fun declaration "" f = LocalTheory.theory (Context.theory_map f) |
204 |
205 | declaration loc f = I; (* FIXME *) |
205 val type_syntax = decl Locale.add_type_syntax; |
|
206 val term_syntax = decl Locale.add_term_syntax; |
|
207 val declaration = decl Locale.add_declaration; |
206 |
208 |
207 |
209 |
208 (* init and exit *) |
210 (* init and exit *) |
209 |
211 |
210 fun begin loc = |
212 fun begin loc = |
213 {pretty = pretty loc, |
215 {pretty = pretty loc, |
214 consts = consts loc, |
216 consts = consts loc, |
215 axioms = axioms, |
217 axioms = axioms, |
216 defs = defs, |
218 defs = defs, |
217 notes = notes loc, |
219 notes = notes loc, |
|
220 type_syntax = type_syntax loc, |
218 term_syntax = term_syntax loc, |
221 term_syntax = term_syntax loc, |
219 declaration = declaration loc, |
222 declaration = declaration loc, |
220 reinit = fn _ => begin loc o (if loc = "" then ProofContext.init else Locale.init loc), |
223 reinit = fn _ => begin loc o (if loc = "" then ProofContext.init else Locale.init loc), |
221 exit = LocalTheory.target_of} |
224 exit = LocalTheory.target_of} |
222 |
225 |