if (!only_offline) {
Linux.check_system()
Isabelle_System.require_command("bzip2")
Isabelle_System.require_command("m4")
Isabelle_System.require_command("patch")
Isabelle_System.require_command("zstd")
}
/* component */
val component_name = "hol_light_import-" + Date.Format.alt_date(Date.now()) val component_dir =
Components.Directory(target_dir + Path.basic(component_name)).create(progress = progress)
val platform = Isabelle_Platform.local.ISABELLE_PLATFORM(windows = true, apple = true) val platform_dir = Isabelle_System.make_directory(component_dir.path + Path.basic(platform))
val opam_env = Isabelle_System.bash("isabelle ocaml_opam env").check.out
/* "offline" tool */
progress.echo("Building offline tool ...")
val offline_path = Path.explode("offline") val offline_exe = offline_path.platform_exe val offline_dir = Isabelle_System.make_directory(tmp_dir + offline_path)
Isabelle_System.copy_dir(hol_import_dir + offline_path, offline_dir, direct = true)
for (n <- List(1, 2)) Isabelle_System.copy_file(patch(n, source = true), patch(n))
if (load_more.nonEmpty) { val bad = load_more.filter(path => !(hol_light_dir + path).is_file) if (bad.nonEmpty) error("Bad HOL Light files: " + bad.mkString(", "))
val more = load_more.map(path => "needs " + path + ";; ").mkString("+", "", "")
File.change_lines(patch(1), strict = true)(_.map(line => if (line == "+(*LOAD MORE*)") more else line))
}
/* export stages */
def run(n: Int, lines: String*): Unit = { val title = "stage " + n if (n > 0) progress.echo("Running " + title + " ...")
val isabelle_tool =
Isabelle_Tool("component_hol_light_import", "build Isabelle component for HOL Light import",
Scala_Project.here,
{ args => var target_dir = Path.current var load_more = List.empty[Path] var maps: Option[Path] = Some(default_maps) var only_offline = false var preserve_raw = false var hol_light_url = default_hol_light_url var hol_light_rev = default_hol_light_rev var verbose = false
val getopts = Getopts("""
Usage: isabelle component_hol_light_import [OPTIONS]
Options are:
-D DIR target directory (default ".")
-L PATH load additional HOL Light files, after "hol.ml"
-M PATH alternative maps.lst for offline alignment of facts
("." means empty, default: """ + default_maps + """)
-O only build the "offline" tool
-P preserve raw proofs, before offline alignment of facts
-U URL git URL for original HOL Light repository, default: """ + default_hol_light_url + """
-r REV revision or branch to checkout HOL Light (default: """ +
default_hol_light_rev + """)
-v verbose
Build Isabelle component for HOL Light import. For example:
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.