ProgTutorial/Recipes/ExternalSolver.thy
changeset 565 cecd7a941885
parent 562 daf404920ab9
child 567 f7c97e64cc2a
equal deleted inserted replaced
564:6e2479089226 565:cecd7a941885
     1 theory ExternalSolver
     1 theory ExternalSolver
     2 imports "../Appendix"
     2 imports "../Appendix"
     3 begin
     3 begin
     4 
     4 
     5 
     5 
     6 section {* Executing an External Application (TBD) \label{rec:external}*}
     6 section \<open>Executing an External Application (TBD) \label{rec:external}\<close>
     7 
     7 
     8 text {*
     8 text \<open>
     9   {\bf Problem:}
     9   {\bf Problem:}
    10   You want to use an external application.
    10   You want to use an external application.
    11   \smallskip
    11   \smallskip
    12 
    12 
    13   {\bf Solution:} The function @{ML bash_output in Isabelle_System} might be the right thing for
    13   {\bf Solution:} The function @{ML bash_output in Isabelle_System} might be the right thing for
    34   The function @{ML bash_output in Isabelle_System} can also be used for more reasonable
    34   The function @{ML bash_output in Isabelle_System} can also be used for more reasonable
    35   applications, e.g. coupling external solvers with Isabelle. In that case,
    35   applications, e.g. coupling external solvers with Isabelle. In that case,
    36   one has to make sure that Isabelle can find the particular executable.
    36   one has to make sure that Isabelle can find the particular executable.
    37   One way to ensure this is by adding a Bash-like variable binding into
    37   One way to ensure this is by adding a Bash-like variable binding into
    38   one of Isabelle's settings file (prefer the user settings file usually to
    38   one of Isabelle's settings file (prefer the user settings file usually to
    39   be found at @{text "$HOME/.isabelle/etc/settings"}).
    39   be found at \<open>$HOME/.isabelle/etc/settings\<close>).
    40   
    40   
    41   For example, assume you want to use the application @{text foo} which
    41   For example, assume you want to use the application \<open>foo\<close> which
    42   is here supposed to be located at @{text "/usr/local/bin/"}.
    42   is here supposed to be located at \<open>/usr/local/bin/\<close>.
    43   The following line has to be added to one of Isabelle's settings file:
    43   The following line has to be added to one of Isabelle's settings file:
    44 
    44 
    45   @{text "FOO=/usr/local/bin/foo"}
    45   \<open>FOO=/usr/local/bin/foo\<close>
    46 
    46 
    47   In Isabelle, this application may now be executed by
    47   In Isabelle, this application may now be executed by
    48 
    48 
    49   @{ML_response_fake [display,gray] "Isabelle_System.bash_output \"$FOO\"" "\<dots>"}
    49   @{ML_response_fake [display,gray] "Isabelle_System.bash_output \"$FOO\"" "\<dots>"}
    50 *}
    50 \<close>
    51 
    51 
    52 
    52 
    53 end
    53 end