Creating sets with dependencies between fields

41 views
Skip to first unread message

thisismy...@gmail.com

unread,
Nov 17, 2023, 4:09:00 PM11/17/23
to tlaplus
Hi

How do i create a variable whose fields depend upon each other like:
set of all files whose id is in range 1..MaxFileID and originalFileIds is a set whose value is id.

I tried `self.<field_name>` i.e. self.id and it did n't work.

E.g.
------ MODULE abc -----------

(*-- algorithm some

variables
    files = [id: 1..MaxFileID, originalFileIds: {}] \* using originalFildIds: {{id}} does not work.

end alorightm;*)

Thanks
Ashish



Hillel Wayne

unread,
Nov 17, 2023, 9:24:03 PM11/17/23
to 'Alex Weisberger' via tlaplus
Try something like this:

```
files = {[id |->id, originalFileIds |-> {id}]: id \in 1..MaxFileID}
```

H

--
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/6aef4a17-22d5-4b4a-9eca-039c87cd24cbn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages