Closed clayrat closed 7 years ago
Another approach might be using with
blocks:
bipMinus : (a, b: Bip) -> Bip
bipMinus a b with (bimMinus a b)
bipMinus a b | BimP c = c
bipMinus a b | _ = U
As these automatically get elaborated into helper functions, it also allows rewrite
s to work, but we can't proceed with aux
for the same reason - with
blocks can't be referred to.
My preference is for using top-level helper functions instead of where
or with
, but since you're writing 99% of the proofs at the moment I think you should choose ultimately whatever style suits you best whilst we work around idris-lang/Idris-dev#4001. In any case, a top-level helper function is what I used in my Bin
proof.
What I'm saying is that top-level helpers is apparently the only way forward for now, where
/with
is unusable due to https://github.com/idris-lang/Idris-dev/issues/3991
If we define
bipMinus
asthen the proof of
subSuccR
simplifies a lot, since now we can userewrite
:So I propose to redefine all
case
-using functions (bipMinus
,bipMin
,bipMax
,bipSqrtRemStep
etc) to this form, at least until https://github.com/idris-lang/Idris-dev/issues/4001 is fixed.Another inconvenience is that we can't put these helpers under
where
, as there currently is no way to refer to them (see https://github.com/idris-lang/Idris-dev/issues/3991).