Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
shazqadeer committed Oct 24, 2024
1 parent 07ae2d8 commit df599c1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
11 changes: 5 additions & 6 deletions Source/Provers/SMTLib/SMTLibLineariser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public string TypeToString(Type t)
}
else
{
return SmtLibNameUtils.QuoteId("T@" + s);
return SMTLibNameUtils.QuoteId("T@" + s);
}
}
}
Expand Down Expand Up @@ -465,7 +465,7 @@ public bool Visit(VCExprQuantifier node, LineariserOptions options)
wr.Write("\n");
if (info.qid != null && LibOptions.EmitDebugInformation)
{
wr.Write(" :qid {0}\n", SmtLibNameUtils.QuoteId(info.qid));
wr.Write(" :qid {0}\n", SMTLibNameUtils.QuoteId(info.qid));
}

if (weight != 1)
Expand Down Expand Up @@ -775,8 +775,7 @@ public bool VisitFieldAccessOp(VCExprNAry node, LineariserOptions options)
var op = (VCExprFieldAccessOp)node.Op;
var constructor = op.DatatypeTypeCtorDecl.Constructors[op.ConstructorIndex];
Variable v = constructor.InParams[op.FieldIndex];
var name = v.Name + "#" + constructor.Name;
name = ExprLineariser.Namer.GetQuotedName(v, name);
var name = ExprLineariser.Namer.GetQuotedName(v, v.Name);
WriteApplication(name, node, options);
return true;
}
Expand All @@ -785,8 +784,8 @@ public bool VisitIsConstructorOp(VCExprNAry node, LineariserOptions options)
{
var op = (VCExprIsConstructorOp)node.Op;
var constructor = op.DatatypeTypeCtorDecl.Constructors[op.ConstructorIndex];
var name = "is-" + constructor.Name;
name = ExprLineariser.Namer.GetQuotedName(name, name);
var constructorName = ExprLineariser.Namer.GetName(constructor, constructor.Name);
var name = SMTLibNameUtils.AddQuotes($"is-{constructorName}");
WriteApplication(name, node, options);
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Provers/SMTLib/SMTLibProcessTheoremProver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ protected void SendVCOptions()
protected void SendVCId(string descriptiveName)
{
if (this.libOptions.EmitDebugInformation) {
SendThisVC("(set-info :boogie-vc-id " + SmtLibNameUtils.QuoteId(descriptiveName) + ")");
SendThisVC("(set-info :boogie-vc-id " + SMTLibNameUtils.QuoteId(descriptiveName) + ")");
}
}

Expand Down
6 changes: 3 additions & 3 deletions Source/Provers/SMTLib/SmtLibNameUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Microsoft.Boogie.SMTLib
{
public static class SmtLibNameUtils
public static class SMTLibNameUtils
{

public static string QuoteId(string s)
Expand Down Expand Up @@ -70,7 +70,7 @@ public static string QuoteId(string s)
static HashSet<string> reservedSmtWords;
static bool[] validIdChar;

static SmtLibNameUtils()
static SMTLibNameUtils()
{
reservedSmtWords = new HashSet<string>();
foreach (var w in reservedSmtWordsList)
Expand Down Expand Up @@ -112,7 +112,7 @@ static string FilterReserved(string s)
}


static string AddQuotes(string s)
public static string AddQuotes(string s)
{
var allGood = true;

Expand Down

0 comments on commit df599c1

Please sign in to comment.