Revert "Revert "simplification in substitution and function evaluation""
Merge pull request #1209 from kframework/revert-1208-revert-1205-master

Revert "Revert "simplification in substitution and function evaluation""