A Discrimination Algorithm inside Lambda-calculus