added some functions to turn sentence into logical form