equal
deleted
inserted
replaced
81 if Context.exists_name name thy then () |
81 if Context.exists_name name thy then () |
82 else error ("Require theory " ^ quote name ^ " as an ancestor for " ^ what); |
82 else error ("Require theory " ^ quote name ^ " as an ancestor for " ^ what); |
83 |
83 |
84 |
84 |
85 |
85 |
86 (** theory wrappers **) |
86 (** datatype thy **) |
87 |
87 |
88 type wrapper = (theory -> theory option) * stamp; |
88 type wrapper = (theory -> theory option) * stamp; |
89 |
89 |
90 fun apply_wrappers (wrappers: wrapper list) = |
90 fun apply_wrappers (wrappers: wrapper list) = |
91 let |
91 perhaps (perhaps_loop (perhaps_apply (map fst wrappers))); |
92 fun app [] res = res |
|
93 | app ((f, _) :: fs) (changed, thy) = |
|
94 (case f thy of |
|
95 NONE => app fs (changed, thy) |
|
96 | SOME thy' => app fs (true, thy')); |
|
97 fun app_fixpoint thy = |
|
98 (case app wrappers (false, thy) of |
|
99 (false, _) => thy |
|
100 | (true, thy') => app_fixpoint thy'); |
|
101 in app_fixpoint end; |
|
102 |
|
103 |
|
104 |
|
105 (** datatype thy **) |
|
106 |
92 |
107 datatype thy = Thy of |
93 datatype thy = Thy of |
108 {axioms: term NameSpace.table, |
94 {axioms: term NameSpace.table, |
109 defs: Defs.T, |
95 defs: Defs.T, |
110 oracles: ((theory * Object.T -> term) * stamp) NameSpace.table, |
96 oracles: ((theory * Object.T -> term) * stamp) NameSpace.table, |