Use of Prolog for building protocol design tools