src/HOL/Codegenerator_Test/Candidates.thy
changeset 51161 6ed12ae3b3e1
parent 51160 599ff65b85e2
child 51173 3cbb4e95a565
equal deleted inserted replaced
51160:599ff65b85e2 51161:6ed12ae3b3e1
     5 
     5 
     6 theory Candidates
     6 theory Candidates
     7 imports
     7 imports
     8   Complex_Main
     8   Complex_Main
     9   "~~/src/HOL/Library/Library"
     9   "~~/src/HOL/Library/Library"
    10   "~~/src/HOL/Library/Sublist"
    10   "~~/src/HOL/Library/Sublist_Order"
    11   "~~/src/HOL/Number_Theory/Primes"
    11   "~~/src/HOL/Number_Theory/Primes"
    12   "~~/src/HOL/ex/Records"
    12   "~~/src/HOL/ex/Records"
    13 begin
    13 begin
    14 
    14 
    15 inductive sublist :: "'a list \<Rightarrow> 'a list \<Rightarrow> bool" where
    15 inductive sublist :: "'a list \<Rightarrow> 'a list \<Rightarrow> bool"
    16     empty: "sublist [] xs"
    16 where
    17   | drop: "sublist ys xs \<Longrightarrow> sublist ys (x # xs)"
    17   empty: "sublist [] xs"
    18   | take: "sublist ys xs \<Longrightarrow> sublist (x # ys) (x # xs)"
    18 | drop: "sublist ys xs \<Longrightarrow> sublist ys (x # xs)"
       
    19 | take: "sublist ys xs \<Longrightarrow> sublist (x # ys) (x # xs)"
    19 
    20 
    20 code_pred sublist .
    21 code_pred sublist .
    21 
    22 
    22 (*avoid popular infix*)
    23 code_reserved SML upto -- {* avoid popular infix *}
    23 code_reserved SML upto
       
    24 
    24 
    25 end
    25 end