Add syntax for type cast premise. Fix factorization to work with separate constructor wrapping variable name in As construct.
Eliminate unnecessary type hierarchy (any, term and node types).
Add typing rule for var@pat construct
Type rule for cast construct. Cast refines type of the variable.