394 (* Lift and instantiate rule *) |
394 (* Lift and instantiate rule *) |
395 val {maxidx, ...} = rep_thm st; |
395 val {maxidx, ...} = rep_thm st; |
396 val paramTs = map #2 params |
396 val paramTs = map #2 params |
397 and inc = maxidx+1 |
397 and inc = maxidx+1 |
398 fun liftvar (Var ((a,j), T)) = |
398 fun liftvar (Var ((a,j), T)) = |
399 Var((a, j+inc), paramTs ---> incr_tvar inc T) |
399 Var((a, j+inc), paramTs ---> Logic.incr_tvar inc T) |
400 | liftvar t = raise TERM("Variable expected", [t]); |
400 | liftvar t = raise TERM("Variable expected", [t]); |
401 fun liftterm t = list_abs_free |
401 fun liftterm t = list_abs_free |
402 (params, Logic.incr_indexes(paramTs,inc) t) |
402 (params, Logic.incr_indexes(paramTs,inc) t) |
403 fun liftpair (cv,ct) = |
403 fun liftpair (cv,ct) = |
404 (cterm_fun liftvar cv, cterm_fun liftterm ct) |
404 (cterm_fun liftvar cv, cterm_fun liftterm ct) |
405 val lifttvar = pairself (ctyp_of sign o incr_tvar inc); |
405 val lifttvar = pairself (ctyp_of sign o Logic.incr_tvar inc); |
406 val rule = Drule.instantiate |
406 val rule = Drule.instantiate |
407 (map lifttvar envT', map liftpair cenv) |
407 (map lifttvar envT', map liftpair cenv) |
408 (lift_rule (st, i) thm) |
408 (lift_rule (st, i) thm) |
409 in |
409 in |
410 if i > nprems_of st then no_tac st |
410 if i > nprems_of st then no_tac st |