package fourpack is type u_x01z is ('X','0','1','Z'); -- u_x01z is unresolved type u_x01z_vector is array (natural range <>) of u_x01z; function resolve4 (s:u_x01z_vector) return u_x01z; subtype x01z is resolve4 u_x01z; -- x01z is a resolved subtype which uses the resolution function resolve4 type x01z_vector is array (natural range <>) of x01z; end fourpack; package body fourpack is type x01z_table is array (u_x01z,u_x01z) of u_x01z; constant resolution_table : x01z_table := ( ('X','X','X','X'), ('X','0','X','0'), ('X','X','1','1'), ('X','0','1','Z')); function resolve4 (s:u_x01z_vector) return u_x01z is variable result : u_x01z := 'Z'; begin if (s'length = 1) then return s(s'low); else for i in s'range loop result := resolution_table(result,s(i)); end loop; end if; return result; end resolve4; end fourpack;