Added some functions to semantics, used them in Syntax