src/HOL/ex/Rewrite_Examples.thy
changeset 60088 0a064330a885
parent 60079 ef4fe30e9ef1
child 60108 d7fe3e0aca85
equal deleted inserted replaced
60087:bc57cb0c5001 60088:0a064330a885
   252   val to = NONE
   252   val to = NONE
   253   val ct_ths = Rewrite.rewrite ctxt (pat, to) @{thms add.commute} ct
   253   val ct_ths = Rewrite.rewrite ctxt (pat, to) @{thms add.commute} ct
   254     |> Seq.list_of
   254     |> Seq.list_of
   255 \<close>
   255 \<close>
   256 
   256 
       
   257 section \<open>Regression tests\<close>
       
   258 
       
   259 ML \<open>
       
   260   val ct = @{cterm "(\<lambda>b :: int. (\<lambda>a. b + a))"}
       
   261   val (x, ctxt) = yield_singleton Variable.add_fixes "x" @{context}
       
   262   val pat = [
       
   263     Rewrite.In,
       
   264     Rewrite.Term (@{const plus(int)} $ Var (("c", 0), @{typ int}) $ Var (("c", 0), @{typ int}), [])
       
   265     ]
       
   266   val to = NONE
       
   267   val ct_ths = Rewrite.rewrite ctxt (pat, to) @{thms add.commute} ct
       
   268   val _ = case Seq.pull ct_ths of      NONE => ()
       
   269     | _ => error "should not have matched anything"
       
   270 \<close>
       
   271 
       
   272 
       
   273 
   257 end
   274 end
   258 
   275