Leonardo de Moura
8a2dd414ff
feat: inductive command
...
cc @Kha
2020-07-15 16:32:23 -07:00
Leonardo de Moura
98d8520158
feat: infer binder annotations for constructor parameters
2020-07-15 16:32:23 -07:00
Leonardo de Moura
9876f91cf7
chore: cleanup
2020-07-15 16:32:23 -07:00
Leonardo de Moura
ab2ea30a19
feat: replace fvars with consts
2020-07-15 16:32:23 -07:00
Leonardo de Moura
4fbef3b6ed
feat: collect and sort used level params
2020-07-15 16:32:23 -07:00
Leonardo de Moura
fbf59e0799
fix: register levelNames defined in the inductive command
2020-07-15 16:32:22 -07:00
Leonardo de Moura
26a35e3ab1
feat: updateResultingUniverse
2020-07-15 16:32:22 -07:00
Leonardo de Moura
94154113b5
feat: remove unused variables
2020-07-15 16:32:22 -07:00
Leonardo de Moura
4745519b54
feat: add Lean.Elab.CollectFVars
2020-07-15 16:32:22 -07:00
Leonardo de Moura
02de582941
feat: inductive datatype resulting universe inference
2020-07-14 17:18:58 -07:00
Leonardo de Moura
19b281e11e
fix: universe parameter generation
2020-07-14 17:15:15 -07:00
Leonardo de Moura
48c6c7c871
feat: report unused universe parameters
2020-07-14 16:40:56 -07:00
Leonardo de Moura
19595a0d03
fix: resolve pending universe metavars
2020-07-14 10:23:20 -07:00
Leonardo de Moura
455361d7d7
chore: update comment
2020-07-13 16:22:49 -07:00
Leonardo de Moura
d4ae4da222
feat: check given constructor resulting type
2020-07-13 16:22:49 -07:00
Leonardo de Moura
920343d36b
fix: unspecified constructor resulting type is not allowed inductive families
2020-07-13 16:22:49 -07:00
Leonardo de Moura
9960ca01f0
feat: reject protected constructors in a private inductive datatype
...
In a private inductive datatype, all constructors are private.
2020-07-13 16:22:49 -07:00
Leonardo de Moura
2744ae96bb
feat: check unsafe annotations in mutually inductive datatype declarations
2020-07-13 16:22:49 -07:00
Leonardo de Moura
2bf10b3d2c
feat: add inferMod field to CtorView
2020-07-13 16:22:49 -07:00
Leonardo de Moura
2cc2e71a53
feat: elaborate constructors
2020-07-13 16:22:49 -07:00
Leonardo de Moura
3fc6d8ce61
chore: improve constructor syntax
...
I think
```
inductive Foo
| private mk : Foo -> Foo
```
looks better than
```
inductive Foo
private | mk : Foo -> Foo
```
cc @Kha
2020-07-13 16:22:48 -07:00
Leonardo de Moura
d5f64f52a9
feat: add CtorView and modifier validation for inductive and constructors
2020-07-13 16:22:48 -07:00
Leonardo de Moura
6e12987dd9
feat: add declModifiers to constructor declarations
...
The goal is to allow users to attach doc strings and
`private/protected` to constructor declarations.
TODO: reject non applicable modifiers such as `unsafe` and `partial`.
cc @Kha
2020-07-13 16:22:48 -07:00
Leonardo de Moura
83431dc88e
feat: elaborate protected
2020-07-13 16:22:48 -07:00
Leonardo de Moura
667f2ed601
feat: resolve inductive and ctor names
2020-07-13 16:22:48 -07:00
Leonardo de Moura
cda11dea25
feat: check universe parameters in mutually recursive inductive declaration
2020-07-11 08:01:36 -07:00
Leonardo de Moura
2949586244
feat: add local declarations for mutually inductive datatypes
2020-07-11 08:01:36 -07:00
Leonardo de Moura
c8636f2bf7
chore: generalize withDeclId
2020-07-11 08:01:36 -07:00
Leonardo de Moura
f559576994
feat: inductive datatype header validation
2020-07-09 15:34:25 -07:00
Leonardo de Moura
36c971546c
feat: add elabMutualInductive
2020-06-26 15:41:09 -07:00
Leonardo de Moura
1ad5b5984a
feat: add Inductive.lean
2020-06-26 12:44:13 -07:00
Leonardo de Moura
1612097788
chore: move HashMap and HashSet to Std
2020-06-25 12:46:56 -07:00
Leonardo de Moura
2dd1d3ac3e
chore: move ShareCommon to Std
2020-06-25 11:45:29 -07:00
Leonardo de Moura
249bda16c0
chore: remove prelude commands from Lean package
2020-06-25 11:21:17 -07:00
Sebastian Ullrich
81376d3902
feat: allow capturing expected type in elab
...
/cc @leodemoura
2020-06-25 14:58:45 +02:00
Sebastian Ullrich
51e4b49ba6
feat: allow arbitrary syntax in macro/elab
2020-06-25 13:54:11 +02:00
Leonardo de Moura
80bb6f174d
feat: expand elab command
...
cc @Kha
2020-06-24 20:16:56 -07:00
Leonardo de Moura
0c089b8cbd
feat: elaborate syntaxAbbrev as a definition
...
@Kha I elaborated it as a definition. It works because we can now
reference Parser declarations in `syntax` command.
This change allowed us to replace `p.getArg 0` with `p` in the
`Websever` demo.
2020-06-16 15:43:17 -07:00
Leonardo de Moura
b01a923281
chore: throw error if a precedence is used with a parser declaration
2020-06-16 15:26:38 -07:00
Leonardo de Moura
3e028e3812
feat: allow syntax command to use existing parser declarations
...
@Kha Note that I had to change the pattern. After I replaced,
```
syntax text : child
```
with
```
syntax Prelim.text : child
```
Thus, I wrote
```
`(child|$t:text)
```
as
```
`(child|$t)
```
It works for this example, but it may be a problem in general.
2020-06-16 15:08:23 -07:00
Leonardo de Moura
f61e4ffbbd
chore: ParserDescr.parser ==> ParserDescr.cat
2020-06-16 13:40:16 -07:00
Sebastian Ullrich
4b84f8fa88
fix: nullary attributes in new frontend
2020-06-16 21:59:40 +02:00
Sebastian Ullrich
52d966f70b
feat: #eval
2020-06-16 10:41:42 -07:00
Leonardo de Moura
392d078011
feat: declare quotation parser for new parsing category
...
@Kha We can now delete the command
```
@[termParser] def childStxQuot : Parser :=
checkPrec maxPrec >> (node `Lean.Parser.Term.stxQuot $ symbol "`(child|" >> categoryParser `child 0 >> symbol ")")
```
from the web demo.
2020-06-16 10:38:37 -07:00
Leonardo de Moura
09eb27404f
chore: remove <$ and $> notation
...
cc @Kha
2020-06-15 14:52:31 -07:00
Leonardo de Moura
53dfd0d581
fix: expandMacroFns
...
We only keep trying other macros if the macro `m` produced
`unsupportedSyntax`. If the macro produced an error, we keep the
error.
@Kha This should fix the web demo.
2020-06-15 14:39:36 -07:00
Leonardo de Moura
77ce102baf
chore: use notationItem to remove $noprec* hack
2020-06-10 16:59:44 -07:00
Leonardo de Moura
610ced2de5
chore: appPrec => maxPrec
2020-06-10 16:50:09 -07:00
Leonardo de Moura
f838b80e03
fix: elaboration functions for parser! and tparser!
2020-06-10 16:42:42 -07:00
Leonardo de Moura
1477d23546
feat: remove ParserDescr.prec and update ParserDescr.trailingNode/ParserDescr.node
2020-06-10 14:57:55 -07:00