equal
deleted
inserted
replaced
105 val env as (Tenv, tenv) = Pattern.match thy (inc tm1, tm) (Vartab.empty, Vartab.empty); |
105 val env as (Tenv, tenv) = Pattern.match thy (inc tm1, tm) (Vartab.empty, Vartab.empty); |
106 val prems' = map (pairself (Envir.subst_term env o inc o ren)) prems; |
106 val prems' = map (pairself (Envir.subst_term env o inc o ren)) prems; |
107 val env' = Envir.Envir |
107 val env' = Envir.Envir |
108 {maxidx = fold (fn (t, u) => Term.maxidx_term t #> Term.maxidx_term u) prems' ~1, |
108 {maxidx = fold (fn (t, u) => Term.maxidx_term t #> Term.maxidx_term u) prems' ~1, |
109 tenv = tenv, tyenv = Tenv}; |
109 tenv = tenv, tyenv = Tenv}; |
110 val env'' = fold (Pattern.unify thy o pairself (lookup rew)) prems' env'; |
110 val env'' = fold (Pattern.unify (Context.Theory thy) o pairself (lookup rew)) prems' env'; |
111 in SOME (Envir.norm_term env'' (inc (ren tm2))) |
111 in SOME (Envir.norm_term env'' (inc (ren tm2))) |
112 end handle Pattern.MATCH => NONE | Pattern.Unif => NONE) |
112 end handle Pattern.MATCH => NONE | Pattern.Unif => NONE) |
113 (sort (int_ord o pairself fst) |
113 (sort (int_ord o pairself fst) |
114 (Net.match_term rules (Envir.eta_contract tm))) |
114 (Net.match_term rules (Envir.eta_contract tm))) |
115 end; |
115 end; |