src/Doc/System/Sessions.thy
changeset 70678 36c8c32346cb
parent 70677 56d70f7ce4a4
child 70681 a6c0f2d106c8
equal deleted inserted replaced
70677:56d70f7ce4a4 70678:36c8c32346cb
    51   \<^rail>\<open>
    51   \<^rail>\<open>
    52     @{syntax_def session_chapter}: @'chapter' @{syntax name}
    52     @{syntax_def session_chapter}: @'chapter' @{syntax name}
    53     ;
    53     ;
    54 
    54 
    55     @{syntax_def session_entry}: @'session' @{syntax system_name} groups? dir? '=' \<newline>
    55     @{syntax_def session_entry}: @'session' @{syntax system_name} groups? dir? '=' \<newline>
    56       (@{syntax system_name} '+')? description? directories?  \<newline>
    56       (@{syntax system_name} '+')? description? options? \<newline>
    57       options? (sessions?) (theories*) (document_files*) \<newline>
    57       sessions? directories? (theories*) \<newline>
    58       (export_files*)
    58       (document_files*) (export_files*)
    59     ;
    59     ;
    60     groups: '(' (@{syntax name} +) ')'
    60     groups: '(' (@{syntax name} +) ')'
    61     ;
    61     ;
    62     dir: @'in' @{syntax embedded}
    62     dir: @'in' @{syntax embedded}
    63     ;
    63     ;
    64     description: @'description' @{syntax text}
    64     description: @'description' @{syntax text}
    65     ;
    65     ;
       
    66     options: @'options' opts
       
    67     ;
       
    68     opts: '[' ( (@{syntax name} '=' value | @{syntax name}) + ',' ) ']'
       
    69     ;
       
    70     value: @{syntax name} | @{syntax real}
       
    71     ;
       
    72     sessions: @'sessions' (@{syntax system_name}+)
       
    73     ;
    66     directories: @'directories' ((dir ('(' @'overlapping' ')')?) +)
    74     directories: @'directories' ((dir ('(' @'overlapping' ')')?) +)
    67     ;
       
    68     options: @'options' opts
       
    69     ;
       
    70     opts: '[' ( (@{syntax name} '=' value | @{syntax name}) + ',' ) ']'
       
    71     ;
       
    72     value: @{syntax name} | @{syntax real}
       
    73     ;
       
    74     sessions: @'sessions' (@{syntax system_name}+)
       
    75     ;
    75     ;
    76     theories: @'theories' opts? (theory_entry+)
    76     theories: @'theories' opts? (theory_entry+)
    77     ;
    77     ;
    78     theory_entry: @{syntax system_name} ('(' @'global' ')')?
    78     theory_entry: @{syntax system_name} ('(' @'global' ')')?
    79     ;
    79     ;
   107   All theory files are located relatively to the session directory. The prover
   107   All theory files are located relatively to the session directory. The prover
   108   process is run within the same as its current working directory.
   108   process is run within the same as its current working directory.
   109 
   109 
   110   \<^descr> \isakeyword{description}~\<open>text\<close> is a free-form annotation for this
   110   \<^descr> \isakeyword{description}~\<open>text\<close> is a free-form annotation for this
   111   session.
   111   session.
       
   112 
       
   113   \<^descr> \isakeyword{options}~\<open>[x = a, y = b, z]\<close> defines separate options
       
   114   (\secref{sec:system-options}) that are used when processing this session,
       
   115   but \<^emph>\<open>without\<close> propagation to child sessions. Note that \<open>z\<close> abbreviates \<open>z =
       
   116   true\<close> for Boolean options.
       
   117 
       
   118   \<^descr> \isakeyword{sessions}~\<open>names\<close> specifies sessions that are \<^emph>\<open>imported\<close> into
       
   119   the current name space of theories. This allows to refer to a theory \<open>A\<close>
       
   120   from session \<open>B\<close> by the qualified name \<open>B.A\<close> --- although it is loaded again
       
   121   into the current ML process, which is in contrast to a theory that is
       
   122   already present in the \<^emph>\<open>parent\<close> session.
       
   123 
       
   124   Theories that are imported from other sessions are excluded from the current
       
   125   session document.
   112 
   126 
   113   \<^descr> \isakeyword{directories}~\<open>dirs\<close> specifies additional directories for
   127   \<^descr> \isakeyword{directories}~\<open>dirs\<close> specifies additional directories for
   114   import of theory files via \isakeyword{theories} within \<^verbatim>\<open>ROOT\<close> or
   128   import of theory files via \isakeyword{theories} within \<^verbatim>\<open>ROOT\<close> or
   115   \<^theory_text>\<open>imports\<close> within a theory; \<open>dirs\<close> are relative to the main session
   129   \<^theory_text>\<open>imports\<close> within a theory; \<open>dirs\<close> are relative to the main session
   116   directory (cf.\ \isakeyword{session} \dots \isakeyword{in}~\<open>dir\<close>). These
   130   directory (cf.\ \isakeyword{session} \dots \isakeyword{in}~\<open>dir\<close>). These
   117   directories should be exclusively assigned to a unique session, without
   131   directories should be exclusively assigned to a unique session, without
   118   implicit sharing of file-system locations, but
   132   implicit sharing of file-system locations, but
   119   \isakeyword{directories}~\<open>dir\<close>~(\isakeyword{overlapping}) is tolerant in
   133   \isakeyword{directories}~\<open>dir\<close>~(\isakeyword{overlapping}) is tolerant in
   120   this respect (it might cause problems in the Prover IDE @{cite
   134   this respect (it might cause problems in the Prover IDE @{cite
   121   "isabelle-jedit"} to assign session-qualified theory names to open files).
   135   "isabelle-jedit"} to assign session-qualified theory names to open files).
   122 
       
   123   \<^descr> \isakeyword{options}~\<open>[x = a, y = b, z]\<close> defines separate options
       
   124   (\secref{sec:system-options}) that are used when processing this session,
       
   125   but \<^emph>\<open>without\<close> propagation to child sessions. Note that \<open>z\<close> abbreviates \<open>z =
       
   126   true\<close> for Boolean options.
       
   127 
       
   128   \<^descr> \isakeyword{sessions}~\<open>names\<close> specifies sessions that are \<^emph>\<open>imported\<close> into
       
   129   the current name space of theories. This allows to refer to a theory \<open>A\<close>
       
   130   from session \<open>B\<close> by the qualified name \<open>B.A\<close> --- although it is loaded again
       
   131   into the current ML process, which is in contrast to a theory that is
       
   132   already present in the \<^emph>\<open>parent\<close> session.
       
   133 
       
   134   Theories that are imported from other sessions are excluded from the current
       
   135   session document.
       
   136 
   136 
   137   \<^descr> \isakeyword{theories}~\<open>options names\<close> specifies a block of theories that
   137   \<^descr> \isakeyword{theories}~\<open>options names\<close> specifies a block of theories that
   138   are processed within an environment that is augmented by the given options,
   138   are processed within an environment that is augmented by the given options,
   139   in addition to the global session options given before. Any number of blocks
   139   in addition to the global session options given before. Any number of blocks
   140   of \isakeyword{theories} may be given. Options are only active for each
   140   of \isakeyword{theories} may be given. Options are only active for each