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

*From*: Steve Ravet <steve.ravet@xxxxxxxxx>*Date*: Fri, 16 Apr 2021 11:59:59 -0700 (PDT)*Ironport-hdrordr*: A9a23:M7/YmqtoqpVJcM9cOHYAzVl57skC+IMji2hD6mlwRA09T+WzkceykPMHkSLlkTp5YgBbpfmsGomlBUnd+5l8/JULMd6ZNmTbkUahMY0K1/qH/xTOACv7n9QtsptIVqhlFZnZFlJ6jdn3iTPIZ+oI5dmc7eSIieLGpk0dOD1CTqF78kNYJ2+gYzxLbSxHH4d8LZyH+6N81kidUFEWdNn+On4eQ+PYrcbKn56OW29wOzcCyC2jyQyl86T7FR/w5GZkbxpqybcm8W/K1wn4/LjLiYDE9jb523XI55pb3Pvto+EzffCks9MYIDnghgGjaO1aKsK/lQs4qu2u91om+eOky3xQXfhb0H/Je3HwnB2F4Xid7B8V53juxUTwuxTeiPbkTzE3Adcpv/MgTjLl7SMbzbdB+ZMO9G6UsKdXAQjN9R6NhOTgZlVFkg6RrWA5meAey0ZDWZYTAYU+kaUvuG1SFpkEEGbWyqACVNNvAsbV+epMfTqhA0zxjy1AxtqjW3h2MAyBXlFHmsH96UkkoFlJi2UfwsIbkjM78I8lD6ND+//PPs1T9Y1mf4sxdqJyBOAIRI+MBmvBTQmkChPuHX3XUJoKMX7MtJL7iY9UlYSXUa1N9oI7nNDqUV9Tt2I+P2LoTeOU2oFTmyq9MFmAYQ==

I'm going through the examples at learntla.com and one asks to write an operator that finds the maximum value in a set. I did it using the SetReduce operator from somewhere else in the tutorial, but the given answer is simpler:

Max(S) == CHOOSE x \in S : \A y \in S : y <= x

I can't quite "read" this. Since CHOOSE picks any value from the set where the condition is true, it seems like this would return a value from S that is larger than at least one other value, not larger than all other values. What makes it keep going to find the largest value?

-- 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/22f7c06f-1774-4baf-98d6-32bdc244e0c7n%40googlegroups.com.

**Follow-Ups**:**Re: [tlaplus] How does this simple Max(set) implementation work?***From:*Hillel Wayne

- Prev by Date:
**[tlaplus] Re: How to check properties on models with huge numbers of behaviours** - Next by Date:
**Re: [tlaplus] How does this simple Max(set) implementation work?** - Previous by thread:
**[tlaplus] Re: How to check properties on models with huge numbers of behaviours** - Next by thread:
**Re: [tlaplus] How does this simple Max(set) implementation work?** - Index(es):