A Logic-Based Approach to Reverse Engineering Tools Production