From e2d1b7891526c90e26a790a9783aed8f69a57450 Mon Sep 17 00:00:00 2001 From: Dan Rosén Date: Tue, 12 Aug 2014 14:44:55 -0700 Subject: Compile lambda functions and apply expressions, and change let expr compilation --- Binaries/DafnyRuntime.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Binaries/DafnyRuntime.cs') diff --git a/Binaries/DafnyRuntime.cs b/Binaries/DafnyRuntime.cs index d6bd895a..f00db25a 100644 --- a/Binaries/DafnyRuntime.cs +++ b/Binaries/DafnyRuntime.cs @@ -1,4 +1,5 @@ -using System.Numerics; +using System; // for Func +using System.Numerics; namespace Dafny { @@ -27,7 +28,7 @@ namespace Dafny d[t] = true; return new Set(d); } - + public IEnumerable Elements { get { return dict.Keys; @@ -636,7 +637,16 @@ namespace Dafny { return u; } + + public static U Let(T t, Func f) { + return f(t); + } + public delegate Result Function(Input input); + + public static A Id(A a) { + return a; + } } public struct BigRational -- cgit v1.2.3