<div dir="ltr"><br><div><div>module _ (c x y d : ℕ) where</div><div> private e = c + (y * y + y)</div><div> data Foo : Set where</div><div> foo1 : x < e → Foo</div><div> foo2 : x > e → (x ≡ e + d) → Foo</div></div><div><br></div><div>/ Ulf</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 27, 2017 at 8:24 PM, Sergei Meshveliani <span dir="ltr"><<a href="mailto:mechvel@botik.ru" target="_blank">mechvel@botik.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">People,<br>
<br>
consider the declaration like<br>
<br>
data Foo (c x y d : ℕ) : Set<br>
where<br>
let e = c + (y * y + y)<br>
<br>
foo1 : x < e → Foo c x y d<br>
foo2 : x > e → (x ≡ e + d) → Foo c x y d<br>
foo3 : ...<br>
<br>
<br>
Agda rejects it. And the programmer is forced to set several times the<br>
expanded expression for e in several data constructors.<br>
<br>
I wrote<br>
<br>
private expr = \c y -> c + (y * y + y)<br>
<br>
data Foo (c x y d : ℕ) : Set<br>
where<br>
foo1 : x < expr c y → Foo c x y d<br>
foo2 : x > expr c y → (x ≡ (expr c y) + d) → Foo c x y d<br>
foo3 : ...<br>
<br>
Can anybody, please, suggest any better way out?<br>
<br>
Thanks,<br>
<br>
------<br>
Sergei<br>
<br>
______________________________<wbr>_________________<br>
Agda mailing list<br>
<a href="mailto:Agda@lists.chalmers.se">Agda@lists.chalmers.se</a><br>
<a href="https://lists.chalmers.se/mailman/listinfo/agda" rel="noreferrer" target="_blank">https://lists.chalmers.se/<wbr>mailman/listinfo/agda</a><br>
</blockquote></div><br></div>