Releases: LPCIC/elpi
Releases · LPCIC/elpi
3.4.2
3.4.1
3.4.0
CHANGES:
-
Parser:
- New
->-based syntax forpred, analogous to the newfuncone. E.g.func append list A, list A -> list A. pred appendR -> list A, list A, list A.
- New
-
Compiler:
- Fix
=!=>that was adding a head cut, rather than a tail cut, in some
cases - Fix compilation bug concerning
Loc.tbeing erroneously compared
- Fix
3.3.1
3.3.0
3.2.0
3.1.0
CHANGES:
Requires Menhir 20211230 and OCaml 4.13 or above.
- Language:
- Change: constraints must be functions. Hence
declare_constraintonly
suspends functional predicated and CHR rules can only generate
determinitic goals. - New: the
funcsyntax now supports variadic functions as infunc f int, int -> int.. . f N D Q :- Q is N div D. f N D Q R :- f N D Q, R is N mod D.
- Change: constraints must be functions. Hence
3.0.1
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
mapis 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 namedpattern_match.
- A functional predicate is a predicate that does not leave choice points
-
API:
- New
Utils.ground_checkandUtils.cmp_term(already available as builtins) - Change
Constants.declare_global_symboltakes an optionalvariantargument.
- New
-
Parser:
- The
fpropkeyword is akin topropbut signals the predicate is functional - The
:functionalattribute flagspredicates as functional (equivalent tofunc ...). - Dedicated syntax for functional signatures:
func name(comma_sep(types_of_inputs)* [-> comma_sep(types_of_outputs*)].
Example: The signature ofmapisfunc map list A, (func A -> B) -> list B - New
[external] symbol name : type [= "variant"]is a synonim oftypeand 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).
- The
-
Compiler:
- The type checker is in charge of resolving all symbols, overloaded or not,
to aSymbol.tdatatype that gathers theLoc.twhere 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_checkerstatically 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.
- The type checker is in charge of resolving all symbols, overloaded or not,
-
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.
- Builtin predicates now have a dedicated node when they are part of the