lean2/src/tests/library/occurs.cpp
Leonardo de Moura e769c26800 refactor(kernel): move files that don't need to be in the kernel
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-04-25 18:30:40 -07:00

29 lines
687 B
C++

/*
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
*/
#include "util/test.h"
#include "kernel/abstract.h"
#include "library/occurs.h"
using namespace lean;
static void tst1() {
expr f = Const("f");
expr a = Const("a");
expr b = Const("b");
expr T = Type;
lean_assert(occurs(f, f));
lean_assert(!occurs(a, f));
lean_assert(occurs(a, f(a)));
lean_assert(occurs("a", f(a)));
lean_assert(!occurs("b", f));
lean_assert(!occurs(a, Fun({a, T}, f(a))));
}
int main() {
save_stack_info();
tst1();
return has_violations() ? 1 : 0;
}