src/Tools/Code_Generator.thy
changeset 39421 b6a77cffc231
parent 39401 887f4218a39a
child 39423 9969401e1fb8
equal deleted inserted replaced
39404:a8c337299bc1 39421:b6a77cffc231
    19   "~~/src/Tools/Code/code_target.ML"
    19   "~~/src/Tools/Code/code_target.ML"
    20   "~~/src/Tools/Code/code_namespace.ML"
    20   "~~/src/Tools/Code/code_namespace.ML"
    21   "~~/src/Tools/Code/code_ml.ML"
    21   "~~/src/Tools/Code/code_ml.ML"
    22   "~~/src/Tools/Code/code_haskell.ML"
    22   "~~/src/Tools/Code/code_haskell.ML"
    23   "~~/src/Tools/Code/code_scala.ML"
    23   "~~/src/Tools/Code/code_scala.ML"
    24   "~~/src/Tools/Code/code_runtime.ML"
    24   ("~~/src/Tools/Code/code_runtime.ML")
    25   "~~/src/Tools/nbe.ML"
    25   "~~/src/Tools/nbe.ML"
    26 begin
    26 begin
       
    27 
       
    28 code_datatype "TYPE('a\<Colon>{})"
       
    29 
       
    30 definition holds :: "prop" where
       
    31   "holds \<equiv> ((\<lambda>x::prop. x) \<equiv> (\<lambda>x. x))"
       
    32 
       
    33 lemma holds: "PROP holds"
       
    34   by (unfold holds_def) (rule reflexive)
       
    35 
       
    36 code_datatype holds
       
    37 
       
    38 lemma implies_code [code]:
       
    39   "(PROP holds \<Longrightarrow> PROP P) \<equiv> PROP P"
       
    40   "(PROP P \<Longrightarrow> PROP holds) \<equiv> PROP holds"
       
    41 proof -
       
    42   show "(PROP holds \<Longrightarrow> PROP P) \<equiv> PROP P"
       
    43   proof
       
    44     assume "PROP holds \<Longrightarrow> PROP P"
       
    45     then show "PROP P" using holds .
       
    46   next
       
    47     assume "PROP P"
       
    48     then show "PROP P" .
       
    49   qed
       
    50 next
       
    51   show "(PROP P \<Longrightarrow> PROP holds) \<equiv> PROP holds"
       
    52     by rule (rule holds)+
       
    53 qed  
       
    54 
       
    55 use "~~/src/Tools/Code/code_runtime.ML"
    27 
    56 
    28 setup {*
    57 setup {*
    29   Auto_Solve.setup
    58   Auto_Solve.setup
    30   #> Code_Preproc.setup
    59   #> Code_Preproc.setup
    31   #> Code_Simp.setup
    60   #> Code_Simp.setup
    35   #> Code_Runtime.setup
    64   #> Code_Runtime.setup
    36   #> Nbe.setup
    65   #> Nbe.setup
    37   #> Quickcheck.setup
    66   #> Quickcheck.setup
    38 *}
    67 *}
    39 
    68 
       
    69 hide_const (open) holds
       
    70 
    40 end
    71 end