src/Pure/Thy/export_theory.scala
changeset 75739 5b37466c1463
parent 75726 642ecd97d35c
child 75746 3513fdfeb4d8
equal deleted inserted replaced
75738:9cc5ee625adb 75739:5b37466c1463
    31     progress: Progress = new Progress,
    31     progress: Progress = new Progress,
    32     cache: Term.Cache = Term.Cache.make()): Session = {
    32     cache: Term.Cache = Term.Cache.make()): Session = {
    33     val thys =
    33     val thys =
    34       sessions_structure.build_requirements(List(session_name)).flatMap(session =>
    34       sessions_structure.build_requirements(List(session_name)).flatMap(session =>
    35         using(store.open_database(session)) { db =>
    35         using(store.open_database(session)) { db =>
    36           db.transaction {
    36           for (theory <- Export.read_theory_names(db, session))
    37             for (theory <- Export.read_theory_names(db, session))
    37           yield {
    38             yield {
    38             progress.echo("Reading theory " + theory)
    39               progress.echo("Reading theory " + theory)
    39             val provider = Export.Provider.database(db, store.cache, session, theory)
    40               val provider = Export.Provider.database(db, store.cache, session, theory)
    40             read_theory(provider, session, theory, cache = cache)
    41               read_theory(provider, session, theory, cache = cache)
       
    42             }
       
    43           }
    41           }
    44         })
    42         })
    45 
    43 
    46     val graph0 =
    44     val graph0 =
    47       thys.foldLeft(Graph.string[Option[Theory]]) {
    45       thys.foldLeft(Graph.string[Option[Theory]]) {
   151   def read_pure[A](store: Sessions.Store, read: (Export.Provider, String, String) => A): A = {
   149   def read_pure[A](store: Sessions.Store, read: (Export.Provider, String, String) => A): A = {
   152     val session_name = Thy_Header.PURE
   150     val session_name = Thy_Header.PURE
   153     val theory_name = Thy_Header.PURE
   151     val theory_name = Thy_Header.PURE
   154 
   152 
   155     using(store.open_database(session_name)) { db =>
   153     using(store.open_database(session_name)) { db =>
   156       db.transaction {
   154       val provider = Export.Provider.database(db, store.cache, session_name, theory_name)
   157         val provider = Export.Provider.database(db, store.cache, session_name, theory_name)
   155       read(provider, session_name, theory_name)
   158         read(provider, session_name, theory_name)
       
   159       }
       
   160     }
   156     }
   161   }
   157   }
   162 
   158 
   163   def read_pure_theory(store: Sessions.Store, cache: Term.Cache = Term.Cache.none): Theory =
   159   def read_pure_theory(store: Sessions.Store, cache: Term.Cache = Term.Cache.none): Theory =
   164     read_pure(store, read_theory(_, _, _, cache = cache))
   160     read_pure(store, read_theory(_, _, _, cache = cache))