format logic.pl