{"action":"created","issue":{"url":"https://api.github.com/repos/czan/stateful-check/issues/1","labels_url":"https://api.github.com/repos/czan/stateful-check/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/czan/stateful-check/issues/1/comments","events_url":"https://api.github.com/repos/czan/stateful-check/issues/1/events","html_url":"https://github.com/czan/stateful-check/issues/1","id":78999863,"number":1,"title":"Question about :real/postcondition and :next-state","user":{"login":"lbradstreet","id":252189,"avatar_url":"https://avatars.githubusercontent.com/u/252189?v=3","gravatar_id":"","url":"https://api.github.com/users/lbradstreet","html_url":"https://github.com/lbradstreet","followers_url":"https://api.github.com/users/lbradstreet/followers","following_url":"https://api.github.com/users/lbradstreet/following{/other_user}","gists_url":"https://api.github.com/users/lbradstreet/gists{/gist_id}","starred_url":"https://api.github.com/users/lbradstreet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbradstreet/subscriptions","organizations_url":"https://api.github.com/users/lbradstreet/orgs","repos_url":"https://api.github.com/users/lbradstreet/repos","events_url":"https://api.github.com/users/lbradstreet/events{/privacy}","received_events_url":"https://api.github.com/users/lbradstreet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"czan","id":1835975,"avatar_url":"https://avatars.githubusercontent.com/u/1835975?v=3","gravatar_id":"","url":"https://api.github.com/users/czan","html_url":"https://github.com/czan","followers_url":"https://api.github.com/users/czan/followers","following_url":"https://api.github.com/users/czan/following{/other_user}","gists_url":"https://api.github.com/users/czan/gists{/gist_id}","starred_url":"https://api.github.com/users/czan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/czan/subscriptions","organizations_url":"https://api.github.com/users/czan/orgs","repos_url":"https://api.github.com/users/czan/repos","events_url":"https://api.github.com/users/czan/events{/privacy}","received_events_url":"https://api.github.com/users/czan/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-05-21T13:40:14Z","updated_at":"2015-05-21T16:29:24Z","closed_at":null,"body":"Hi,\r\n\r\nThanks for stateful-check, it's the missing piece in my test.check use! I'm a bit confused about how to compare the result of :next-state against the result of :real/postcondition without duplicating a lot of logic between :next-state and :real/postcondition. \r\n\r\nFor example, if I have \r\n```clojure\r\n{:next-state (fn [state, val, _] (inc state))\r\n :real/postcondition (fn [state, args, real] (= real state))}\r\n```\r\nwhere the result of `:real/command` is incrementing the real state, I'm getting the previous version of state in :real/postcondition, and I have duplicate the (inc state) logic in both :next-state and postcondition. I can see that this is the result of run-commands calling postcondition with the current state value, rather than the next state value.\r\n\r\nThe example is contrived but I'm finding that this is causing me to duplicate a lot of logic where I could simply look at the model state and compare it to the real state. Would you consider adding an extra arg to :real/postcondition, containing the next-state value?\r\n\r\nThanks again"},"comment":{"url":"https://api.github.com/repos/czan/stateful-check/issues/comments/104344744","html_url":"https://github.com/czan/stateful-check/issues/1#issuecomment-104344744","issue_url":"https://api.github.com/repos/czan/stateful-check/issues/1","id":104344744,"user":{"login":"lbradstreet","id":252189,"avatar_url":"https://avatars.githubusercontent.com/u/252189?v=3","gravatar_id":"","url":"https://api.github.com/users/lbradstreet","html_url":"https://github.com/lbradstreet","followers_url":"https://api.github.com/users/lbradstreet/followers","following_url":"https://api.github.com/users/lbradstreet/following{/other_user}","gists_url":"https://api.github.com/users/lbradstreet/gists{/gist_id}","starred_url":"https://api.github.com/users/lbradstreet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbradstreet/subscriptions","organizations_url":"https://api.github.com/users/lbradstreet/orgs","repos_url":"https://api.github.com/users/lbradstreet/repos","events_url":"https://api.github.com/users/lbradstreet/events{/privacy}","received_events_url":"https://api.github.com/users/lbradstreet/received_events","type":"User","site_admin":false},"created_at":"2015-05-21T16:29:24Z","updated_at":"2015-05-21T16:29:24Z","body":"Fair enough and totally understandable why you'd why to think on it. That's a pretty great suggestion which will do the trick for now. The main downside is that next-state will be called twice, and thus it will be slower, but I can live with that.\r\n\r\nI keep feeling like there's something I'm missing, and the fact that QuickCheck/PropEr both do it this way isn't helping matters!\r\n\r\nCheers"}}