@@ -105,7 +105,68 @@ <h2><a class="toc-backref" href="#id1" role="doc-backlink">Variant: <code class=
105105
106106< div class ="proofnav-sphinx ">
107107 < div id ="proofnav-0 " class ="proofnav-mount "> </ div >
108- < script type ="application/json " id ="proofnav-0-data "> { "source" :"require import AllCore.\n\nmodule M = {\n proc f(x : int) = {\n return x;\n }\n}.\n\npred p : int.\npred q : int.\n\nlemma L : hoare[M.f : p x ==> q res].\nproof.\n proc. skip.\nabort.\n" , "sentenceEnds" :[ 23 , 80 , 95 , 109 , 148 , 155 , 163 , 169 , 176 ] , "sentences" :[ { "goals" :[ ] , "message" :"" } , { "goals" :[ ] , "message" :"" } , { "goals" :[ ] , "message" :"info: added predicate p : int -> bool" } , { "goals" :[ ] , "message" :"info: added predicate q : int -> bool" } , { "goals" :[ "Type variables: <none>\n\n------------------------------------------------------------------------\npre = p arg\n\n M.f \n\npost = q res\n" ] , "message" :"" } , { "goals" :[ "Type variables: <none>\n\n------------------------------------------------------------------------\npre = p arg\n\n M.f \n\npost = q res\n" ] , "message" :"" } , { "goals" :[ "Type variables: <none>\n\n------------------------------------------------------------------------\nContext : hr: {x : int}\n\npre = p x\n\n\npost = q x\n" ] , "message" :"" } , { "goals" :[ "Type variables: <none>\n\n------------------------------------------------------------------------\nforall &hr, p x{hr} => q x{hr}\n" ] , "message" :"" } , { "goals" :[ ] , "message" :"" } ] , "initialSentence" :6 , "title" :"Hoare logic example" } </ script >
108+ < script type ="application/json " id ="proofnav-0-data "> {
109+ "source" :"require import AllCore.\n\nmodule M = {\n proc f(x : int) = {\n return x;\n }\n}.\n\npred p : int.\npred q : int.\n\nlemma L : hoare[M.f : p x ==> q res].\nproof.\n proc. skip.\nabort.\n" ,
110+ "sentenceEnds" :[
111+ 23 ,
112+ 80 ,
113+ 95 ,
114+ 109 ,
115+ 148 ,
116+ 155 ,
117+ 163 ,
118+ 169 ,
119+ 176
120+ ] ,
121+ "sentences" :[
122+ {
123+ "goals" :[ ] ,
124+ "message" :""
125+ } ,
126+ {
127+ "goals" :[ ] ,
128+ "message" :""
129+ } ,
130+ {
131+ "goals" :[ ] ,
132+ "message" :"info: added predicate p : int -> bool"
133+ } ,
134+ {
135+ "goals" :[ ] ,
136+ "message" :"info: added predicate q : int -> bool"
137+ } ,
138+ {
139+ "goals" :[
140+ "Type variables: <none>\n\n------------------------------------------------------------------------\npre = p arg\n\n M.f \n\npost = q res\n"
141+ ] ,
142+ "message" :""
143+ } ,
144+ {
145+ "goals" :[
146+ "Type variables: <none>\n\n------------------------------------------------------------------------\npre = p arg\n\n M.f \n\npost = q res\n"
147+ ] ,
148+ "message" :""
149+ } ,
150+ {
151+ "goals" :[
152+ "Type variables: <none>\n\n------------------------------------------------------------------------\nContext : hr: {x : int}\n\npre = p x\n\n\npost = q x\n"
153+ ] ,
154+ "message" :""
155+ } ,
156+ {
157+ "goals" :[
158+ "Type variables: <none>\n\n------------------------------------------------------------------------\nforall &hr, p x{hr} => q x{hr}\n"
159+ ] ,
160+ "message" :""
161+ } ,
162+ {
163+ "goals" :[ ] ,
164+ "message" :""
165+ }
166+ ] ,
167+ "initialSentence" :6 ,
168+ "title" :"Hoare logic example"
169+ } </ script >
109170</ div >
110171</ section >
111172< section id ="variant-skip-prhl ">
@@ -116,7 +177,68 @@ <h2><a class="toc-backref" href="#id2" role="doc-backlink">Variant: <code class=
116177
117178< div class ="proofnav-sphinx ">
118179 < div id ="proofnav-1 " class ="proofnav-mount "> </ div >
119- < script type ="application/json " id ="proofnav-1-data "> { "source" :"require import AllCore.\n\nmodule M = {\n proc f(x : int) = {\n return x;\n }\n}.\n\npred p : int & int.\npred q : int & int.\n\nlemma L : equiv[M.f ~ M.f : p x{1} x{2} ==> q res{1} res{2}].\nproof.\n proc. skip.\nabort.\n" , "sentenceEnds" :[ 23 , 80 , 101 , 121 , 184 , 191 , 199 , 205 , 212 ] , "sentences" :[ { "goals" :[ ] , "message" :"" } , { "goals" :[ ] , "message" :"" } , { "goals" :[ ] , "message" :"info: added predicate p : int -> int -> bool" } , { "goals" :[ ] , "message" :"info: added predicate q : int -> int -> bool" } , { "goals" :[ "Type variables: <none>\n\n------------------------------------------------------------------------\npre = p arg{1} arg{2}\n\n M.f ~ M.f \n\npost = q res{1} res{2}\n" ] , "message" :"" } , { "goals" :[ "Type variables: <none>\n\n------------------------------------------------------------------------\npre = p arg{1} arg{2}\n\n M.f ~ M.f \n\npost = q res{1} res{2}\n" ] , "message" :"" } , { "goals" :[ "Type variables: <none>\n\n------------------------------------------------------------------------\n&1 (left ) : {x : int} [programs are in sync]\n&2 (right) : {x : int}\n\npre = p x{1} x{2}\n\n\npost = q x{1} x{2}\n" ] , "message" :"" } , { "goals" :[ "Type variables: <none>\n\n------------------------------------------------------------------------\nforall &1 &2, p x{1} x{2} => q x{1} x{2}\n" ] , "message" :"" } , { "goals" :[ ] , "message" :"" } ] , "initialSentence" :6 , "title" :"Probabilistic Relational Hoare logic example" } </ script >
180+ < script type ="application/json " id ="proofnav-1-data "> {
181+ "source" :"require import AllCore.\n\nmodule M = {\n proc f(x : int) = {\n return x;\n }\n}.\n\npred p : int & int.\npred q : int & int.\n\nlemma L : equiv[M.f ~ M.f : p x{1} x{2} ==> q res{1} res{2}].\nproof.\n proc. skip.\nabort.\n" ,
182+ "sentenceEnds" :[
183+ 23 ,
184+ 80 ,
185+ 101 ,
186+ 121 ,
187+ 184 ,
188+ 191 ,
189+ 199 ,
190+ 205 ,
191+ 212
192+ ] ,
193+ "sentences" :[
194+ {
195+ "goals" :[ ] ,
196+ "message" :""
197+ } ,
198+ {
199+ "goals" :[ ] ,
200+ "message" :""
201+ } ,
202+ {
203+ "goals" :[ ] ,
204+ "message" :"info: added predicate p : int -> int -> bool"
205+ } ,
206+ {
207+ "goals" :[ ] ,
208+ "message" :"info: added predicate q : int -> int -> bool"
209+ } ,
210+ {
211+ "goals" :[
212+ "Type variables: <none>\n\n------------------------------------------------------------------------\npre = p arg{1} arg{2}\n\n M.f ~ M.f \n\npost = q res{1} res{2}\n"
213+ ] ,
214+ "message" :""
215+ } ,
216+ {
217+ "goals" :[
218+ "Type variables: <none>\n\n------------------------------------------------------------------------\npre = p arg{1} arg{2}\n\n M.f ~ M.f \n\npost = q res{1} res{2}\n"
219+ ] ,
220+ "message" :""
221+ } ,
222+ {
223+ "goals" :[
224+ "Type variables: <none>\n\n------------------------------------------------------------------------\n&1 (left ) : {x : int} [programs are in sync]\n&2 (right) : {x : int}\n\npre = p x{1} x{2}\n\n\npost = q x{1} x{2}\n"
225+ ] ,
226+ "message" :""
227+ } ,
228+ {
229+ "goals" :[
230+ "Type variables: <none>\n\n------------------------------------------------------------------------\nforall &1 &2, p x{1} x{2} => q x{1} x{2}\n"
231+ ] ,
232+ "message" :""
233+ } ,
234+ {
235+ "goals" :[ ] ,
236+ "message" :""
237+ }
238+ ] ,
239+ "initialSentence" :6 ,
240+ "title" :"Probabilistic Relational Hoare logic example"
241+ } </ script >
120242</ div >
121243</ section >
122244< section id ="variant-skip-phl ">
@@ -129,7 +251,69 @@ <h2><a class="toc-backref" href="#id3" role="doc-backlink">Variant: <code class=
129251
130252< div class ="proofnav-sphinx ">
131253 < div id ="proofnav-2 " class ="proofnav-mount "> </ div >
132- < script type ="application/json " id ="proofnav-2-data "> { "source" :"require import AllCore.\n\nmodule M = {\n proc f(x : int) = {\n return x;\n }\n}.\n\npred p : int.\npred q : int.\n\nlemma L : phoare[M.f : p x ==> q res] >= (1%r / 2%r).\nproof.\n proc. skip.\nabort.\n" , "sentenceEnds" :[ 23 , 80 , 95 , 109 , 164 , 171 , 179 , 185 , 192 ] , "sentences" :[ { "goals" :[ ] , "message" :"" } , { "goals" :[ ] , "message" :"" } , { "goals" :[ ] , "message" :"info: added predicate p : int -> bool" } , { "goals" :[ ] , "message" :"info: added predicate q : int -> bool" } , { "goals" :[ "Type variables: <none>\n\n------------------------------------------------------------------------\npre = p arg\n\n M.f \n [>=] 1%r / 2%r\n\npost = q res\n" ] , "message" :"" } , { "goals" :[ "Type variables: <none>\n\n------------------------------------------------------------------------\npre = p arg\n\n M.f \n [>=] 1%r / 2%r\n\npost = q res\n" ] , "message" :"" } , { "goals" :[ "Type variables: <none>\n\n------------------------------------------------------------------------\nContext : hr: {x : int}\nBound : [>=] 1%r / 2%r\n\npre = p x\n\n\npost = q x\n" ] , "message" :"" } , { "goals" :[ "Type variables: <none>\n\n------------------------------------------------------------------------\nforall &hr, p x{hr} => 1%r / 2%r <= 1%r\n" , "Type variables: <none>\n\n------------------------------------------------------------------------\nforall &hr, p x{hr} => q x{hr}\n" ] , "message" :"" } , { "goals" :[ ] , "message" :"" } ] , "initialSentence" :6 , "title" :"Probabilistic Hoare logic example" } </ script >
254+ < script type ="application/json " id ="proofnav-2-data "> {
255+ "source" :"require import AllCore.\n\nmodule M = {\n proc f(x : int) = {\n return x;\n }\n}.\n\npred p : int.\npred q : int.\n\nlemma L : phoare[M.f : p x ==> q res] >= (1%r / 2%r).\nproof.\n proc. skip.\nabort.\n" ,
256+ "sentenceEnds" :[
257+ 23 ,
258+ 80 ,
259+ 95 ,
260+ 109 ,
261+ 164 ,
262+ 171 ,
263+ 179 ,
264+ 185 ,
265+ 192
266+ ] ,
267+ "sentences" :[
268+ {
269+ "goals" :[ ] ,
270+ "message" :""
271+ } ,
272+ {
273+ "goals" :[ ] ,
274+ "message" :""
275+ } ,
276+ {
277+ "goals" :[ ] ,
278+ "message" :"info: added predicate p : int -> bool"
279+ } ,
280+ {
281+ "goals" :[ ] ,
282+ "message" :"info: added predicate q : int -> bool"
283+ } ,
284+ {
285+ "goals" :[
286+ "Type variables: <none>\n\n------------------------------------------------------------------------\npre = p arg\n\n M.f \n [>=] 1%r / 2%r\n\npost = q res\n"
287+ ] ,
288+ "message" :""
289+ } ,
290+ {
291+ "goals" :[
292+ "Type variables: <none>\n\n------------------------------------------------------------------------\npre = p arg\n\n M.f \n [>=] 1%r / 2%r\n\npost = q res\n"
293+ ] ,
294+ "message" :""
295+ } ,
296+ {
297+ "goals" :[
298+ "Type variables: <none>\n\n------------------------------------------------------------------------\nContext : hr: {x : int}\nBound : [>=] 1%r / 2%r\n\npre = p x\n\n\npost = q x\n"
299+ ] ,
300+ "message" :""
301+ } ,
302+ {
303+ "goals" :[
304+ "Type variables: <none>\n\n------------------------------------------------------------------------\nforall &hr, p x{hr} => 1%r / 2%r <= 1%r\n" ,
305+ "Type variables: <none>\n\n------------------------------------------------------------------------\nforall &hr, p x{hr} => q x{hr}\n"
306+ ] ,
307+ "message" :""
308+ } ,
309+ {
310+ "goals" :[ ] ,
311+ "message" :""
312+ }
313+ ] ,
314+ "initialSentence" :6 ,
315+ "title" :"Probabilistic Hoare logic example"
316+ } </ script >
133317</ div >
134318</ section >
135319< section id ="variant-skip-ehl ">
@@ -141,7 +325,68 @@ <h2><a class="toc-backref" href="#id4" role="doc-backlink">Variant: <code class=
141325
142326< div class ="proofnav-sphinx ">
143327 < div id ="proofnav-3 " class ="proofnav-mount "> </ div >
144- < script type ="application/json " id ="proofnav-3-data "> { "source" :"require import AllCore Xreal.\n\nmodule M = {\n proc f(x : int) = {\n return x;\n }\n}.\n\nop p : int -> xreal.\nop q : int -> xreal.\n\nlemma L : ehoare[M.f : p x ==> q res].\nproof.\n proc. skip.\nabort.\n" , "sentenceEnds" :[ 29 , 86 , 108 , 129 , 169 , 176 , 184 , 190 , 197 ] , "sentences" :[ { "goals" :[ ] , "message" :"" } , { "goals" :[ ] , "message" :"" } , { "goals" :[ ] , "message" :"info: added operator p : int -> xreal" } , { "goals" :[ ] , "message" :"info: added operator q : int -> xreal" } , { "goals" :[ "Type variables: <none>\n\n------------------------------------------------------------------------\npre = p arg\n\n M.f \n\npost = q res\n" ] , "message" :"" } , { "goals" :[ "Type variables: <none>\n\n------------------------------------------------------------------------\npre = p arg\n\n M.f \n\npost = q res\n" ] , "message" :"" } , { "goals" :[ "Type variables: <none>\n\n------------------------------------------------------------------------\nContext : hr: {x : int}\n\npre = p x\n\n\npost = q x\n" ] , "message" :"" } , { "goals" :[ "Type variables: <none>\n\n------------------------------------------------------------------------\nforall &hr, q x{hr} <= p x{hr}\n" ] , "message" :"" } , { "goals" :[ ] , "message" :"" } ] , "initialSentence" :6 , "title" :"Expectation Hoare logic example" } </ script >
328+ < script type ="application/json " id ="proofnav-3-data "> {
329+ "source" :"require import AllCore Xreal.\n\nmodule M = {\n proc f(x : int) = {\n return x;\n }\n}.\n\nop p : int -> xreal.\nop q : int -> xreal.\n\nlemma L : ehoare[M.f : p x ==> q res].\nproof.\n proc. skip.\nabort.\n" ,
330+ "sentenceEnds" :[
331+ 29 ,
332+ 86 ,
333+ 108 ,
334+ 129 ,
335+ 169 ,
336+ 176 ,
337+ 184 ,
338+ 190 ,
339+ 197
340+ ] ,
341+ "sentences" :[
342+ {
343+ "goals" :[ ] ,
344+ "message" :""
345+ } ,
346+ {
347+ "goals" :[ ] ,
348+ "message" :""
349+ } ,
350+ {
351+ "goals" :[ ] ,
352+ "message" :"info: added operator p : int -> xreal"
353+ } ,
354+ {
355+ "goals" :[ ] ,
356+ "message" :"info: added operator q : int -> xreal"
357+ } ,
358+ {
359+ "goals" :[
360+ "Type variables: <none>\n\n------------------------------------------------------------------------\npre = p arg\n\n M.f \n\npost = q res\n"
361+ ] ,
362+ "message" :""
363+ } ,
364+ {
365+ "goals" :[
366+ "Type variables: <none>\n\n------------------------------------------------------------------------\npre = p arg\n\n M.f \n\npost = q res\n"
367+ ] ,
368+ "message" :""
369+ } ,
370+ {
371+ "goals" :[
372+ "Type variables: <none>\n\n------------------------------------------------------------------------\nContext : hr: {x : int}\n\npre = p x\n\n\npost = q x\n"
373+ ] ,
374+ "message" :""
375+ } ,
376+ {
377+ "goals" :[
378+ "Type variables: <none>\n\n------------------------------------------------------------------------\nforall &hr, q x{hr} <= p x{hr}\n"
379+ ] ,
380+ "message" :""
381+ } ,
382+ {
383+ "goals" :[ ] ,
384+ "message" :""
385+ }
386+ ] ,
387+ "initialSentence" :6 ,
388+ "title" :"Expectation Hoare logic example"
389+ } </ script >
145390</ div >
146391</ section >
147392</ section >
0 commit comments