Open aljce opened 4 years ago
Actually this usually isn't helpful because you often have equalities as arguments to your proof. Like in:
sym : ∀ {x y} {n} → x ≈ y [mod n ] → y ≈ x [mod n ]
Actually I do have uses for this.
Here are some oddities. The solver can solve:
lemma : ∀ a b c d → a * b + c * (a * d) ≈ a * (b + c * d)
lemma = solve ACR
but not
lemma : ∀ a b c d e → a * b + c * (a * e + b * d + (c * (d * e))) ≈ (a + c * d) * (b + c * e)
lemma = solve ACR
The solver needs the coefficients to compute to work properly. i.e. 1 + 2 should compute to 3, otherwise the solver won’t be able to solve the identity.
That doesn’t mean you can’t work with generic rings, though (although it will need some extra work). The solver is designed so that it can have a different type for the coefficients as for the target ring. You could use this in combination with a free ring (that is homomorphic to a generic ring) as the coefficient. You would need to update the reflection code as well to work with this.
The reason your second example can’t be solved is that it requires computation on the indices, while the first does not. I’m not sure of the specifics exactly, but it looks like the second is probably looking for a 1 + 1 = 2
somewhere.
Hope that helps!
Errors with
Is it possible to solve rings that aren't currently instantiated