Skip to content

Commit

Permalink
[TC] dummy clauses are local to sections
Browse files Browse the repository at this point in the history
This aims to solve the compilation error produced by the compilation of

```
Module foo.
  Class B (i : nat).

  Section s.
    (* Class with coercion depending on section parameters *)
    Context (A : Type).
    Class C (i : A) : Set := {
      x (x : A) :: B 3
    }.
  End s.
End foo.
```
  • Loading branch information
FissoreD committed Sep 30, 2024
1 parent b1f9905 commit 05c9567
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/tc/theories/tc.v
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ Elpi Accumulate lp:{{
Class Bird := IsAnimal :> Animal.
```
The instance IsAnimal of type Bird -> Animal, is compiled before the
predicate for Bird; hence, Bird is not recognize as a premise of IsAnimal.
predicate for Bird; hence, it is not possible to add the premise
tc-Bird for the IsAnimal instance...
This problem is due to the order in which the registers for Instance and
Class creation are run.
The solution is to do the following two jobs when a class C is created:
The solution is to do the following jobs when a class C is created:
1: for every projection P of C, if P is a coercion, the wrongly
compiled instance is replaced with a `dummy` clause.
2: the predicate for the class is created
Expand Down

0 comments on commit 05c9567

Please sign in to comment.