I tried two solutions. 

One is what I do now. I add to check the getExpectedSort instead of getSort in resolveSyntaxPredicate. This solution cause less problem. There are some test cases which was failed. However, all definitions can be compiled.

The other solution is to modify the variable class and set default getExpectedSort to be the same as getSort instead of null. Then I change here to check getExpectedSort only. However, this solution will cause some definitions to be failed. Some definitions cannot be parsed correctly (there will introduces ambiguity). It means that somehow the concrete parser relies on the fact that getExpectedSort is null in the beginning.