package elpi
- v1.12.0 (Nov 2020)
- v1.11.4 (Aug 2020)
- v1.11.3 (Aug 2020)
- v1.11.2 (May 2020)
- v1.11.1 (May 2020)
- v1.11.0 (May 2020)
- v1.10.2 (February 2020)
- v1.10.1 (February 2020)
- v1.10.0 (February 2020)
- v1.9.1 (January 2020)
- v1.9.0 (January 2020)
- v1.8.0 (October 2019)
- v1.7.0 (September 2019)
- v1.6.0 (July 2019)
- v1.5.2 (July 2019)
- v1.5.1 (July 2019)
- v1.5.0 (July 2019)
- v1.4 (June 2019)
- v1.3 (June 2019)
- v1.2 (April 2019)
- v1.1.1 (October 2018)
- v1.1 (September 2018)
- v1.0 (April 2018)
- LPAR 2015 (Jul 12, 2015)
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=c3b1a329866b56b7decc937434b9b3a559ba0851952b15eccc70031460b0e5c7
sha512=ce00b18f224896246b22ed34c7b8b5bec304fef726e9ba3a5c82a1a40c09a38d1600ab3b0f9ca567ff471803ea57a9de00a40d22b5828d25d930ed8ff29a7fd9
doc/CHANGES.html
v3.4.2 (October 2025)
Requires Menhir 20211230 and OCaml 4.13 or above.
Runtime:
- Fix bug concerning CHR rules firing on non-fully-dereffed terms
v3.4.1 (September 2025)
Requires Menhir 20211230 and OCaml 4.13 or above.
Compiler:
- Fix extend_signature, was not updating the symbol table
v3.4.0 (September 2025)
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.
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
v3.3.1 (September 2025)
Requires Menhir 20211230 and OCaml 4.13 or above.
Tests:
- compare json files semantically
v3.3.0 (September 2025)
Requires Menhir 20211230 and OCaml 4.13 or above.
Tooling:
- port to ppxlib 0.36.0
v3.2.0 (September 2025)
Requires Menhir 20211230 and OCaml 4.13 or above.
Language:
- Remove: the
fpropsort, use(func)instead
- Remove: the
v3.1.0 (August 2025)
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
v3.0.1 (July 2025)
Requires Menhir 20211230 and OCaml 4.13 or above.
Language:
- Improve error message for non deterministic atom
- Fix overlap check for
uvar F L as X - Fix allow
symbolas an identifier
Compiler:
- Fix build reproducibility
v3.0.0 (July 2025)
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 named
pattern_match.
- A functional predicate is a predicate that does not leave choice points for any of its calls. A functional predicate can have preconditions, eg
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 a
Symbol.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, to a
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.
v2.0.7 (January 2025)
Requires Menhir 20211230 and OCaml 4.13 or above.
Parser:
- New
elpi:if version <name> <op> <ma>.<mi>.<p>
- New
API:
- New
Setup.inittakes a?versionsdictionary to declare versions of external components - New
Utils.parse_version
- New
v2.0.6 (December 2024)
Requires Menhir 20211230 and OCaml 4.13 or above.
Compiler:
- Store timing info only optionally to restore build reproducibility
- Fix collision between kinds and types in namespace handling
v2.0.5 (December 2024)
Requires Menhir 20211230 and OCaml 4.13 or above.
Parser:
- Fix loc issues involving quotations
v2.0.4 (November 2024)
Requires Menhir 20211230 and OCaml 4.13 or above.
Type Checker:
- Fix caching issue, units are now type checked every time they are processed
v2.0.3 (November 2024)
Requires Menhir 20211230 and OCaml 4.13 or above.
Parser:
- Fix parsing of infix
==>so thatA,B ==> C,DmeansA, (B => (C,D))as it is intended to be.
- Fix parsing of infix
v2.0.2 (November 2024)
Requires Menhir 20211230 and OCaml 4.13 or above.
- Really fix tests on 32 bits systems
v2.0.1 (November 2024)
Requires Menhir 20211230 and OCaml 4.13 or above.
- Fix tests on 32 bits systems
v2.0.0 (November 2024)
Requires Menhir 20211230 and OCaml 4.13 or above.
Compiler:
Change the pipeline completely to make unit relocation unnecessary. Current phases are (roughly):
Ast.program—[RecoverStructure]—>Ast.Structured.programAst.Structured.program—[Scope,Quotation,Macro]—>Scoped.program(akaAPI.Compile.scoped_program)Scoped.program—[Flatten]—>Flat.programFlat.program—[Check]—>CheckedFlat.program(akaAPI.Compile.compilation_unit)CheckedFlat.program—[Spill,ToDbl]—>Assembled.program
Steps 4 and 5 operate on a base, that is an
Assembled.programbeing extended.ToDblis in charge of allocating constants (numbers) for global names and takes place when the unit is assembled on the base. These constants don't need to be relocated as in the previous backend that would allocate these constants much earlier.- Change compilation units can declare new builtin predicates
- Fix macros are hygienic
- New type checker written in OCaml. The new type checker is faster, reports error messages with a precise location and performs checking incrementally when the API for separate compilation is used. The new type checker is a bit less permissive since the old one would merged together all types declaration before type checking the entire program, while the new one type checks each unit using the types declared inside the unit or declared in the base it extends, but not the types declared in units that (will) follow it.
- Remove the need of
typeabbrv string (ctype "string")and similar - New type check types and kinds (used to be ignored).
API:
- Change quotations generate
Ast.Term.tand notRawData.t. The data typeAst.Term.tcontains locations (for locating type errors) and has named (bound) variables and type annotations inAst.Type.t. - New
Compile.extend_signatureandCompile.signatureto extend a program with the signature (the types, not the code) of a unit - New
Ast.Loc.tcarries a opaque payload defined by the host application - Remove
Query, onlyRawQueryis available (orCompile.query)
- Change quotations generate
Parser:
- Remove legacy parser
- New
% elpi:if version op A.B.Cand% elpi:endiflexing directives - New warning for
A => B, Cto be disabled by putting parentheses aroundA => B.
Language:
- New infix
==>standing for application but with "the right precedence™", i.e.A ==> B, CmeansA => (B, C). - New
predis allowed in anonymous predicates, eg:pred map i:list A, i:(pred i:A, o:B), o:list Bdeclares that the first argument ofmapis a predicate whose first argument is in input and the second in output. Currently the mode checker is still in development, annotations for higher order arguments are ignored. - New attribute
:functionalcan be passed to predicates (but not types). For example,:functional pred map i:list A, i:(:functional pred i:A, o:B), o:list Bdeclaresmapto be a functional predicate iff its higher order argument is functional. Currently the determinacy checker is still in development, these annotations are ignored. - New
funckeyword standing for:functional pred. The declaration above can be shortened tofunc map i:list A, i:(func i:A, o:B), o:list B. - New type annotations on variables quantified by
pias inpi x : term \ ... - New type casts on terms, as in
f (x : term) - New attribute
:untypedto skip the type checking of a rule.
- New infix
Stdlib:
- New
std.list.init N E Lbuilds a listL = [E, ..., E]with lengthN - New
std.list.make N F Lbuilds the listL = [F 0, F 1, ..., F (N-1)] - New
tripledata type with constructortripleand projectionstriple_1...
- New
Builtins:
- Remove
string_to_term,read,readterm,quote_syntax
- Remove
REPL:
- Remove
-no-tc,-legacy-parser,-legacy-parser-available - New
-document-infix-syntax
- Remove
v1.20.0 (September 2024)
Requires Menhir 20211230 and OCaml 4.08 or above.
Language:
- attribute
:removeto remove a clause from the program
- attribute
Compiler:
- Build the index at assembly time, rather than optimization time. This makes compilation slower, but startup faster.
- Adding clauses before the type/mode declaration of a predicate is now forbidden, since they are immediately inserted in the index and the type/mode declaration can change the index type
v1.19.6 (August 2024)
Requires Menhir 20211230 and OCaml 4.08 or above.
Runtime:
- Fix bug in unification code for "automatic intro" (as in the intro tactic) of UVar arguments
v1.19.5 (July 2024)
Requires Menhir 20211230 and OCaml 4.08 or above.
Compiler:
- Improve performance of separate compilation
CHR:
- Syntax extension for constraint declaration.
- This aims to avoid the
overlappingclique error - Example:
constraint c t x ?- p1 p2 { rule (Ctx ?- ...) <=> (Ctx => ...) } c,tandxare the symbols which should be loaded in the rule of the constraint and should be considered as symbols composing the context (Ctx) under whichp1andp2are used.
v1.19.4 (July 2024)
Requires Menhir 20211230 and OCaml 4.08 or above.
Stdlib:
- Add
oncepredicate
- Add
Build:
- New
make tests PROMOTE=true
- New
Parser:
- Change purge
_build/xxxfrom paths once files are resolved in order to have locs point to the sources and not their copy in_build
- Change purge
v1.19.3 (June 2024)
Requires Menhir 20211230 and OCaml 4.08 or above.
Linter:
- Fix regex for linearity check,
Foo_Barwas silently ignored for linearity purpose
- Fix regex for linearity check,
Parser:
- Fix error message for named quotation
Runtime:
- Fix missing restriction
v1.19.2 (June 2024)
Requires Menhir 20211230 and OCaml 4.08 or above.
Builtins:
- Add
choose,min,max,foldandpartitionmethods to OCaml sets - Add
foldmethod to OCaml maps
- Add
Stdlib:
- Fix first argument of
std.revis in input
- Fix first argument of
Runtime:
- Fix discrimination tree retrieval
v1.19.1 (June 2024)
Requires Menhir 20211230 and OCaml 4.08 or above.
Language:
- New
:index (<arg-spec>) "index-type"where the index type can be Map, Hash or DTree
Runtime:
- Fix performance regression due to the fix to relocation in unification introduced in 1.19.0
- New list flattening in DTree index, that is term
app [t1,t2,t3]is indexed using the same DTree space/depth of termapp t1 t2 t3
v1.19.0 (May 2024)
Language:
- Change CHR syntax now accepts any term in eigen variables position
Ein sequentE : _ ?- _. Meaningful terms are lists or unification variables - Change CHR eigen variables are a list of names (used to be an integer)
Runtime:
- Fix CHR relocation/scope-checking for new goals
- Fix relocation error in unification on non-linear patterns with locally bound variables
v1.18.2 (January 2024)
Requires Menhir 20211230 and OCaml 4.08 or above.
Language:
- Change indexing for multiple arguments is now based on discrimination trees
- Change
:indexacecpts an optional string to force"Hash"based indexing
API:
- Change
clause_of_termaccepts a`Replacegrafting directive
v1.18.1 (December 2023)
Requires Menhir 20211230 and OCaml 4.08 or above.
Parser:
- Remove legacy parsing engine based on Camlp5
API:
- New
RawQuery.compile_ast, lets one set up the initial state in which the query is run, even if the query is given as an ast. - New
solution.relocate_assignment_to_runtimeto pass a query result to another query - New
BuiltInPredicate.FullHOfor higher order external predicates - New
BuiltInPredicate.HOAdaptorsformapandfilterlike HO predicates - New
Calc.registerto register operators forcalc(aka infixis)
Library:
- New
std.fold-right
Runtime:
- New clause retrieval through discrimination tree. This new index is enabled whenever the
:indexdirective selects only one argument with a depth> 1.
v1.18.0 (October 2023)
Requires Menhir 20211230 and OCaml 4.08 or above. Camlp5 8.0 or above is optional.
API:
- Change
Setup.inittakes a?state,?quotationsand?hooksdescriptors so that eachelpihandle is completely independent. - Change
State.declareis deprecated in favor ofState.declare_component - New
State.declare_componentlikeState.declarebut takes a~descriptor - New
State.new_state_descriptor - Change
Quotations.register_named_quotationnow takes a?descriptor - Change
Quotations.set_default_quotationnow takes a?descriptor - Change
Quotations.declare_backticknow takes a?descriptor - Change
Quotations.declare_singlequotenow takes a?descriptor - New
Quotations.new_quotations_descriptor - Change
RawData.set_extra_goals_postprocessingnow takes a?descriptor - New
RawData.new_hoas_descriptor
v1.17.4 (October 2023)
Requires Menhir 20211230 and OCaml 4.08 or above. Camlp5 8.0 or above is optional.
Parser:
- Fix location handling (used to ignore the char count of the initial loc)
v1.17.3 (September 2023)
Requires Menhir 20211230 and OCaml 4.08 or above. Camlp5 8.0 or above is optional.
Builtins:
- Change
unix.processreally disabled on OCaml 4.12
v1.17.2 (September 2023)
Requires Menhir 20211230 and OCaml 4.08 or above. Camlp5 8.0 or above is optional.
Builtins:
- Change
unix.processdisabled on OCaml 4.12
v1.17.1 (September 2023)
Requires Menhir 20211230 and OCaml 4.08 or above. Camlp5 8.0 or above is optional.
Builtins:
- New
unix.processdatatype andunix.process.open/closeAPIs
v1.17.0 (July 2023)
Requires Menhir 20211230 and OCaml 4.08 or above. Camlp5 8.0 or above is optional.
Compiler:
- Improve performance of separate compilation, in particular extending a program with more clauses. This change may break existing code which accumulates units containing the spilling of a predicate before the unit declaring the predicate signature.
Parser:
- Fix error message on unexpected keyword (was wrongly assuming the keyword was
)misleading the user)
Builtins:
- Change type of
declare_constrainttoany -> any -> variadic any propmaking it explicitly take at least two arguments
Trace browser:
- Fix elaboration of CHR rule with no condition
v1.16.10 (May 2023)
Requires Menhir 20211230 and OCaml 4.08 or above. Camlp5 8.0 or above is optional.
Elpi:
- New attribute
:replacewhich replaces a named clause by an unnamed one
- New attribute
Trace browser:
- Fix display of rule applied after failures
v1.16.9 (March 2023)
Requires Menhir 20211230 and OCaml 4.08 or above. Camlp5 8.0 or above is optional.
Trace browser:
- Fix CHR trace elaboration in case no rule applies
v1.16.8 (November 2022)
Requires Menhir 20211230 and OCaml 4.08 or above. Camlp5 8.0 or above is optional.
Dependencies:
- yojson 2.x, hence atd 2.10
v1.16.7 (October 2022)
Requires Menhir 20211230 and OCaml 4.08 or above. Camlp5 8.0 or above is optional.
Tests:
- Fix trace elaboration reference files
v1.16.6 (October 2022)
Requires Menhir 20211230 and OCaml 4.08 or above. Camlp5 8.0 or above is optional.
API:
- Fix
FlexData.Elpi.makewhen called with a name after compilation is over - Fix
RawQuery.mk_Argcan only be called at compile time - Fix anomaly in
Query.compile
- Fix
Trace:
- Fix printing of clauses
Doc:
- New setup based on Sphinx (still no extra contents)
v1.16.5 (July 2022)
Requires Menhir 20211230 and OCaml 4.08 or above. Camlp5 8.0 or above is optional.
Apis in the Builtin module:
- New
string_set,int_setandloc_setconversions - New
ocaml_set_convgiving both the declarations and the conversion for the provided OCamlSetmodule
- New
v1.16.4 (July 2022)
Requires Menhir 20211230 and OCaml 4.08 or above. Camlp5 8.0 or above is optional.
Tace Elaborator:
- Fix generation and elaboration of incomplete traces
Trace:
- New command line syntax
file://andtcp://to disambiguatehost:porton windows (old syntax still supported)
- New command line syntax
v1.16.3 (June 2022)
Requires Menhir 20211230 and OCaml 4.08 or above. Camlp5 8.0 or above is optional.
- Fix compilation on OCaml 5.0.0
v1.16.2 (June 2022)
Requires Menhir 20211230 and OCaml 4.08 or above. Camlp5 8.0 or above is optional.
Trace Elaborator:
- Fix json encoding of utf8 characters
- Fix runtime_id does not necessarily start at 0
v1.16.1 (June 2022)
Requires Menhir 20211230 and OCaml 4.08 or above. Camlp5 8.0 or above is optional.
Tests:
- Fix temp file creation for trace testing
v1.16.0 (June 2022)
Requires Menhir 20211230 and OCaml 4.08 or above. Camlp5 8.0 or above is optional.
Parser:
- Change the character count in the locations is now referring to the beginning of the text, and not the end
Printer:
- Fix regression not putting parentheses correctly around some applications
Doc:
- Clarify
InOutandioargdoc in the API file
- Clarify
Trace:
- New
src/trace.atddata type description for traces - New
src/trace_atd.tsread/write the trace inTypeScript - New
elpi-trace-elaboratortool to turn raw traces into cards to be displayed by a GUI. Work is in progress on theelpi-langVS Code extension. - Change the raw trace as output by the runtime is way more regular w.r.t. what is printed when a rule, or a built in rule/predicate is run, also the runtime_id attribute is now correctly set in all trace objects
- Fix the trace file is generated only once the trace is complete, so that tools can watch for the file creation reliably
- New
v1.15.2 (April 2022)
Requires Menhir 20211230 and OCaml 4.07 or above. Camlp5 8.0 or above is optional.
warning: The parser used by default is not backward compatible with 1.14.x
Parser:
- Change
pred foo i:A o:Bis valid,pred foo i:A o :Bis not. This change restores backward compatibility of existing code.
- Change
v1.15.1 (April 2022)
Requires Menhir 20211230 and OCaml 4.07 or above. Camlp5 8.0 or above is optional.
warning: The parser used by default is not backward compatible with 1.14.x
Build:
- Change legacy parser not built by default
- New
make config LEGACY_PARSER=1to enable it - New opam package
elpi-option-legacy-parserto install elpi with the legacy parser enabled
Parser:
- Fix missing infix
&(synonym of,) - New comma separator is optional in
preddeclarations, egpred i:A o:B.is valid syntax
- Fix missing infix
v1.15.0 (April 2022)
Requires Menhir 20211230 and OCaml 4.07 or above. Camlp5 is now optional.
warning: The parser used by default is not backward compatible
Parser:
New parser based on Menhir
- The grammar is not extensible anymore; token families are used to provide open ended infix symbols, see the documentation
- Custom error messages suggesting examples with a valid syntax
- Faster on large files
Old parser available via
-legacy-parser- Only compiled when
camlp5is available - Supports
infixand similar mixfix directives
- Only compiled when
API:
Parse.goal_from_stream->Parse.goal_fromParse.program_from_stream->Parse.program_fromParse.resolve_filenow takes an~elpiargumentSetup.initresolver argument takes a~unitinstead of~fileSetup.inittakes?legacy_parserSetup.legacy_parser_avaiablePp.query->Pp.programandPp.goal
REPL:
- New
-parse-term - New
-legacy-parser - New
-legacy-parser-available - Removed
-print-accumulated-files
- New
v1.14.3 (March 2022)
Tests:
test.exeunderstands--skip-catmake testsunderstandsSKIPfor the categories to skip
v1.14.2 (March 2022)
Dependencies:
- bump camlp5 to >= 8.0
v1.14.1 (February 2022)
Runtime:
- Fix unification dealing with a deep
AppArg(regression in 1.14.0)
- Fix unification dealing with a deep
v1.14.0 (February 2022)
Runtime/FFI:
- Fix handling of eta expanded unification variables. Many thanks to Nathan Guermond for testing this tricky case.
- Change
Rawdata.Constants.eqcto a builtin - Fix
Rawdata.Constants.cutchas always been a builtin - Fix compatibility with OCaml multicore, no more
PtrMap
API:
- New
FlexibleData.WeakMapto link unification variables with host data based on OCaml'sEphemeron - Change
Conversion.extra_goalsis now an extensible data type with one standard constructorConversion.Unifytaking two terms - New
RawData.set_extra_goals_postprocessingcan be used to post process the extra goals generated by an FFI call. One has to translate extensions to theextra_goalsdatatype toRawData.RawGoal(orConversion.Unify), but can also take global actions like cancelling out useless or duplicate goals - Change
Setup.initto take in input a~file_resolverrather than a list of~pathsand a~basedir. A custom file resolver can use some logic from the host application to find files, rather than an hardcoded one - New
Parse.std_resolverbuilding a standard resolver (based on paths) - Change signature of
Parse.resolve_filemaking?cwdexplicit
- New
Library:
- Better error messages in
std.nth declare_constraintis nowvariadic any prop, so that one can pass variables of different types as keys for the constraint. A list of variables (of the same type) is still supported.
- Better error messages in
v1.13.8 (November 2021)
Build:
- link
camlp5.gramlibas part ofelpi.cmxsso that the plugin can be loaded via findlib.
- link
v1.13.7 (July 2021)
Compiler:
- Fix bug in spilling when the spilled expression generates more than one argument.
v1.13.6 (June 2021)
API:
- Fix
std.findallis now calling a builtin which is able to produce solutions which contain eigenvariables and uvars as well. locis now printed using/as a path separator also on Windowsloc.fieldsto project alocinto the file, line, etc...
- Fix
v1.13.5 (May 2021)
API:
- New
prunewhich can be used to prune a unification variable - New
distinct_nameswhich checks if a list of arguments is in the pattern fragment
- New
v1.13.4 (May 2021)
- FFI: new
ioargC_flexwhich considers flexible terms as Data
v1.13.3 (May 2021)
- Bugifx: keep the state component
while_compilingeven when execution is over, since the API to allocate a new Elpi uvar needs it and Coq-Elpi may call this API while translating the solution to Coq
v1.13.2 (May 2021)
Build:
- drop ppxfindcache
- relax dependency on ocaml-migrate-parsetree
v1.13.1 (April 2021)
API:
- New
gc.getandgc.setfor reading and writing GC settings - New
gc.minor - New
gc.major - New
gc.full - New
gc.compact - New
gc.stat - New
gc.quick-stat - New
minandmaxoperators for theisbuiltin, they work onintandfloat - Rename
rex_match->rex.match - Rename
rex_replace->rex.replace - Rename
rex_split->rex.split - Rename
counter->trace.counter
- New
FFI:
- New
Builtin.unspectype to express optional input
- New
v1.13.0 (Feb 2021)
API:
- Fix
open_appendwas messing up file permissions - New
Parse.resolve_fileto find where the parser would find (or not) an accumulated file - Change signature of
Compile.unit,Compile.assembleandCompile.extendand improve their implementation. Units are now smaller and link/relocate faster (making~followsnot worth it)
- Fix
CI:
- Switch to Github actions and avsm/setup-ocaml. Now testing on Linux, MacOS and Windows. Artifacts produce binaries for all platforms and a benchmarks plot.
Library:
- New
if2 - New
std.map-ok - New
std.fold-map - New
std.intersperse - New
std.omap - New
std.take-last - New
std.string.concat
- New
v1.12.0 (Nov 2020)
FFI:
RawOpaqueData.cinnow returns a term and takesconstantsinto account. Whenever a value is represented with a named constant, the API grants that:- the value is embedded using that constant
- that constant is read back to the original value
API:
- New
Compile.extendto (quickly) add clauses to a program - New argument
?follows:programtoCompile.unitto have the unit be compiled using the very same symbol table (no new symbols can be declared by the unit in this case)
- New
Library:
- rename
map2_filter->map2-filter - new
map-filter
- rename
Build:
- use md5 (OCaml's digest) instead of sha1 (external utility)
v1.11.4 (Aug 2020)
- do not rely on /bin/bash in Makefile (helps on nix and freebsd)
v1.11.3 (Aug 2020)
- ppxfindcache: use
shasuminstead ofsha1sum - Parser: print file names in a VScode friendly way
- Fix opam package dependency on camlp5 and ppxlib
- Fix output of
-print*options to theelpicommand line utility - New builtin
rex_split(like OCaml'sStr.split)
v1.11.2 (May 2020)
- Nicer error message when compiling an applied spilling expression
- Fix opam package
- Trace: print locations in VScode friendly way
v1.11.1 (May 2020)
- Fix to the opam file, ppxlib is required to be >= 0.12.0 and ocaml-migrate-parsetree >= 1.6.0. Moreover we disable tests on Alpine linux
- Print locations in such a way that VScode can understand then, and click jump to type errors
v1.11.0 (May 2020)
Builtin:
varnow accepts 3 arguments, asconstantandname.
Trace:
- output facilities: json and tty on both files and network sockets
- trace messages to link goals to their subgoals
- spy points categorized into
useranddev - all trace points were revised and improved
- port to ppxlib
Build system:
- minimal build dependencies are now: camlp5 ocamlfind dune re
- cache ppx output in .ml format in
src/.ppcachethat Elpi can be buildt withoutppx_deriving.stdandelpi.trace.ppxusing a new tool inppxfindcache/ - vendor a copy of
ppx_deriving_runtime(suffix_proxy) to be used whenppx_derivingis not installed - generate custom
merlinppx.exeforsrc/and and patch.merlinfile so that one can have decent merlin support - make target
test-noppxto compile on an alternative opam switch
v1.10.2 (February 2020)
Builtin:
- occurs now accepts arguments of different types
API:
- expose beta reduction on raw terms
v1.10.1 (February 2020)
- make API.Builtin_checker module public so that third parties can reuse the source
v1.10.0 (February 2020)
Compiler:
- large refactoring to separate the table of global (statically initialized) symbols, the table of symbols of a program being compiled and the table of symbols used at runtime.
- API for separate compilation.
API:
- Setup.init now returns a handle to an elpi instance to be passed to many other APIs.
- New APIs Compile.unit and Compile.assemble for separate compilation.
- Constants.from_stringc and Constants.mk*S API removed in favor for Constants.declare_global_symbol (to be used in module initialization code).
v1.9.1 (January 2020)
Tests:
- Fix testing framework on runners pre 1.9.0.
Parser:
- Line numbers after quotations were wrong, since
\ninside quotations were not taken into account.
- Line numbers after quotations were wrong, since
Typing:
- Name alias abbreviations are not refolded in error messages. Eg.
typeabbrev x intdoes not take overint, whiletypeabbrev x (list int)does overlist int. - Fix type abbreviation refolding, was not working on some cases.
- Name alias abbreviations are not refolded in error messages. Eg.
Stdlib:
- Fix
isfunctionint_of_stringto do what it says - New
isfunctionrhc : string -> intcomputes the inverse ofchr
- Fix
v1.9.0 (January 2020)
Typing:
typeabbrevdeclarations are now taken into account and unfolded by the compiler. The type checker refolds abbreviations when printing error messages with the following caveat: when two type abbreviations can be refolded the last declared one wins.
Compiler:
@macroare no more accepted in types, sincetypeabbrevprovides the same functionality.- fix clash between builtin names and type names
accumulateis idempotent: accumulating the same file a second time has no effect.
FFI:
- built in predicate are allowed to not assign (not produce a value) for output and input-output arguments.
- input-output arguments are forced to be
Conversion.tof type'a ioarg, and recommended to wrap any nested type not able to represent variables inioarg. Egint optionshould beint ioarg option ioarg. In this way one can safely call these builtins with non-ground terms, such assome _, for example to assert the result is notnonebut without providing a ground term such assome 3. MLDatadeclarations forOpaqueDataare no more named using a macro but rather using a type abbreviation. This can break user code. The fix is to substitute@myopaquetypewithmyopaquetypeeverywhere.
Stdlib:
diagnosticdata type to be used as anioargfor builtins that can fail with a relevant error message. On the ML side one can usedElpi.Builtin.mkOKandElpi.Builtin.mkERROR "msg"to build its values.std.assert-ok!,std.forall-ok,std.do-ok!,std.lift-okandstd.while-ok-do!commodity predicates.- All operators for
calc(infix_ is _) now come with a type declaration.
v1.8.0 (October 2019)
Bugfix:
shorten foo.{ bar }.whenfoo.baris a builtin used to be miscompiled.elpi-typechecker.elpinow correclty stops printing warnings after it printed 10 (used to stop after he processed 10, that may not be the same thing, since some warnings are suppressed).
Parser:
- Interpret
-2(with no space) as the negative2not as the constant-2. This wayX is 3 - 2andY is 3 + -2are both valid.
- Interpret
FFI:
OpaqueDatanow requires a ternary comparison, not just equality.
Stdlib:
- new data type
cmpfor ternary comparison. std.setandstd.mapnow based on ternary comparison.
- new data type
Builtin:
cmp_termgiving an order on ground terms.ground_termto check if a term is ground.
v1.7.0 (September 2019)
Parser:
- Tolerate trailing
,in lists, eg[1,2,3,]is now parsed as[1,2,3]. - Error if the input of
Parse.goal_from_stringcontains extra tokens - Binary conjunction
&is now turned on the fly into the nary one,.
- Tolerate trailing
Bugfix:
- Nasty bug in pruning during higher order unification, see #36.
Discardis now considered a stack term, and is turned into an unification variable on heapification.API.RawData.looknow expandsUVarcorrectly
Stdlib:
setandmapfor arbitrary terms equipped with an order relation. Based on the code of OCaml'sMapandSetlibrary.- New API
map.removefor maps on builtin data.
FFI:
- New
ContextualConversionmodule andctx_readbacktype. In an FFI call one can specify a readback for the hypothetical context that is run once and its output is give to the ML code instead of the "raw" constraints and hyp list.
- New
API:
- Commodity functions in
Elpi.Builtinto export as built-in OCaml'sSet.SandMap.Sinterfaces (the output ofSet.MakeandMap.Make). All data is limited to be a closed term. Constants.andc2was removedFlexibleData.Elpi.maketakes no~lvlargument (it is always0)RawData.viewno more containsDiscardsince it is not an heap term
- Commodity functions in
Misc:
- Pretty printer for unification variable made re-entrant w.r.t. calls to the CHR engine (used to lose the mapping between heap cells and names)
- Pretty printer for solution abstracted over a context (part of the solution). In this way the result can be printed correctly even if the runtime has been destroyed.
- Default paths for finding
.elpifiles fixed after the switch to dune - A few more tests regarding unification, data structures and performance
v1.6.0 (July 2019)
Builtin:
same_term(infix==) for Prolog's non-logical comparison (without instantiation).setandmap A(Aonly allowed to be a closed term) onstring,intandlockeys.
Compiler:
- provide line number on error about duplicate mode declaration
- elpi-checker is faster and bails out after 10 seconds
FFI:
- allow
AlgebraicDatadeclarations to mixMandMSconstructors Conversion.tfor closed terms (no unification variable and no variables bound by the program)
- allow
Tests:
- typecheck all tests and measure type checking time
v1.5.2 (July 2019)
- Test suite: ship elpi-quoted_syntax.elpi
v1.5.1 (July 2019)
- Test suite: print the log of the first failure to ease debugging on third party CI.
v1.5.0 (July 2019)
Elpi 1.5 requires OCaml 4.04 or newer
REPL:
- type errors are considered fatal, pass
-no-tcto skip type checking. - use dune subst in order to implement
-versionflag to the command line utility.
- type errors are considered fatal, pass
Runtime:
- reset unification variables names map at each execution. This makes the names of variable printed in a reproducible way across executions.
FFI:
readbackis now as powerful asembedand can generate extra goals. The two types are now dual.
v1.4 (June 2019)
Elpi 1.4 requires OCaml 4.04 or newer
- Sources and build: Switch to dune, with a little make base wrapper. As a result of dune wrapping the library all sources are renamed from
elpi_x.mltox.ml, and each moduleElpi_Xis now available asElpi.X. In particular clients must now useElpi.APIandElpi.Builtin. FFI:
Conversion.TypeErrnow carries the depth at which the error is found, so that the term payload can be correctly printed.- Built in predicates are allowed to raise TypeErr in their body
BuiltInPredicate.Fullnow returns a list ofextra_goals, exactly asConversion.embeddoes making conversion code easy to call in the body of a predicate.
v1.3 (June 2019)
Elpi 1.3 requires OCaml 4.04 or newer
- API: Major reorganization: The Extend module has gone; the module structure is flat and ordered by complexity. Most modules are named after the kind of data they let one represent. Eg
AlgebraicData,OpaqueData,FlexibleDataor for low level accessRawOpaqueDataorRawDatafor naked terms. FFI:
RawData.mkAppLandRawData.mkAppSLhandy constructorscustom_staterenamedstate- No more
solutionin the type of builtin predicates but ratherconstraintsandstateexplicitly - Only one type of extensible state to that the same code can be used to generate the query at compile time and convert data at run time
- Unify
MLCDataandMLADTintoMLData AlgebraicData.tsupportsCfor containers, so that one can modeltype t = A | B of list tas
K("a", N, .. K("b",(C ((fun x -> list x),N)), ..- new
FlexibleTerm.Elpi.tandFlexibleTerm.Mapto represent Elpi's unification variables and keep a bijective map between them and any host application data. RawData.termcontains no moreUVar,AppUVar,ArgandAppArgbut onlyUnifVar of FlexibleTerm.Elpi.t * term list.- Simple GADT for describing a query. When a query is built that way, the
solutioncontains an output field holding data of the type described by the query.
Library:
- replace
mode (std.mem i i)with(std.mem i o): member can be assigned - separate
std.mem!andstd.mem
- replace
v1.2 (April 2019)
Fix:
- equality up-to eta on rigid terms (used to work only on flexible terms)
expand_*in charge of putting unification variables in canonical form was sometimes omitting some lambdas in one of its outputs
Language:
shortendirective to give short names to symbols that live in namespaces, e.g.shorten std.{ rev }lets one writerevinstead ofstd.rev- spilling understands implication and conjunction, e.g.
g { h => (a, f) }becomes(h => (a, f X)), g X - syntax of
.. as Xto bind subterms in the head of a clause changed precedence. In particularlam x\ B as Xbindslam x\ BtoX(instead of justB, as it was the case in previous versions) :index(...)attribute for predicates to select which argument(s) should be indexed and at which depth. Multi-argument indexing and deep-indexing are based on unification hashes, see ELPI.md for more details
Library:
predefined types:
boolwithttandffoption Awithnoneandsome Apair A Bwithpr A B,fstandsnd
predefined control structure:
if C T E
standard library (taken from coq-elpi) in the
stdnamespace.Conventions:
- all errors are signalled using one of the following two symbols that can be overridden by grafting clauses to hide them, namely
fatal-errorandfatal-error-w-data - the
!suffix is for (variants) of predicates that generate only the first solution - all predicates have mode declarations that follow their functional interpretation; variants keeping the relational interpretation are named using the
Rsuffix
Symbols:
debug-print,ignore-failure!,assert!,spy,spy!,unsafe-cast,length,rev,last,append,appendR,take,drop,drop-last,split-at,fold,fold2,map,map-i,map2,map2_filter,nth,lookup,lookup!,mem,exists,exists2,forall,forall2,filter,zip,unzip,flatten,null,iota,flip,time,do!,spy-do!,any->string,random.init,random.self_init,random.intWhile the predicates in the library are reasonably tested, their names and name spaces may change in the future, e.g. a specific name space for list related code may be created (as well for strings, debug, etc).
- all errors are signalled using one of the following two symbols that can be overridden by grafting clauses to hide them, namely
Builtin:
nameis now typed asany -> variadic any propto support the following two use cases:name Tsucceeds ifTis an eigenvariable (even if it is applied)name T HD ARGSrelatesT(an applied eigenvariable) to its head and arguments (as a list):pi f x y\ name (f x y) f [x,y]
- new builtin
constantworking asnamebut for non-eigenvariables haltnow accepts any term, not just stringsgetenvis now typed asstring -> option stringand never fails. The old semantics can be obtained by just writinggetenv Name (some Value)
API:
- new data type of locations in the source file:
Ast.Loc.t - exception
ParseError(loc, message)systematically used in the parsing API (no more leak of exceptions or data types from the internal parsing engine, i.e. no moreNotInPrologorStream.Errorexceptions) - type of quotations handlers changed: they now receive in input the location of the quoted text in order to be able to locate their own parsing errors
simplified term constructors:
mkConstsplit intomkGlobalandmkBound- variants with trailing
Staking astringrather than a global constant, e.g.mkAppS,mkGlobalS,mkBuiltinS mkBuiltinNameremoved (replace bymkBuiltinS)- constant
spillcexported: one can not build a term such asf {g a}by writingmkAppS "f" (mkApp spillc (mkAppS "g" (mkGlobalS "a") []) []
FFI:
to_termandof_termrenamed toembedandreadbackand made stateful. They can access the state, the hypothetical context and the constraint store (exactly asFullffi builtins do) and can return an updated state. Moreoverembedcan generate new goals (eg declaration of constraints) so that data that requires companion constraints fits the capabilities of the FFI (no need to simulate that by using aFullpredicate with arguments of typeany, as coq-elpi was doing)Arguments to builtin predicates now distinguish between
InML code must receive the data, type error is the data cannot be represented in MLOutML code receivedKeeporDiscardso that it can avoid generating data the caller is not binding backInOutML code receivesData of 'aorNoData. The latter case is when the caller passed_, while the former contains the actual data
- In the declaration of a data type for the FFI, the
tyfield is no more a string but an AST, so that containers (egval list : 'a data -> 'a list data) can more easily generate the composite type - New GADT to describe simple ADTs (with no binders)
Compiler:
- handling of locations for quotations
- better error reporting: many errors now come with a location
REPL:
- more structure in the output of
--helpincluding hints for the tracing options - new option
-print-passesto debug the compiler
Test Suite:
- rewritten using more OCaml & Dune and less bash & make. Requires
dune,cmdlinerandANSITerminalin order to build
v1.1.1 (October 2018)
Fix:
betawas not callingderef_*in all cases, possibly terminating reduction too early (and raising an anomaly)
v1.1 (September 2018)
Language:
CHR semantics conformed to the "revised operational semantics", that is roughly the following:
1 for each active constraint (just declared via declare_constraint)
2 for each rule
3 for each position j of the active constraint (from 0 to n)
4 for each permutation of constraints having the active at j
5 try apply the rule
- 6 remove constraints to be removed from the current set of permutations and the set of active or passive constraints
In Elpi 1.0 loops 3 and 2 were swapped (by mistake)
CHR keys refined. In
declare_constraints C KEYS:KEYSmust be a list of variables (no more special caseKEYS = Var)KEYS=[_,...]labels the constraint with the unique variable_. In other words_is a master key one can use to label constraints that share no other variable and that have to be combined together. The master key will never be assigned, hence it does not count for resumptionKEYS=[]is accepted with the following meaning: constraints with no key are never resumed automatically and are never combined with other constraints
Builtin:
haltis now typed asvariadic string propand the strings passed are printed when the interpreter halts
Aesthetic:
- bound variables are now printed as
c0, c1, ...instead ofx0, x1, ...to avoid ambiguity withX0, X1, ...on small/far-away screens
API changes:
rename:
custom_constraints->state(record field)syntactic_constraints->constraints(type)CustomConstraint->CustomState(module)
add:
StrMapandStrSet: exposeppandshow
alias:
Data.Extend.solution~Data.solution(cast:Data.Extend.of_solution)
Compilation:
- require re >= 1.7.2 (the version introducing
Re_str->Re.str)
Misc:
- improved some error messages, minor fixes to elpi-checker
v1.0 (April 2018)
Second public release, developed in tandem with coq-elpi and matita-elpi.
The programming language features syntactic constraints (suspended goals) and a meta language (inspired by CHR) to manipulate the constrain store.
There is an API for clients letting one drive the interpreter and extend the set of built-in predicates, register quotations and anti-quotations, etc.
The software is now built using findlib into a library. The standalone interpreter is just a regular client of the API.
LPAR 2015 (Jul 12, 2015)
First public release accompanying the paper ELPI: fast, Embeddable, λProlog Interpreter
- v1.12.0 (Nov 2020)
- v1.11.4 (Aug 2020)
- v1.11.3 (Aug 2020)
- v1.11.2 (May 2020)
- v1.11.1 (May 2020)
- v1.11.0 (May 2020)
- v1.10.2 (February 2020)
- v1.10.1 (February 2020)
- v1.10.0 (February 2020)
- v1.9.1 (January 2020)
- v1.9.0 (January 2020)
- v1.8.0 (October 2019)
- v1.7.0 (September 2019)
- v1.6.0 (July 2019)
- v1.5.2 (July 2019)
- v1.5.1 (July 2019)
- v1.5.0 (July 2019)
- v1.4 (June 2019)
- v1.3 (June 2019)
- v1.2 (April 2019)
- v1.1.1 (October 2018)
- v1.1 (September 2018)
- v1.0 (April 2018)
- LPAR 2015 (Jul 12, 2015)