From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.ada Subject: Re: SPARK and integer arithmetic Date: Mon, 19 Sep 2016 00:14:55 -0700 Organization: A noiseless patient Spider Message-ID: <87lgyobbtc.fsf@jester.gateway.pace.com> References: <87poo1a57p.fsf@mid.deneb.enyo.de> <87twddw0i4.fsf@mid.deneb.enyo.de> <87poo1atpb.fsf@jester.gateway.pace.com> <877fa9ugy2.fsf@mid.deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="2aed369a7b4699bde3e169ff4d831123"; logging-data="15105"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+g1V3xU2dZi62mtj/a8ldT" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:XwRTxoTNRa+Vyg1T8LC3MbVAniA= sha1:R+jrXs/5dR29p9DIk0f5V0JTJds= Xref: news.eternal-september.org comp.lang.ada:31815 Date: 2016-09-19T00:14:55-07:00 List-Id: Florian Weimer writes: >>> perhaps there is a way to express the unbounded arithmetic ... > The actual formula in the program uses modular arithmetic, so I don't > think this can be represented efficiently in Presburger arithmetic. Oh I didn't understand, I saw the modular arithmetic in your post but thought you wanted to change it to unbounded arithmetic. Still though, if the modulus is a known constant, then a=b(mod m) means a+mx=b+my for some x and y, and multiplication by the constant m can be converted to repeated additions with depth log2(m). So it's still in Presburger arithmetic, with even that seeming like overkill.