A mathematical foundation for the analysis of cladistic character compatibility