src/HOL/Predicate_Compile_Examples/Predicate_Compile_Examples.thy
changeset 39747 c5ece2a7a86e
parent 39559 41ce0b56d858
child 39752 cf61ec140c4d
equal deleted inserted replaced
39746:8c23c61c6d5c 39747:c5ece2a7a86e
   789 
   789 
   790 inductive divmod_rel :: "nat \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> bool" where
   790 inductive divmod_rel :: "nat \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> bool" where
   791     "k < l \<Longrightarrow> divmod_rel k l 0 k"
   791     "k < l \<Longrightarrow> divmod_rel k l 0 k"
   792   | "k \<ge> l \<Longrightarrow> divmod_rel (k - l) l q r \<Longrightarrow> divmod_rel k l (Suc q) r"
   792   | "k \<ge> l \<Longrightarrow> divmod_rel (k - l) l q r \<Longrightarrow> divmod_rel k l (Suc q) r"
   793 
   793 
   794 code_pred divmod_rel ..
   794 code_pred divmod_rel .
   795 thm divmod_rel.equation
   795 thm divmod_rel.equation
   796 value [code] "Predicate.the (divmod_rel_i_i_o_o 1705 42)"
   796 value [code] "Predicate.the (divmod_rel_i_i_o_o 1705 42)"
   797 
   797 
   798 subsection {* Transforming predicate logic into logic programs *}
   798 subsection {* Transforming predicate logic into logic programs *}
   799 
   799