{"id":6852,"date":"2014-11-11T12:17:43","date_gmt":"2014-11-11T12:17:43","guid":{"rendered":"http:\/\/www.lexicalscope.com\/blog\/?p=6852"},"modified":"2015-11-26T10:30:20","modified_gmt":"2015-11-26T10:30:20","slug":"dafny-triggers","status":"publish","type":"post","link":"https:\/\/www.lexicalscope.com\/blog\/2014\/11\/11\/dafny-triggers\/","title":{"rendered":"Dafny Triggers"},"content":{"rendered":"<p>It is possible to <a href=\"http:\/\/rise4fun.com\/Dafny\/plmju\" title=\"Dafny Triggers\">write tiggers<\/a> for particular quantifiers in Dafny programs.<\/p>\n<pre lang=\"dafny\">\r\npredicate P(x:int) { true } \r\n\r\nlemma ThereIsMoreThanOneInteger(x:int)\r\n   ensures exists z:int :: z!=x;\r\n{ \r\n  \/\/ can't prove\r\n}\r\n\r\nlemma NoReallyThereIsMoreThanOneInteger(x:int)\r\n   ensures exists z:int {:trigger P(z)} :: z!=x;\r\n{ \r\n  assert P(x+1);\r\n  \/\/ can prove\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>It is possible to write tiggers for particular quantifiers in Dafny programs. predicate P(x:int) { true } lemma ThereIsMoreThanOneInteger(x:int) ensures exists z:int :: z!=x; { \/\/ can&#8217;t prove } lemma NoReallyThereIsMoreThanOneInteger(x:int) ensures exists z:int {:trigger P(z)} :: z!=x; { assert &hellip; <a href=\"https:\/\/www.lexicalscope.com\/blog\/2014\/11\/11\/dafny-triggers\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[15],"tags":[],"class_list":["post-6852","post","type-post","status-publish","format-standard","hentry","category-dafny"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2e3P7-1Mw","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.lexicalscope.com\/blog\/wp-json\/wp\/v2\/posts\/6852","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lexicalscope.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lexicalscope.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lexicalscope.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lexicalscope.com\/blog\/wp-json\/wp\/v2\/comments?post=6852"}],"version-history":[{"count":1,"href":"https:\/\/www.lexicalscope.com\/blog\/wp-json\/wp\/v2\/posts\/6852\/revisions"}],"predecessor-version":[{"id":6853,"href":"https:\/\/www.lexicalscope.com\/blog\/wp-json\/wp\/v2\/posts\/6852\/revisions\/6853"}],"wp:attachment":[{"href":"https:\/\/www.lexicalscope.com\/blog\/wp-json\/wp\/v2\/media?parent=6852"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lexicalscope.com\/blog\/wp-json\/wp\/v2\/categories?post=6852"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lexicalscope.com\/blog\/wp-json\/wp\/v2\/tags?post=6852"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}