Efficient algorithms for alternating pushdown systems : application to certificate chain discovery with threshold subjects