Text this: Logical derivation and integrating legal knowledge bases: basic algorithms