Algorithmic foundations of terminological knowledge representation systems