Semantic Parsing Algorithm