Floating Point operations to check equivalence of algorithms

59 views
Skip to first unread message

Joana Cruz

unread,
Apr 22, 2021, 11:54:12 AM4/22/21
to tlaplus
Hi,

I have been trying to learn TLA+ and proposed myself as an exercise trying to model the algorithm that is usually used to get the norm of a vector: www.netlib.org/blas/dnrm2.f

However this algorithm makes use of division (SSQ = ONE + SSQ* (SCALE/ABSXI)**2).

I have been having mixed answers on whether division is possible or not. On the one hand in this post Checking equivalence of two algorithms (google.com) sounds like this should be doable. 

Older posts (as far as 2014) do say that division on real is not possible, but they also mention the possibility of developing it at some point. Since Z3 is now one of the back end provers for TLA+, I was wondering if it was the case that now real division is supported.

I come to realize that I needed to override the real definition and that enabled the algorithm to be correct when the vector entries are in the set {-1, 0, 1}.

But I wanted to expand this proof upto -5..5 at least. 

If it turns out that division is not possible, can anybody point me to any prover/tool where I could model this algorithm?

Thanks,

Joana


Stephan Merz

unread,
Apr 22, 2021, 1:49:13 PM4/22/21
to tla...@googlegroups.com
Hello,

although there is a standard module for real numbers in TLA+, neither TLC nor TLAPS support reasoning about real numbers at this point.

Stephan

--
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/83feca0e-9080-4c90-b522-5a92f363dec7n%40googlegroups.com.

Isaac DeFrain

unread,
Apr 22, 2021, 2:03:48 PM4/22/21
to tla...@googlegroups.com
Hello Joana,

Only integer division is defined.


Best,

Isaac

--
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/83feca0e-9080-4c90-b522-5a92f363dec7n%40googlegroups.com.
--
Isaac DeFrain
Reply all
Reply to author
Forward
0 new messages