Let's say I have a datatype called dtyp. It looks like this
datatype dtype = T bool int
I'd like to define a function extr :: "dtype multiset => int multiset" which takes a multiset of these dtype elements and returns a multiset containing the ints in each of the dtype elements. So for example:
value "extr {#T True 4, T False 5, T False 7#}" should give {#4,5,7#}
I first thought of iterating through the multiset, but I know it isn't possible as these multisets are based off normal sets which are not iterable. I then thought about universal quantifiers, but I'm not sure how to use them in this situation. Could I please have some help?
Thanks in advance!