911 | shrink' ls lev ts prfs prf = |
911 | shrink' ls lev ts prfs prf = |
912 let |
912 let |
913 val prop = (case prf of PThm (_, _, prop, _) => prop | PAxm (_, prop, _) => prop |
913 val prop = (case prf of PThm (_, _, prop, _) => prop | PAxm (_, prop, _) => prop |
914 | Oracle (_, prop, _) => prop | _ => error "shrink: proof not in normal form"); |
914 | Oracle (_, prop, _) => prop | _ => error "shrink: proof not in normal form"); |
915 val vs = vars_of prop; |
915 val vs = vars_of prop; |
916 val (ts', ts'') = splitAt (length vs, ts) |
916 val (ts', ts'') = chop (length vs) ts; |
917 val insts = Library.take (length ts', map (fst o dest_Var) vs) ~~ ts'; |
917 val insts = Library.take (length ts', map (fst o dest_Var) vs) ~~ ts'; |
918 val nvs = Library.foldl (fn (ixns', (ixn, ixns)) => |
918 val nvs = Library.foldl (fn (ixns', (ixn, ixns)) => |
919 insert (op =) ixn (case AList.lookup (op =) insts ixn of |
919 insert (op =) ixn (case AList.lookup (op =) insts ixn of |
920 SOME (SOME t) => if is_proj t then ixns union ixns' else ixns' |
920 SOME (SOME t) => if is_proj t then ixns union ixns' else ixns' |
921 | _ => ixns union ixns')) |
921 | _ => ixns union ixns')) |