implement semantic check for variable initialization