summaryrefslogtreecommitdiff
path: root/Dafny/Printer.cs
diff options
context:
space:
mode:
authorGravatar Rustan Leino <leino@microsoft.com>2012-01-10 13:23:20 -0800
committerGravatar Rustan Leino <leino@microsoft.com>2012-01-10 13:23:20 -0800
commita95e7d5e1172d19df14623014ead072924e1af4c (patch)
tree626706eca3463a60a89a3afeaaadfde08a450e4f /Dafny/Printer.cs
parentc7b6946ca6368f6ec307802b82b4e44a6cab83cd (diff)
Dafny: added predicates
Diffstat (limited to 'Dafny/Printer.cs')
-rw-r--r--Dafny/Printer.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/Dafny/Printer.cs b/Dafny/Printer.cs
index fcedb829..af4f54c8 100644
--- a/Dafny/Printer.cs
+++ b/Dafny/Printer.cs
@@ -219,15 +219,18 @@ namespace Microsoft.Dafny {
public void PrintFunction(Function f, int indent) {
Contract.Requires(f != null);
+ var isPredicate = f is Predicate;
Indent(indent);
- string k = "function";
+ string k = isPredicate ? "predicate" : "function";
if (f.IsUnlimited) { k = "unlimited " + k; }
if (f.IsStatic) { k = "static " + k; }
if (!f.IsGhost) { k += " method"; }
PrintClassMethodHelper(k, f.Attributes, f.Name, f.TypeArgs);
PrintFormals(f.Formals);
- wr.Write(": ");
- PrintType(f.ResultType);
+ if (!isPredicate) {
+ wr.Write(": ");
+ PrintType(f.ResultType);
+ }
wr.WriteLine();
int ind = indent + IndentAmount;