Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TC] HO unification #571

Closed
wants to merge 81 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
e1f4964
compile pglobal instances
FissoreD Dec 14, 2023
cb673e5
Update tests
FissoreD Jan 4, 2024
16b1aac
WIP
FissoreD Jan 7, 2024
f85a894
restore coq-elpi-builtins
FissoreD Jan 8, 2024
db36d07
avoid declaring option twice
FissoreD Jan 8, 2024
bb3fbb7
fix Elpi Typecheck program
gares Jan 9, 2024
9ca7dd1
wip: hook for default instances
gares Jan 9, 2024
c1e46dc
unify-FO heuristic
gares Jan 9, 2024
3cf1aee
spec for HO cases
gares Jan 9, 2024
5daf079
silence
gares Jan 9, 2024
8ec9dd6
refactor
gares Jan 9, 2024
baedca2
HO support
gares Jan 9, 2024
7f8a26d
nicer error
gares Jan 9, 2024
24336f9
wip
gares Jan 9, 2024
65e73ea
Custom rules for eta-contraction in goal and sub-goals
FissoreD Jan 9, 2024
21dfec5
Command TC.Unfold to reason with alias (eg Nat.succ and S)
FissoreD Jan 9, 2024
1cdb613
some comments in create_tc_predicate
FissoreD Jan 9, 2024
8ed4dae
Term of correct type in HO unif with multiple lambdas
FissoreD Jan 10, 2024
b0bc947
fix the other eta contract
gares Jan 10, 2024
d268f7b
HO premises in their natural order
gares Jan 10, 2024
40e6458
minor changes
FissoreD Jan 10, 2024
fdd356c
typo
FissoreD Jan 10, 2024
481470c
hide of warning
FissoreD Jan 10, 2024
54b0b80
class with coercion in field
FissoreD Jan 10, 2024
124dc0f
silence warning
gares Jan 11, 2024
ac6aa08
fix unfold (you need beta)
gares Jan 11, 2024
474b317
a search fail raises a ltac.fail instead of a fatal error
FissoreD Jan 12, 2024
e1e8180
solve_TC good behavior on LtacFail
FissoreD Jan 12, 2024
390911d
is_available_option_name function
FissoreD Jan 12, 2024
e0c7109
Incorrectly compiled coercion instances are removed
FissoreD Jan 14, 2024
32c03f7
small fix
FissoreD Jan 14, 2024
bcb1a68
Elpi Typeclasses Debug command to print coq search
FissoreD Jan 14, 2024
80a438b
vscoq anomaly TC.Compiler already register replaced with warning
FissoreD Jan 14, 2024
dc75009
msg_debug -> msg_warning
FissoreD Jan 14, 2024
be93226
Replace api
FissoreD Jan 15, 2024
a5871fb
wip
gares Jan 15, 2024
9a0e4d9
wip-ho
gares Jan 15, 2024
87f78c3
wip-ho
gares Jan 15, 2024
0a5d611
sketch
gares Jan 15, 2024
b2f6149
Remove trivial debug message
FissoreD Jan 15, 2024
e024447
remove useless predicate
FissoreD Jan 15, 2024
e4076d6
clause for eta-contract is generated
FissoreD Jan 16, 2024
a2f3e7b
ho pred in a separate file
FissoreD Jan 16, 2024
30ec1a5
clean solver.elpi
FissoreD Jan 16, 2024
b393382
clean compiler.elpi
FissoreD Jan 16, 2024
b3a573a
OK: solve PF if in goal
FissoreD Jan 16, 2024
6368513
rework dependencies
FissoreD Jan 16, 2024
298282d
add of std.do!
FissoreD Jan 16, 2024
1c521ee
ho-link correction
FissoreD Jan 16, 2024
974c07f
HO unif progress
FissoreD Jan 17, 2024
518a11d
Merge branches of compile-aux
FissoreD Jan 18, 2024
8977181
todo
FissoreD Jan 18, 2024
f26fd0a
wip
FissoreD Jan 18, 2024
dc372ca
works
FissoreD Jan 19, 2024
d1773aa
works
FissoreD Jan 19, 2024
a4a8b53
works
FissoreD Jan 19, 2024
df90747
works
FissoreD Jan 19, 2024
be4c521
really works
FissoreD Jan 19, 2024
e98b7a4
kont 0
FissoreD Jan 19, 2024
926dcaf
kont 0
FissoreD Jan 19, 2024
855275b
nice
FissoreD Jan 19, 2024
a301ab0
nice
FissoreD Jan 19, 2024
91efc5d
nice
FissoreD Jan 19, 2024
21a2988
nice
FissoreD Jan 19, 2024
d8947c5
wip
FissoreD Jan 22, 2024
7eefcdf
Add TC.Pending_mode command
FissoreD Jan 23, 2024
c2bb1cb
Check pending mode arity
FissoreD Jan 23, 2024
bf156de
Modes stored in class predicate
FissoreD Jan 24, 2024
5ab3839
small refactor
FissoreD Jan 24, 2024
cbe7639
code clean
FissoreD Jan 24, 2024
1619ffa
align modes
FissoreD Jan 24, 2024
6d6bae6
wip
FissoreD Jan 24, 2024
f117890
trace_browser file name with unixgettimeofday
FissoreD Jan 25, 2024
10dcb49
declare-evar does nothing on evar in goal
FissoreD Jan 25, 2024
1484813
wip
FissoreD Jan 25, 2024
a70197b
Revert "align modes"
FissoreD Jan 26, 2024
e97c291
Clean solver.elpi
FissoreD Jan 26, 2024
4524b55
change error msg when section var are cleared
FissoreD Jan 26, 2024
3426c86
more comments + declare-evar-later
FissoreD Feb 6, 2024
8f9558f
Remove accumulate in elpi file to avoid rule duplication
FissoreD Feb 14, 2024
aff8ae9
some comments
FissoreD Feb 15, 2024
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
2 changes: 2 additions & 0 deletions _CoqProject
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
-arg -w -arg +elpi.deprecated
-arg -w -arg -ambiguous-extra-dep
-arg -w -arg -future-coercion-class-field

