Commit 159ab26
committed
[new release] elpi (3.0.0)
CHANGES:
Requires Menhir 20211230 and OCaml 4.13 or above.
- Language:
- A **functional predicate** is a predicate that does not leave choice points
for any of its calls. A functional predicate can have preconditions, eg
`map` is functional if the higher order argument also is. Functional
predicates (with preconditions) can be miscalled, in that case they behave
as relations.
- The matching operator used for input arguments is now also available as a
builtin predicate named `pattern_match`.
- API:
- New `Utils.ground_check` and `Utils.cmp_term` (already available as builtins)
- Change `Constants.declare_global_symbol` takes an optional `variant` argument.
- Parser:
- The `fprop` keyword is akin to `prop` but signals the predicate is functional
- The `:functional` attribute flags `pred`icates as functional (equivalent to `func ...`).
- Dedicated syntax for functional signatures:
`func name(comma_sep(types_of_inputs)* [-> comma_sep(types_of_outputs*)]`.
Example: The signature of `map` is `func map list A, (func A -> B) -> list B`
- New `[external] symbol name : type [= "variant"]` is a synonim of `type` and can be
used to ascribe a type to a symbol. External symbols must be matched by
a declaration in OCaml, and when the symbol is overloaded the variant
label is used for the matching (additionally to the name).
- Compiler:
- The type checker is in charge of resolving all symbols, overloaded or not,
to a `Symbol.t` datatype that gathers the `Loc.t` where it is defined
(and it can be defined at multiple places, e.g. OCaml + Elpi, or twice
in Elpi). This data can be used to implement jump-to-def and the like in
modern UIs.
- The `determinacy_checker` statically analyzes whether a predicate labeled
as functional adheres to its signature.
- The elaboration of `{spilling}` has been moved to a dedicated file.
- CHR rules are typechecked (finally)
- Macros are typechecked. This paves the way to make them live in name
spaces and possibly globally available, but it is not implemented yet.
- Runtime:
- Builtin predicates now have a dedicated node when they are part of the
Elpi language, i.e. Cut, And, Impl, RImpl, Pi, Sigma, Eq, Match, Findall,
Delay.
- Symbols part of the Elpi language (other than the builtins) also have
a dedicated status, i.e. As, Uv, ECons, ENil although As and Uv do not
have a dedicated node in the AST, while ENil and ECons do have it.1 parent 11a5300 commit 159ab26
1 file changed
+90
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
0 commit comments