summaryrefslogtreecommitdiff
path: root/Source/Model
diff options
context:
space:
mode:
authorGravatar MichalMoskal <unknown>2010-12-10 01:35:27 +0000
committerGravatar MichalMoskal <unknown>2010-12-10 01:35:27 +0000
commitc78b9efc4d974dded811e1964cf4459fc22f3aec (patch)
treee4ba4ad1d01bb44568b0b9097f78607b3912fc5c /Source/Model
parentc06446c8cc5f1ffe12b24d3ae192c2a17cd1ee01 (diff)
Add ToString() overrides to help in debugging
Diffstat (limited to 'Source/Model')
-rw-r--r--Source/Model/Model.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/Model/Model.cs b/Source/Model/Model.cs
index c04be448..9aeb5440 100644
--- a/Source/Model/Model.cs
+++ b/Source/Model/Model.cs
@@ -7,6 +7,7 @@
using System;
using System.Linq;
using System.Collections.Generic;
+using System.Text;
namespace Microsoft.Boogie
{
@@ -93,6 +94,11 @@ namespace Microsoft.Boogie
internal Func(Model p, string n, int a) { Model = p; Name = n; Arity = a; }
+ public override string ToString()
+ {
+ return string.Format("{0}/{1}", Name, Arity);
+ }
+
public void SetConstant(Element res)
{
if (Arity != 0 || apps.Count > 0)
@@ -204,6 +210,18 @@ namespace Microsoft.Boogie
Func = func;
Result = res;
}
+
+ public override string ToString()
+ {
+ var res = new StringBuilder();
+ res.Append(Func.Name).Append("(");
+ for (int i = 0; i < Args.Length; ++i) {
+ if (i != 0) res.Append(", ");
+ res.Append(Args[i]);
+ }
+ res.Append(" -> ").Append(Result);
+ return res.ToString();
+ }
}
#endregion