src/HOL/Tools/Function/context_tree.ML
changeset 32035 8e77b6a250d5
parent 31775 2b04504fcb69
child 33037 b22e44496dc2
equal deleted inserted replaced
32034:70c0bcd0adfb 32035:8e77b6a250d5
   114 
   114 
   115        val tt' = Logic.mk_equals (Pattern.rewrite_term thy [(Free fvar, h)] [] t, t)
   115        val tt' = Logic.mk_equals (Pattern.rewrite_term thy [(Free fvar, h)] [] t, t)
   116        val (c, subs) = (concl_of r, prems_of r)
   116        val (c, subs) = (concl_of r, prems_of r)
   117 
   117 
   118        val subst = Pattern.match (ProofContext.theory_of ctx) (c, tt') (Vartab.empty, Vartab.empty)
   118        val subst = Pattern.match (ProofContext.theory_of ctx) (c, tt') (Vartab.empty, Vartab.empty)
   119        val branches = map (mk_branch ctx o Envir.beta_norm o Envir.subst_vars subst) subs
   119        val branches = map (mk_branch ctx o Envir.beta_norm o Envir.subst_term subst) subs
   120        val inst = map (fn v => (cterm_of thy (Var v), cterm_of thy (Envir.subst_vars subst (Var v)))) (Term.add_vars c [])
   120        val inst = map (fn v =>
       
   121         (cterm_of thy (Var v), cterm_of thy (Envir.subst_term subst (Var v)))) (Term.add_vars c [])
   121      in
   122      in
   122    (cterm_instantiate inst r, dep, branches)
   123    (cterm_instantiate inst r, dep, branches)
   123      end
   124      end
   124     handle Pattern.MATCH => find_cong_rule ctx fvar h rs t)
   125     handle Pattern.MATCH => find_cong_rule ctx fvar h rs t)
   125   | find_cong_rule _ _ _ [] _ = sys_error "Function/context_tree.ML: No cong rule found!"
   126   | find_cong_rule _ _ _ [] _ = sys_error "Function/context_tree.ML: No cong rule found!"