-R theories elpi
-Q examples elpi.examples
Expand Down
1 change: 1 addition & 0 deletions _CoqProject.test
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ tests/test_link_order_import3.v
tests/test_query_extra_dep.v
tests/test_toposort.v
tests/test_synterp.v
tests/test_checker.v
1 change: 1 addition & 0 deletions apps/NES/_CoqProject
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-Q ../../theories elpi
-I ../../src
-docroot elpi.apps
-arg -w -arg -ambiguous-extra-dep

-R theories elpi.apps
-Q elpi elpi.apps.NES
Expand Down
1 change: 1 addition & 0 deletions apps/coercion/_CoqProject
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-Q ../../theories elpi
-I ../../src
-docroot elpi.apps
-arg -w -arg -ambiguous-extra-dep

-R theories elpi.apps

Expand Down
1 change: 1 addition & 0 deletions apps/derive/_CoqProject
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-Q ../../theories elpi
-I ../../src
-docroot elpi.apps
-arg -w -arg -ambiguous-extra-dep

-R theories elpi.apps
-Q elpi elpi.apps.derive
Expand Down
1 change: 1 addition & 0 deletions apps/eltac/_CoqProject
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-Q ../../theories elpi
-I ../../src
-docroot elpi.apps
-arg -w -arg -ambiguous-extra-dep

# Hack to see derive even if it is not installed yet
-Q ../derive/theories elpi.apps
Expand Down
1 change: 1 addition & 0 deletions apps/locker/_CoqProject
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-Q ../../theories elpi
-I ../../src
-docroot elpi.apps
-arg -w -arg -ambiguous-extra-dep

-R theories elpi.apps
-Q elpi elpi.apps.locker
Expand Down
3 changes: 3 additions & 0 deletions apps/tc/_CoqProject
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-Q ../../theories elpi
-I ../../src
-docroot elpi.apps
-arg -w -arg -ambiguous-extra-dep

-R theories elpi.apps.tc
-R elpi elpi.apps.tc
Expand All @@ -20,3 +21,5 @@ theories/db.v
theories/add_commands.v
theories/tc.v
theories/wip.v

-arg -w -arg -ambiguous-extra-dep
14 changes: 11 additions & 3 deletions apps/tc/_CoqProject.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
-arg -w -arg -Not-added
# -arg -w -arg -Not-added
-arg -w -arg -TC.hints
-arg -w -arg -ambiguous-extra-dep
-arg -w -arg -future-coercion-class-field
-arg -bt

# Hack to see Coq-Elpi even if it is not installed yet
-Q ../../theories elpi
Expand All @@ -10,8 +13,6 @@
-R tests elpi.apps.tc.tests
-I src

tests/classes_declare.v

# Register (de-)activation
tests/register/f1.v
tests/register/f2.v
Expand All @@ -21,6 +22,13 @@ tests/hook_test.v

tests/auto_compile.v

tests/test_HO.v
tests/test_eta.v
tests/test_unfold.v
tests/test_coercion.v
tests/test_tc_declare.v
tests/test_pending_mode.v

# Import order of instances
tests/importOrder/sameOrderCommand.v
tests/importOrder/f1.v
Expand Down
7 changes: 7 additions & 0 deletions apps/tc/a.elpi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:index (0 3)
pred a o:int, i:list int.

a 3 [3].
a X [X] :- X = 2.

main :- a X [X], print X.
2 changes: 1 addition & 1 deletion apps/tc/elpi/alias.elpi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* license: GNU Lesser General Public License Version 2.1 or later */
/* ------------------------------------------------------------------------- */

accumulate base.


pred alias i:term, o:term.

Expand Down
26 changes: 25 additions & 1 deletion apps/tc/elpi/base.elpi
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,28 @@ do [].
do [P|PS] :- P, do PS.

pred do-once i:prop.
do-once A :- A, !.
do-once A :- A, !.

pred if-true i:prop, i:prop.
if-true A B :- if A B true.

pred if-false i:prop, i:prop.
if-false A B :- if A true B.

pred std.findall-unary i:(A -> prop), o:list A.
std.findall-unary P L :-
std.findall (P _) V,
std.map V (x\y\ P y = x) L.

pred print-repeat-aux i:int, i:string, o:string.
print-repeat-aux 0 _ S :- coq.say S.
print-repeat-aux N A S :- N > 0, N1 is N - 1,
S' is A ^ S, print-repeat-aux N1 A S'.

pred print-repeat i:int, i:string.
print-repeat I S :- print-repeat-aux I S "".

pred split-at-not-fatal i:int, i:list A, o:list A, o:list A.
split-at-not-fatal 0 L [] L :- !.
split-at-not-fatal N [X|XS] [X|LN] LM :- !, N1 is N - 1,
split-at-not-fatal N1 XS LN LM.
Loading
Loading