2013-08-14 19:00:11 +00:00
|
|
|
/*
|
|
|
|
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
|
|
Author: Leonardo de Moura
|
|
|
|
*/
|
2013-09-13 03:04:10 +00:00
|
|
|
#include "util/test.h"
|
|
|
|
#include "kernel/abstract.h"
|
2014-04-26 01:30:40 +00:00
|
|
|
#include "library/occurs.h"
|
2013-08-14 19:00:11 +00:00
|
|
|
using namespace lean;
|
|
|
|
|
|
|
|
static void tst1() {
|
|
|
|
expr f = Const("f");
|
|
|
|
expr a = Const("a");
|
|
|
|
expr b = Const("b");
|
2014-02-18 01:04:22 +00:00
|
|
|
expr T = Type;
|
2013-08-14 19:00:11 +00:00
|
|
|
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))));
|
2013-08-14 21:00:30 +00:00
|
|
|
}
|
|
|
|
|
2013-08-14 19:00:11 +00:00
|
|
|
int main() {
|
2013-12-07 22:59:21 +00:00
|
|
|
save_stack_info();
|
2013-08-14 19:00:11 +00:00
|
|
|
tst1();
|
|
|
|
return has_violations() ? 1 : 0;
|
|
|
|
}
|