fix(library/elaborator): the context of auxiliary metavariables created in the imitation step was incorrect

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(library): add function free_var_range for computing the range [0, R) of free variables occurring in an expression

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(kernel/free_vars): improve has_free_vars function, it produces better results for expressions containing metavariables

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(library/elaborator): use improved has_free_vars in the elaborator

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
fix(library/elaborator): remove nasty hack, this hack was throwing away the local context at process_meta_app_core

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
fix(library/elaborator): remove is_neutral_abstraction hack, and bug at process_metavar_lift_abstraction

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
fix(kernel/context): make context remove more robust

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>