[SemanticCheck] check for duplicate definition of variable or parameter