lean4-htt/src
Leonardo de Moura b4a290a203 refactor: simp Step and Simproc types
Before this commit, `Simproc`s were defined as `Expr -> SimpM (Option Step)`, where `Step` is inductively defined as follows:
```
inductive Step where
  | visit : Result → Step
  | done  : Result → Step
```
Here, `Result` is a structure containing the resulting expression and a proof demonstrating its equality to the input. Notably, the proof is optional; in its absence, `simp` assumes reflexivity.

A simproc can:
- Fail by returning `none`, indicating its inapplicability. In this case, the next suitable simproc is attempted, along with other simp extensions.
- Succeed and invoke further simplifications using the `.visit`
constructor. This action returns control to the beginning of the
simplification loop.
- Succeed and indicate that the result should not undergo further
simplifications. However, I find the current approach unsatisfactory, as it does not align with the methodology employed in `Transform.lean`, where we have the type:

```
inductive TransformStep where
  /-- Return expression without visiting any subexpressions. -/
  | done (e : Expr)
  /--
  Visit expression (which should be different from current expression) instead.
  The new expression `e` is passed to `pre` again.
  -/
  | visit (e : Expr)
  /--
  Continue transformation with the given expression (defaults to current expression).
  For `pre`, this means visiting the children of the expression.
  For `post`, this is equivalent to returning `done`. -/
  | continue (e? : Option Expr := none)
```
This type makes it clearer what is going on. The new `Simp.Step` type is similar but use `Result` instead of `Expr` because we need a proof.
2024-02-01 16:58:54 +11:00
..
bin feat: Web Assembly Build (#2599) 2023-10-04 09:04:20 +02:00
cmake
include/lean feat: synchronous execution of task continuations (#3013) 2024-01-25 13:54:20 +00:00
Init feat: elidible subterms (#3201) 2024-01-31 17:28:29 +00:00
initialize chore: fix more typos in comments 2023-10-08 14:37:34 -07:00
kernel feat: add bitwise operations to reduceNat? and kernel (#3134) 2024-01-11 18:12:45 +00:00
lake feat: lake: improved platform information & control (#3226) 2024-01-31 23:56:33 +00:00
Lean refactor: simp Step and Simproc types 2024-02-01 16:58:54 +11:00
library feat: System.Platform.target (#3207) 2024-01-24 12:11:00 +00:00
runtime fix: do not throw C++ heartbeat exceptions in pure functions (#3224) 2024-01-29 20:27:27 +00:00
shell feat: Web Assembly Build (#2599) 2023-10-04 09:04:20 +02:00
util fix: remove target triple parameter from FFI that no longer exists in the Lean API 2023-11-02 23:21:47 +01:00
CMakeLists.txt feat: System.Platform.target (#3207) 2024-01-24 12:11:00 +00:00
config.h.in
githash.h.in
Init.lean feat: simproc declaration vs simproc attribute 2024-01-09 12:57:15 +01:00
lean-toolchain doc: VS Code dev setup (#2961) 2023-11-30 08:35:03 +00:00
Lean.lean feat: add linter.deprecated option to silence deprecation warnings 2022-10-23 21:11:57 +02:00
lean.mk.in feat: LLVM bc separation for CMake 2023-11-02 23:21:47 +01:00
Leanc.lean fix: default for MACOSX_DEPLOYMENT_TARGET (#2598) 2023-10-02 13:03:19 +00:00
stdlib.make.in chore: set warningAsError in CI only (#3030) 2023-12-06 08:18:39 +00:00
stdlib_flags.h chore: update domain 2023-09-20 15:13:27 -07:00
version.h.in feat: System.Platform.target (#3207) 2024-01-24 12:11:00 +00:00