# HG changeset patch # User wenzelm # Date 1082624542 -7200 # Node ID 5ddbdbadba0636d09f282bc4382b47335abce584 # Parent 02b8f3bcf7fe0cb9b0e3b7bc8ca8de3fcef2e358 tmp hack get back to old 'constdefs'; diff -r 02b8f3bcf7fe -r 5ddbdbadba06 src/HOL/Import/HOL/ROOT.ML --- a/src/HOL/Import/HOL/ROOT.ML Thu Apr 22 11:01:34 2004 +0200 +++ b/src/HOL/Import/HOL/ROOT.ML Thu Apr 22 11:02:22 2004 +0200 @@ -3,6 +3,29 @@ Author: Sebastian Skalberg (TU Muenchen) *) +(* FIXME tmp hack to get generated theories work *) + +local + +fun old_add_constdefs args thy = + thy + |> Theory.add_consts (map fst args) + |> IsarThy.add_defs (false, map (fn ((c, _, mx), s) => + ((Thm.def_name (Syntax.const_name c mx), s), [])) args); + +structure P = OuterParse and K = OuterSyntax.Keyword; + +val constdefsP = + OuterSyntax.command "constdefs" "declare and define constants (old style)" + K.thy_decl + (Scan.repeat1 (P.const -- P.term) >> (Toplevel.theory o old_add_constdefs)); + +in + +val _ = OuterSyntax.add_parsers [constdefsP]; + +end; + with_path ".." use_thy "HOL4Compat"; with_path ".." use_thy "HOL4Syntax"; setmp quick_and_dirty true use_thy "HOL4Prob"; diff -r 02b8f3bcf7fe -r 5ddbdbadba06 src/HOL/Import/ROOT.ML --- a/src/HOL/Import/ROOT.ML Thu Apr 22 11:01:34 2004 +0200 +++ b/src/HOL/Import/ROOT.ML Thu Apr 22 11:02:22 2004 +0200 @@ -3,5 +3,30 @@ Author: Sebastian Skalberg (TU Muenchen) *) + +(* FIXME tmp hack to get generated theories work *) + +local + +fun old_add_constdefs args thy = + thy + |> Theory.add_consts (map fst args) + |> IsarThy.add_defs (false, map (fn ((c, _, mx), s) => + ((Thm.def_name (Syntax.const_name c mx), s), [])) args); + +structure P = OuterParse and K = OuterSyntax.Keyword; + +val constdefsP = + OuterSyntax.command "constdefs" "declare and define constants (old style)" + K.thy_decl + (Scan.repeat1 (P.const -- P.term) >> (Toplevel.theory o old_add_constdefs)); + +in + +val _ = OuterSyntax.add_parsers [constdefsP]; + +end; + + use_thy "HOL4Compat"; use_thy "HOL4Syntax";