The main useful thing I have done with Dafny is prove that particular Programs have particular properties. i.e. create Dafny models of other systems and then prove things about them. So I have never tried to do any I/O. But, if your Dafny program does not have a main method, and you ask Dafny to compile it, it will produce a .net DLL. This should allow you to at least call Dafny procedures from .net (say C#) programs. I suppose that it might also be possible (using the DLL) to extend a Dafny class from C# code and override some of its methods to do I/O. I have not attempted this and do not know if it is actually possible.
↧