Early Prolog code; Separated into modules.