Skip to content

Commit

Permalink
fix bug in file names
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoAureliano committed Nov 2, 2024
1 parent 74999b4 commit aec6e8e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
17 changes: 7 additions & 10 deletions Src/PCompiler/CompilerCore/Backend/Uclid5/Uclid5CodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void Compile(ICompilerConfiguration job)

foreach (var cmd in _commands)
{
if (cmd.Name == "default")
if (cmd.Name.Contains("default"))
{
missingDefault = false;
}
Expand Down Expand Up @@ -317,19 +317,16 @@ public IEnumerable<CompiledFile> GenerateCode(ICompilerConfiguration job, Scope
{
if (proofCmd.Goals.Count == 1 && proofCmd.Goals[0].IsDefault)
{
var proof = new ProofCommand("default", null)
{
Goals = [],
Premises = proofCmd.Premises
};
_commands.Add(proof);
_proofCommandToFiles.Add(proof, []);
files.AddRange(CompileToFile($"{filenamePrefix}default", proof, true, true, true));
proofCmd.Name = "default" + proofCmd.Name;
proofCmd.Goals = [];
_commands.Add(proofCmd);
_proofCommandToFiles.Add(proofCmd, []);
files.AddRange(CompileToFile($"{filenamePrefix}default", proofCmd, true, true, true));
}
else
{
_proofCommandToFiles.Add(proofCmd, []);
files.AddRange(CompileToFile($"{filenamePrefix}{proofCmd.Name}", proofCmd, true, false, false));
files.AddRange(CompileToFile($"{filenamePrefix}{proofCmd.Name.Replace(",", "_").Replace(" ", "_")}", proofCmd, true, false, false));
_commands.Add(proofCmd);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ public override object VisitInvariantGroupDecl(PParser.InvariantGroupDeclContext
public override object VisitProveUsingCmd(PParser.ProveUsingCmdContext context)
{
var name = string.Join(", ", context._targets.Select(t => t.GetText()));
if (context._premises.Count > 0)
{
name += " using " + string.Join(", ", context._premises.Select(t => t.GetText()));
}
var decl = CurrentScope.Put(name, context);
nodesToDeclarations.Put(context, decl);
return null;
Expand Down

0 comments on commit aec6e8e

Please sign in to comment.