[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlaplus] Rolling dices in TLA+




if you want to roll an array of dice here are two options:

\* Same for both version
VARIABLE die
Init ==
    die = [i \in 1..8 |-> 1]

\* Roll Each die by itself
\* Explore if any of the dice are rolled
RollDie(x, val) ==
    die' = [die EXCEPT ![x] = val]
Next == \* Example Usage
    \/ \E d \in DOMAIN die, f \in 1..6: RollDie(d, f)

\* or Roll all the dice simultaneously
RollDie ==
    \E d \in [{1..8} -> 1..6]: die' = d

Generally when it comes to state space exploration, they roughly yield the same results, so it's more about readability and what you're trying to convey

Alex
On Wednesday, April 12, 2023 at 7:11:54 PM UTC+2 Markus Kuppe wrote:
Shameless plug and partially related:

"Obtaining Statistical Properties by Simulating Specs with TLC”
https://www.youtube.com/watch?v=cYenTPD7740

Markus

> On Apr 11, 2023, at 11:28 PM, Stephan Merz <stepha...@xxxxxxxxx> wrote:
>
> Note, however, that TLA+ will not allow you to verify any properties related to probability distributions, such as expected rewards. Prism [1] would be a suitable tool for such analyses.



EGYM GmbH, Einsteinstraße 172, 81677 München
Geschäftsführer: Patrick Meininger, Philipp Roesch-Schlanderer, Florian Sauter, Christoph Bischoff

Gerichtsstand München | Amtsgericht München HRB 186394 | USt.-Id. DE275313632

--
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+unsubscribe@xxxxxxxxxxxxxxxx.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/af662105-ac3e-42b7-9b06-5d9a2757698bn%40googlegroups.com.