Conversation
|
Thanks, looks great! As you say if you could add some examples in |
| f : (x : ℚ) → Maybe (0ℚ ≡ x) | ||
| f (mkℚ (pos 0) 0 _) = just refl | ||
| f (mkℚ (pos 0) (suc _) _) = nothing | ||
| f (mkℚ (pos (suc _)) _ _) = nothing | ||
| f (mkℚ (negsuc _) _ _) = nothing |
There was a problem hiding this comment.
I'd be strongly tempted to lift this out as a definition in Data.Rational.Base, or else as a property (cf. Relation.Binary.WeaklyDecidable, for which we currently lack analogues at arity 0, 1) in Data.Rational.Properties.
Suggested name for such a refactored f: isZero-weakly-decidable?
That way, the imports for your solver modules then become very much simplified, in favour of those that are already currently used by the Rational.* modules...
... and there's (potentially) a downstream benefit in being able to reuse the definition of the corresponding Unnormalised function in the definition of this one.
There was a problem hiding this comment.
I have revived this work in #2965 and following this remark - the helper weak zero decidable were
moved into the corresponding Properties.
| where | ||
| f : (x : ℚᵘ) → Maybe (0ℚᵘ ≃ x) | ||
| f (mkℚᵘ (pos zero) _) = just (*≡* refl) | ||
| f (mkℚᵘ (pos (suc _)) _) = nothing | ||
| f (mkℚᵘ (negsuc _) _) = nothing |
|
Re: refactoring suggestion I think that it's possible that a 'better' approach is available via leveraging the construction in the (old) Now, equality on |
|
Re: refactoring (meta-comment) I think there's a tension, especially as a new developer, between contributing a PR with as 'small' footprint as possible (which can have as a consequence a 'wide' collection of For the PR at hand: The definitions of the |
There is clearly something wrong with RingSolvers in this PR. I defined very simple example here: but this fails with: Malformed call to solve.Expected target type to be like: ∀ x y → x + y ≈ y + x.Instead: _19
when checking that the expression unquote solve-∀ has type _19I think RingSolver does not like PropositionalEquality (but it does not like equality define in Rational.Properties either). I will try to see if I can create example with existing SemiringSolver for begin with and do refactoring proposed, by @jamesmckinna. |
|
Ok, so this is clearly very troubling behaviour! @oisdk do you have any insight here to offer? |
|
Given that the goal looks like a meta variable, it may be that the tactic is being Cf. the |
|
I've found some resources on semigroup/ring solvers in Agda:
I will try to traverse the subject and fold it into better understanding - what is the problem here. |
Changes
Fix #1879