CHOOSEing a function with a unique range for each element of the domain.

23 views
Skip to first unread message

thomas...@gmail.com

unread,
Feb 21, 2022, 10:35:33 PM2/21/22
to tlaplus
Hi All,

I would like to have a function that has a unique range for each element in the domain (e.g. like an ideal hash function).

I was trying to CHOOSE my way into a function:

BitString == [1..4 -> {0,1}]
hash == CHOOSE i \in [0..3 -> BitString] : \A x, y \in 0..3: x /=y /\ i[x] /= i[y]

But when I try running hash[2] in the evaluator, I get this error:

Attempted to compute the value of an expression of form
CHOOSE x \in S: P, but no element of S satisfied P.

Anyone have an idea of how I can get my desired effect?

tlaplus-go...@lemmster.de

unread,
Feb 21, 2022, 11:22:07 PM2/21/22
to tla...@googlegroups.com

thomas...@gmail.com

unread,
Feb 21, 2022, 11:34:50 PM2/21/22
to tlaplus

That worked...thanks!
Reply all
Reply to author
Forward
0 new messages