This kind of guarantee can always be established with a run-time check. If you want to solve constraints involving 'lor', then you need to use an external solver like Z3. But it would require a lot of effort.
I would suggest using a run-time check for now. And you could always come back to fix it later if really needed. On Sun, May 23, 2021 at 6:28 PM David Smith <sodabana...@gmail.com> wrote: > > Hey, I have a small convenience function that takes 3 5 bit bit numbers to > produce a 15 bit color, that's guaranteed to be <0x8000. > > Now, apparently the typechecker doesn't know much about `lor`. Is there > any way I could say "hey trust me, if these three numbers are < 0x20 then > the result is < 0x8000"? > > Thanks in advance. > > -- > You received this message because you are subscribed to the Google Groups > "ats-lang-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to ats-lang-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ats-lang-users/4f5589ed-b80d-4662-918c-ac1fa81d04c9n%40googlegroups.com > <https://groups.google.com/d/msgid/ats-lang-users/4f5589ed-b80d-4662-918c-ac1fa81d04c9n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "ats-lang-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqwSYfL-jmkB4%2BiTrKWy2rZDWxwYzsZWb%2BecqqRTkhoyA%40mail.gmail.com.