Commit graph

18027 commits

Author SHA1 Message Date
Leonardo de Moura
87e109aeba feat: add isDefEqDelta 2019-11-19 17:11:20 -08:00
Leonardo de Moura
8173755251 feat: add support for unifying offset terms 2019-11-19 10:19:37 -08:00
Leonardo de Moura
5567de24e8 chore: improve Exception.functionExpected 2019-11-19 07:43:23 -08:00
Leonardo de Moura
201d8a97d2 feat: add Check.lean 2019-11-19 07:09:21 -08:00
Sebastian Ullrich
ab42cffad2 refactor: rename all Default.lean files except for Init/Default.lean 2019-11-19 13:52:21 +01:00
Sebastian Ullrich
3980194fbf chore: more assertions and old code 2019-11-19 12:55:02 +01:00
Sebastian Ullrich
11809d23a9 chore: remove outdated assertion
/cc @leodemoura
2019-11-19 10:56:35 +01:00
Sebastian Ullrich
c93fb5c4b2 chore: interpreter: rename misleading accessor 2019-11-19 09:36:59 +01:00
Leonardo de Moura
ba648e419a chore: update stage0 2019-11-18 20:04:59 -08:00
Leonardo de Moura
7c1cf9b6d3 chore: use extern lean_name_eq
It uses pointer equality to improve performance.
We will eventually be able to do it in Lean as soon as we re-activate
the tactic framework.
2019-11-18 20:02:55 -08:00
Leonardo de Moura
0f2172fab5 chore: fix tests 2019-11-18 20:02:41 -08:00
Leonardo de Moura
4f98ba1cf7 chore: update stage0 2019-11-18 19:54:06 -08:00
Leonardo de Moura
269f20efe8 fix: ensure C++ and Lean use the same hash for Name 2019-11-18 19:54:05 -08:00
Leonardo de Moura
68bcb4bf96 chore: fix tests 2019-11-18 19:54:05 -08:00
Leonardo de Moura
a2c13733a7 chore: update stage0 2019-11-18 19:54:05 -08:00
Leonardo de Moura
46adfcfdb6 refactor: Name fully implemented in Lean 2019-11-18 19:54:05 -08:00
Leonardo de Moura
1dad28af79 chore: remove temp hack 2019-11-18 19:54:05 -08:00
Leonardo de Moura
cba3dabcec chore: update stage0 2019-11-18 19:54:05 -08:00
Leonardo de Moura
b09fb4348d chore: rename Name constructors 2019-11-18 19:54:05 -08:00
Leonardo de Moura
aa04175401 chore: update stage0 2019-11-18 19:54:05 -08:00
Leonardo de Moura
043e011b72 fix: bug at USet
@Kha: I found the bug. The issue was at `USet`. The argument is a
usize scalar. So, we should use `var` instead of `eval_arg`.
2019-11-18 19:51:53 -08:00
Leonardo de Moura
38d9a7c063 test: interpreter bug
@Kha Could you please take a look at this repro?
When I use the compiler,
```
./run.sh usizeBug.lean
```
I get the expected answer: `2`.
When I use the interpreter,
```
../../bin/lean --run usizeBug.lean
```
I get `1`. I found the problem today, and managed to isolate the
problem to this small repro.
2019-11-18 18:12:33 -08:00
Leonardo de Moura
352e568b15 doc: zmod example 2019-11-18 12:45:53 -08:00
Leonardo de Moura
d9ca07fca8 chore: replace DecidableEq Name with HasBeq Name 2019-11-18 12:45:53 -08:00
Leonardo de Moura
fbf4fd27cb chore: update stage0 2019-11-18 12:45:53 -08:00
Leonardo de Moura
3bc61e7ee9 chore: remove special support for Name in the equation compiler 2019-11-18 12:45:53 -08:00
Leonardo de Moura
85a1994bbb chore: use mkNameStr and mkNameNum for building quoted names 2019-11-18 12:45:53 -08:00
Sebastian Ullrich
353b511e9b chore: CI: close ctest's stdin
Apparently CMake reverted auto-closing stdin for ctest in a recent release because people relied on the old behavior...

