Re: [Why3-club] [Why3] Mutually recursive types?

2021-03-01 Thread Ramana Nagasamudram
Hi,

You can define mutually recursive types using “with” (instead of the more 
common “and”).  For example,

type tree ‘a = Empty | Node ‘a (forest ‘a)
with forest ‘a = Nil | Cons (tree ‘a) (forest ‘a)

I was in a similar situation a few weeks ago and couldn’t find any 
documentation then.


Best,
Ramana

On Mar 1, 2021, at 4:40 PM, Frank Pfenning 
mailto:f...@cs.cmu.edu>> wrote:

Is there a way to define mutually recursive types in WhyML?  I couldn't find
one in the documentation.  If not, is there a standard recommended workaround?

For context, in our course I am doing a little exploration and Dynamic Logic,
and in Dynamic Logic formulas and programs are defined in a mutually
recursive way.

Programs alpha, beta ::= x <- e | (alpha ; beta) | alpha u beta | alpha* | ?P
Formulas P, Q := e1 <= e2 | ... | P /\ Q | ... | [alpha]P | P

I'd like to avoid defining tests ?P separately from formulas.

Thanks,
Frank

--
Frank Pfenning, Professor
Computer Science Department
Carnegie Mellon University
Pittsburgh, PA 15213-3891

http://www.cs.cmu.edu/~fp
+1 412 268-6343
GHC 6017

___
Why3-club mailing list
Why3-club@lists.gforge.inria.fr
https://lists.gforge.inria.fr/mailman/listinfo/why3-club

___
Why3-club mailing list
Why3-club@lists.gforge.inria.fr
https://lists.gforge.inria.fr/mailman/listinfo/why3-club


[Why3-club] (no subject)

2020-12-03 Thread Ramana Nagasamudram

Dear Why3-club,

I'm working on a development that uses the Fset's module extensively and
would like to use Coq to prove a few goals.  I notice there is no
WhyType instance for Fset.fset.  While it is fairly straightforward to
derive one, it can get cumbersome to have to do so for each goal
attempted using Coq.  Are there plans to add an instance in a future
release?  If not, how might I go about modifying my existing
Why3 installation to include one?


Thanks,
Ramana Nagasamudram
___
Why3-club mailing list
Why3-club@lists.gforge.inria.fr
https://lists.gforge.inria.fr/mailman/listinfo/why3-club