Re: Simple boolean predicate

2017-04-19 Thread spearman
Thank you, this works with Z3: // safe subtract pred stacst safesub_b : (int, int) -> bool extern praxi lemma_safesub_b { m,n:nat | n <= m } () : [safesub_b (m,n)] unit_p fun mysub_b { m,n:nat | n <= m } (x:int m, y:int n) : [safesub_b (m,n)] int = let prval () = $solver_assert (lemma_safesu

Re: [stream_vt_head_exn], strange behavior

2017-04-19 Thread gmhwxi
stream_vt is pretty similar to the linear hom you used. Essentially, stream_vt is a linear hom whose arity equals 0. On Wednesday, April 19, 2017 at 10:10:29 AM UTC-4, August Alm wrote: > > Thank you! Still learning how to handle laziness. =) > > Den onsdag 19 april 2017 kl. 15:56:42 UTC+2 skrev g

Re: [stream_vt_head_exn], strange behavior

2017-04-19 Thread August Alm
Thank you! Still learning how to handle laziness. =) Den onsdag 19 april 2017 kl. 15:56:42 UTC+2 skrev gmhwxi: > > The 'free' part of from_vt should be dropped: > > val > from_vt = > fix f(i: int): stream_vt(int) => > $ldelay(stream_vt_cons{int}(i, f(i+1))) > > stream_vt_head_exn tries to free a g

Re: pandoc supports ATS syntax highlighting

2017-04-19 Thread Steinway Wu
Wow, thank you Kiwamu, you just made my document looks way more colorful :) On Tuesday, April 18, 2017 at 2:04:40 AM UTC-4, Artyom Shalkhakov wrote: > > On Tuesday, April 18, 2017 at 10:34:48 AM UTC+6, Kiwamu Okabe wrote: >> >> Yes :) >> > > Implement silently, don't tell anyone. Have it spring up

Re: [stream_vt_head_exn], strange behavior

2017-04-19 Thread Hongwei Xi
The 'free' part of from_vt should be dropped: val from_vt = fix f(i: int): stream_vt(int) => $ldelay(stream_vt_cons{int}(i, f(i+1))) stream_vt_head_exn tries to free a given stream. In the above case, freeing the given stream trigger infinite computation. In the follow code, 'ns' is leaked: val

[stream_vt_head_exn], strange behavior

2017-04-19 Thread August Alm
Hi! The following code compiles but segfaults when run: val from_vt_nine = from_vt(9) val nine = stream_vt_head_exn(from_vt_nine) val () = println!(nine: int) The follwing code, on the other hand, executes as expected: val from_vt_nine = from_vt(9) v