The following is not an “answer” to your problem, but may be help in further thoughts.
, (,.RC .Inc ), , , , , , " ". .
, , , , , DCU, .
, .Pas .DCU, , DCU.
, , X% .Pas .
, , , . , , A, Z, , A , Z . , , , , .
, .Pas USES-, , .Pas , . DCU .
Btw, , , , Prolog ( Amzi Prolog Delphi, ).