{"action":"created","issue":{"url":"https://api.github.com/repos/overturetool/documentation/issues/9","labels_url":"https://api.github.com/repos/overturetool/documentation/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/overturetool/documentation/issues/9/comments","events_url":"https://api.github.com/repos/overturetool/documentation/issues/9/events","html_url":"https://github.com/overturetool/documentation/issues/9","id":122894013,"number":9,"title":"union and munion pattern","user":{"login":"tomooda","id":836308,"avatar_url":"https://avatars.githubusercontent.com/u/836308?v=3","gravatar_id":"","url":"https://api.github.com/users/tomooda","html_url":"https://github.com/tomooda","followers_url":"https://api.github.com/users/tomooda/followers","following_url":"https://api.github.com/users/tomooda/following{/other_user}","gists_url":"https://api.github.com/users/tomooda/gists{/gist_id}","starred_url":"https://api.github.com/users/tomooda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomooda/subscriptions","organizations_url":"https://api.github.com/users/tomooda/orgs","repos_url":"https://api.github.com/users/tomooda/repos","events_url":"https://api.github.com/users/tomooda/events{/privacy}","received_events_url":"https://api.github.com/users/tomooda/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-12-18T07:06:58Z","updated_at":"2016-01-31T23:47:41Z","closed_at":null,"body":"The LRM says in Chapter 7\r\n> In the VDM interpreters the two subsets will always be chosen\r\n> such that they are non-empty and disjoint.\r\n\r\nI'm afraid this explanation may give misunderstanding. \r\nI first interpreted \"they are non-empty\" as \"neither of the two subsets can be empty\", but I think either subset can be empty, for example, {a} union rest should match against {1} with bindings a = 1 and rest = {}. A similar explanation is seen in munion."},"comment":{"url":"https://api.github.com/repos/overturetool/documentation/issues/comments/177662046","html_url":"https://github.com/overturetool/documentation/issues/9#issuecomment-177662046","issue_url":"https://api.github.com/repos/overturetool/documentation/issues/9","id":177662046,"user":{"login":"ldcouto","id":582801,"avatar_url":"https://avatars.githubusercontent.com/u/582801?v=3","gravatar_id":"","url":"https://api.github.com/users/ldcouto","html_url":"https://github.com/ldcouto","followers_url":"https://api.github.com/users/ldcouto/followers","following_url":"https://api.github.com/users/ldcouto/following{/other_user}","gists_url":"https://api.github.com/users/ldcouto/gists{/gist_id}","starred_url":"https://api.github.com/users/ldcouto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldcouto/subscriptions","organizations_url":"https://api.github.com/users/ldcouto/orgs","repos_url":"https://api.github.com/users/ldcouto/repos","events_url":"https://api.github.com/users/ldcouto/events{/privacy}","received_events_url":"https://api.github.com/users/ldcouto/received_events","type":"User","site_admin":false},"created_at":"2016-01-31T23:47:41Z","updated_at":"2016-01-31T23:47:41Z","body":"Well, the text you suggested is not precisely true. There is at least one union pattern that matches with the empty set.\r\n\r\n```\r\n p let {} union {} = {} in {}\r\n= {}\r\nExecuted in 0.005 secs. \r\n```\r\nWe can argue about whether or not it's really a *match*. But the interpreter does not report pattern match failed.\r\n\r\nI agree that the text as written is slightly ambiguous and the bit about the subsets being non-empty is clearly wrong. I also think the first part: `The two patterns are matched to a partition of\r\ntwo subsets of a set.` is  a bit vague. \r\n\r\nBTW, why is the language manual talking about VDM interpreters? That's a tool issue. Or does the language itself prescribe that the subsets must be disjoint?\r\n\r\nHow about...\r\n\r\n> A set union pattern fits only set values. The two patterns will match disjoint subsets of the value.\r\n\r\n@nickbattle thoughts?"}}