summaryrefslogtreecommitdiff
path: root/Dafny/Printer.cs
diff options
context:
space:
mode:
authorGravatar Unknown <leino@LEINO6.redmond.corp.microsoft.com>2012-06-21 19:16:05 -0700
committerGravatar Unknown <leino@LEINO6.redmond.corp.microsoft.com>2012-06-21 19:16:05 -0700
commit7c6cfaa37c96349fda99823c6f98a576dba194b4 (patch)
tree0305efde49467759af3cce939c9a1ce70ad0cd61 /Dafny/Printer.cs
parent1ba9b5fab7fff5c30be347e84ff3cf348ec9857d (diff)
Dafny: Since it's no longer true that all types support equality at run-time (in particular, codatatypes), Dafny needs to check this. In these changes, Dafny supports the "(==)" suffix to type parameters, infers that suffix in some cases, and enforces equality support in many places. Refinement and datatypes still need more attention in the Dafny implementation.
Diffstat (limited to 'Dafny/Printer.cs')
-rw-r--r--Dafny/Printer.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Dafny/Printer.cs b/Dafny/Printer.cs
index fb46ba4b..498546c3 100644
--- a/Dafny/Printer.cs
+++ b/Dafny/Printer.cs
@@ -71,6 +71,9 @@ namespace Microsoft.Dafny {
if (i++ != 0) { wr.WriteLine(); }
Indent(indent);
PrintClassMethodHelper("type", at.Attributes, at.Name, new List<TypeParameter>());
+ if (at.EqualitySupport == TypeParameter.EqualitySupportValue.Required) {
+ wr.Write("(==)");
+ }
wr.WriteLine(";");
} else if (d is DatatypeDecl) {
if (i++ != 0) { wr.WriteLine(); }
@@ -149,6 +152,9 @@ namespace Microsoft.Dafny {
foreach (TypeParameter tp in typeArgs) {
Contract.Assert(tp != null);
wr.Write("{0}{1}", sep, tp.Name);
+ if (tp.EqualitySupport == TypeParameter.EqualitySupportValue.Required) {
+ wr.Write("(==)");
+ }
sep = ", ";
}
wr.Write(">");