Added invariant exp AST and extraction.
Fixed examplev2 apps.
Added better error message when failing to extract invariant.