Commit ba9f7cd
authored
Process complex LHS patterns in function rules (#4757)
Eliminates patterns that are not supported by Lean from the LHS of
function rules.
For example, since `_List_` is a function, instead of matching the last
item of a list as
```lean
noncomputable def _2ede380 : SortList → Option SortInt
| _List_ _Gen0 (ListItem (SortKItem.inj_SortInt I)) => ...
| _ => none
```
the following definition is generated:
```lean
noncomputable def _2ede380 : SortList → Option SortInt
| _Pat0 => match (ListHook SortKItem).split _Pat0.coll 0 1 with
| some ([], _Gen0, [SortKItem.inj_SortInt I]) => ...
| _ => none
```
where `split` is repsonsible for deconstructing the list into prefix,
middle and suffix.1 parent eebad2b commit ba9f7cd
File tree
5 files changed
+428
-10
lines changed- pyk
- src/pyk
- klean
- template/{{ cookiecutter.package_name }}/{{ cookiecutter.library_name }}
- kore
5 files changed
+428
-10
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
0 commit comments