Perhaps we should add this to all test scripts instead, but this CI fix is easier
2019-11-17 21:24:33 +01:00
Leonardo de Moura
5e42b1df09 chore: remove dead constants 2019-11-17 09:46:56 -08:00
Leonardo de Moura
3093b1264c chore: update stage0 2019-11-17 08:53:51 -08:00
Leonardo de Moura
033f781724 chore: fix tests 2019-11-17 08:53:18 -08:00
Leonardo de Moura
d88813feff fix: lean_level_depth export 2019-11-17 08:51:42 -08:00
Leonardo de Moura
66895b2c94 chore: mkLevelZero => levelZero, mkLevelOne => levelOne 2019-11-17 08:33:37 -08:00
Leonardo de Moura
5aa2b06bf4 chore: update stage0 2019-11-17 08:27:43 -08:00
Leonardo de Moura
b78ac59523 refactor: Level fully implemented in Lean 2019-11-17 08:24:09 -08:00
Leonardo de Moura
110438edd7 refactor: use mkLevel* instead of Level constructors 2019-11-17 07:17:58 -08:00
Leonardo de Moura
c40aed1628 chore: typo 2019-11-16 12:28:52 -08:00
Leonardo de Moura
587e4f199b chore: update stage0 2019-11-16 12:24:19 -08:00
Leonardo de Moura
92a89a07ff chore: Expr.CachedData => Expr.Data 2019-11-16 12:23:39 -08:00
Leonardo de Moura
1d9a76ae45 chore: fix tests
Remark: weird discrepancies in the new typeclass module.
Ignoring for now since it was not integrated yet.
2019-11-16 12:19:27 -08:00
Leonardo de Moura
2bf69c539e chore: update stage0 2019-11-16 12:14:34 -08:00
Leonardo de Moura
a3ccbe66cf refactor: Expr fully implemented in Lean
No hidden fields.
2019-11-16 12:10:49 -08:00
Leonardo de Moura
3ae5c2f2e4 chore: remove old comment 2019-11-15 14:11:50 -08:00
Leonardo de Moura
052c2c24dc chore: update stage0 2019-11-15 14:08:56 -08:00
Leonardo de Moura
85092412c7 refactor: remove Expr.FVar hack
@Kha @dselsam:
This hack was preventing us from making `Expr` a "real" Lean type.
This was bad for a few reasons:
- It was hard to extend/modify `Expr` in Lean since we would also have
to modify the C++ code that creates the `Expr` objects with the hidden
fields.
- `Expr.lam` and `Expr.forallE` were not following the Lean layout
standard where we sort fields by size. @Kha: recall we used that to
avoid a UB. The issue with `Expr.lam` and `Expr.forallE` is that they
have a "visible" field (`BinderInfo`), which is smaller than
hidden fields such as hash code.
- `Expr.fvar` had only one field at `Expr.lean,` but four behind the
scenes.

I added a new constructor `Local` that is only accessible from C++.
It is only used in legacy code we inherited from Lean2.
We will eventually delete it.

This refactoring was quite painful since many parts of the codebase
were mixing the new `Expr.fvar` with the old `Expr.local`.
I doubt I would be able to do it without the new staging framework
@Kha built.

BTW, some of the patches are horrible. I didn't care much since we
are going to deleted the super ugly files. That being said,
you should expect new weird bevaior due to `Expr.fvar` vs `Expr.local`.

Next step: use the new `ExprCachedData` to make all `Expr` hidden visibles
accessible from Lean.

checkpoint
2019-11-15 14:04:26 -08:00
Leonardo de Moura
0926dee83b chore: remove dead code 2019-11-15 11:53:09 -08:00
Leonardo de Moura
aea02eb1f8 chore: fix MVar refactoring issues 2019-11-15 10:04:42 -08:00
Leonardo de Moura
356192aeb9 chore: update stage0 2019-11-15 10:04:42 -08:00
Leonardo de Moura
d9f3b4bf63 refactor: remove Expr.mvar hidden field 2019-11-15 10:04:42 -08:00
Sebastian Ullrich
aa380ff505 chore: update stage0 path in script/pre-push 2019-11-15 18:29:57 +01:00