summaryrefslogtreecommitdiff
path: root/Source/Model
diff options
context:
space:
mode:
authorGravatar Pantazis Deligiannis <pdeligia@me.com>2013-07-10 21:34:05 +0100
committerGravatar Pantazis Deligiannis <pdeligia@me.com>2013-07-10 21:34:05 +0100
commit99871c0fc576d2fa704bf360981aeb06f93e51bb (patch)
tree2a78aa4c8150bca7227f93df027098eaaf20298f /Source/Model
parent2752b4bd413d5397d20331a3b8111b9abd661262 (diff)
fixed another bug when parsing nested arrays under CVC4
Diffstat (limited to 'Source/Model')
-rw-r--r--Source/Model/ModelParser.cs130
1 files changed, 26 insertions, 104 deletions
diff --git a/Source/Model/ModelParser.cs b/Source/Model/ModelParser.cs
index 0a7a6c69..65b38f2f 100644
--- a/Source/Model/ModelParser.cs
+++ b/Source/Model/ModelParser.cs
@@ -432,6 +432,8 @@ namespace Microsoft.Boogie
if (line == "END_OF_MODEL" || line == "." || line == "*** END_MODEL")
continue;
+ //Console.WriteLine("\n\n# :: " + line);
+
var words = GetParsedTokens (line);
if (words.Count == 0)
continue;
@@ -709,118 +711,38 @@ namespace Microsoft.Boogie
output.Add (args [0]);
}
} else if (tokens [i] == "__array_store_all__") {
- int p_count = 1;
- i += 2;
-
- while (p_count > 0) {
- if (tokens [i] == ")")
- p_count--;
- else if (tokens [i] == "(")
- p_count++;
- i++;
- }
-
- if (tokens [i] == "(" && tokens [i + 1] == "_") {
- output.Add (GetValue (i + 3));
- i += 5;
- } else if (tokens [i] == "(" && tokens [i + 1] == "-") {
- output.Add (GetValue (i + 2));
- i += 4;
- } else {
- output.Add (GetValue (i));
- i++;
- }
- }
- }
- /*
- protected override void ParseArray(ref int i)
- {
- output.Add("as-array[k!" + arrayNum + "]");
- output.Add("@SPLIT");
- output.Add("k!" + arrayNum);
- output.Add("->");
- output.Add("{");
- output.Add(" ");
-
- while (tokens[i] != "store" && tokens[i] != "__array_store_all__")
- i++;
-
- if (tokens[i] == "store")
- {
- List<string> args = new List<string>();
- int p_count = 1;
- i += 4;
-
- while (p_count > 0)
- {
- if (tokens[i] == ")")
- p_count--;
- else if (tokens[i] == "(")
- p_count++;
- i++;
- }
+ while (tokens[i] == "__array_store_all__") {
+ int p_count = 1;
+ i += 2;
- while(args.Count < 3)
- {
- if (tokens[i] == ")")
+ while (p_count > 0) {
+ if (tokens [i] == ")")
+ p_count--;
+ else if (tokens [i] == "(")
+ p_count++;
i++;
- else if (tokens[i] == "(" && tokens[i + 1] == "_")
- {
- args.Add(GetValue(i + 3));
- i += 5;
}
- else if (tokens[i + 1] == "(" && tokens[i + 1] == "-")
- {
- args.Add(GetValue(i + 2));
- i += 4;
- }
- else
- {
- args.Add(GetValue(i));
+
+ if (tokens [i] == "(" && tokens [i + 1] == "__array_store_all__") {
+ output.Add ("as-array[k!" + arrayNum + "]");
+ SplitArrayExpression ();
i++;
+ } else {
+ if (tokens [i] == "(" && tokens [i + 1] == "_") {
+ output.Add (GetValue (i + 3));
+ i += 5;
+ } else if (tokens [i] == "(" && tokens [i + 1] == "-") {
+ output.Add (GetValue (i + 2));
+ i += 4;
+ } else {
+ output.Add (GetValue (i));
+ i++;
+ }
}
}
-
- output.Add(args[1]);
- output.Add("->");
- output.Add(args[2]);
- output.Add(" ");
- output.Add("else");
- output.Add("->");
- output.Add(args[0]);
- }
- else if (tokens[i] == "__array_store_all__")
- {
- int p_count = 1;
- i += 2;
-
- while (p_count > 0)
- {
- if (tokens[i] == ")")
- p_count--;
- else if (tokens[i] == "(")
- p_count++;
- i++;
- }
-
- if (tokens[i] == "(" && tokens[i + 1] == "_")
- {
- output.Add(GetValue(i + 3));
- i += 5;
- }
- else if (tokens[i] == "(" && tokens[i + 1] == "-")
- {
- output.Add(GetValue(i + 2));
- i += 4;
- }
- else
- {
- output.Add(GetValue(i));
- i++;
- }
}
}
- */
+
protected override void ParseITE (ref int i)
{
List<string> args = new List<string> ();