Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
d6e08b1
[elpi] minimalistic integration
gares Jun 9, 2020
ace121c
fixes, minimal tc work
agontard May 18, 2026
3f8a6c4
try storing compiled instances in the signature state
agontard May 19, 2026
c09d30a
fix call to tc instance compiler
agontard May 20, 2026
788904c
comment out trace
agontard May 20, 2026
b2d47b6
solver is now aware of the context and used in the typechecker
agontard May 21, 2026
a988fd0
re-trigger unification constraints after progress from the tc solver
agontard May 21, 2026
1f1f935
further tests with classes
agontard May 21, 2026
0ade4b9
fix typing query/rewrite tactic
agontard May 22, 2026
6138e21
better error messages
agontard May 22, 2026
f23b974
translate pos and loc
agontard May 22, 2026
cd42013
remove out folder
agontard May 22, 2026
edd5821
use pos in add_tc_instance to improve error messages
agontard May 22, 2026
857d1d0
clean and document modifications
agontard May 23, 2026
f0a2d29
use pos in embeddings + document src/core/elpi_lambdapi.ml
agontard May 23, 2026
37141e5
clean and document elpi_handle.ml
agontard May 23, 2026
b50b551
deal with existing + add support for elpi accumulate
agontard May 25, 2026
93bfb6b
fix parsing of existing
agontard May 25, 2026
e8e8b33
fix
agontard May 25, 2026
2688cdb
let Elpi handle its errors properly
agontard May 26, 2026
2db123a
better error messages
agontard May 26, 2026
f9ff4b8
fix readback_assignments
agontard May 27, 2026
ce098d1
clean up
agontard May 28, 2026
37ea804
cleanup
agontard May 29, 2026
2795da6
remove quotation
agontard May 29, 2026
01984ba
properly find tcsolver.elpi
agontard May 29, 2026
7025b87
fix
agontard May 29, 2026
0cc3d65
fix
agontard May 29, 2026
4e372cc
merge master branch with submodule exporting former sig_state functions
agontard May 29, 2026
e4b5f59
document syntax changes
agontard May 29, 2026
c964e99
merge master
agontard May 30, 2026
be9cbd5
update docs
agontard May 30, 2026
6f3477a
use Unif.instantiate within the tcsolver
agontard May 31, 2026
06ea1aa
parse terms with elpi variables in lambdapi quotation
agontard Jun 1, 2026
b0b09d8
remove trailing spaces
agontard Jun 1, 2026
8cbd33d
pass make sanity_check
agontard Jun 1, 2026
dcefe38
fix parsing of elpi variables
agontard Jun 2, 2026
517e501
Merge branch 'master' of https://github.com/Deducteam/lambdapi into e…
agontard Jun 2, 2026
6309c1a
classes in rocq export
agontard Jun 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ libraries/zenon_modulo
.DS_Store
*.map
*.log
_opam
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
### Added

- Decimal numbers can now be qualified by a module path so that one can use the decimal notation with different types in the same file.
- Support for typeclasses using Elpi
* Added syntax: two new symbol modifiers `typeclass` and `instance` and individual commands `typeclass/instance qid` to declare a previously defined symbol as a typeclass or instance.
* typeclass instance search is used in tactics, symbol definitions, and the `type` query, upon encountering any unsolvable hole (wildcard or implicit argument)

### Changed

Expand Down
1 change: 1 addition & 0 deletions doc/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Here are some of the features of Lambdapi:
- support for unicode (UTF-8) and user-defined infix operators
- symbols can be declared commutative, or associative and commutative
- some arguments can be declared as implicit: the system will try to find out their value automatically
- a typeclass solver, written in Elpi, allows to add rules to help the system infer implicit arguments
- symbol and rule declarations are separated so that one can easily define inductive-recursive types or turn a proved equation into a rewriting rule
- support for interactive resolution of typing goals, and unification goals as well, using tactics
- a rewrite tactic similar to the one of SSReflect in Coq
Expand Down
30 changes: 30 additions & 0 deletions doc/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,18 @@ Finaly, here is an example of strictly-positive inductive type:
assert p a b c x ⊢ ind_𝕆 p a b c (s x) ≡ b x (ind_𝕆 p a b c x);
assert p a b c x y ⊢ ind_𝕆 p a b c (l x) ≡ c x (λ y, ind_𝕆 p a b c (x y));

.. _instance:

``instance``
---------------

The command ``instance`` allows to declare as typeclass instance (see **Typeclass modifiers**) a previously defined symbol.

::

symbol bool_zero : zero_class bool ≔ is_zero true; // true is neutral for or/xor
instance bool_zero;

.. _notation:

``notation``
Expand Down Expand Up @@ -479,6 +491,12 @@ the system with additional information on its properties and behavior.
canonical term headed by ``f`` is of the form ``f t₁ (f t₂ (f t₃ …
tₙ) … )``. Moreover, in both cases, we have ``t₁ ≤ t₂ ≤ … ≤ tₙ``.

- **Typeclass modifiers** (adding rules to the typeclass solver)

- ``instance``: if the conclusion of the type of the symbol is a typeclass,
adds a rule to automatically use the symbol to obtain an object of that type.
- ``typeclass``: allows to declare instances of that symbol (must be of type ``T → TYPE`` for some type ``T``)

- **Exposition modifiers** define how a symbol can be used outside the
module where it is defined. By default, the symbol can be used
without restriction.
Expand Down Expand Up @@ -541,6 +559,18 @@ arguments must be explicitly given.
**Notations**: Some notation can be declared for a symbol using the
commands :ref:`notation` and :ref:`builtin`.

.. _typeclass:

``typeclass``
---------------

The command ``typeclass`` allows to declare as typeclass (see **Typeclass modifiers**) a previously defined symbol.

::

symbol nonempty : U → TYPE;
typeclass nonempty; //One can now declare instances of [nonempty x] for any [x]

.. _unif_rule:

``unif_rule``
Expand Down
Loading
Loading