Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ce03249
Reduce references to `CoreOptions.Clo` from 204 to 92 (#508)
keyboardDrummer Feb 21, 2022
dfbaab1
Remove all references to CoreOptions.Clo (#510)
keyboardDrummer Feb 26, 2022
cd260fc
Clean up calls to ToList() to reduce memory pressure (#516)
cpitclaudel Feb 28, 2022
3a4f371
Bump minor version to 2.12.1 (#517)
keyboardDrummer Feb 28, 2022
ed98b8e
Support XML generation with /vcsCores (#515)
atomb Mar 1, 2022
1de13ec
Separate help header from help body in CommandLineOptions.cs (#498)
cpitclaudel Mar 3, 2022
d1917bc
Refactor solver process handling to allow non-interactive mode (#512)
atomb Mar 7, 2022
e3ca84c
Include split locations in XML output (#480)
atomb Mar 8, 2022
c4fc91a
Fix compatibility issues with solvers other than Z3 (#521)
atomb Mar 8, 2022
71d6ca5
Bump version to 2.13.0 (#525)
robin-aws Mar 8, 2022
980d6a7
Visiting attributes in StandardVisitor (#523)
shazqadeer Mar 9, 2022
c4550ae
Refactoring for return verification tasks (#527)
keyboardDrummer Mar 9, 2022
b1ff4af
Extract methods within ExecutionEngine.VerifyImplementation (#528)
keyboardDrummer Mar 9, 2022
c0ea6a1
Add more structured descriptions of proof obligations (#505)
atomb Mar 9, 2022
34b946e
adding support for allowing calls to atomic actions from atomic actio…
shazqadeer Mar 9, 2022
b947db5
Turn on parallel-boogie in related tests
keyboardDrummer Mar 10, 2022
a76edf5
Ordered the output of -traceCaching when using parallel Boogie
keyboardDrummer Mar 10, 2022
2a69bc1
Allow trace output to be printed immediately, before verification has…
keyboardDrummer Mar 9, 2022
4811d87
Let InferAndVerify return a Task, and related changes
keyboardDrummer Mar 10, 2022
50837d6
Add test for running multiple Boogie program in parallel
keyboardDrummer Mar 10, 2022
658603a
Let AdvisoryWriteLine take a TextWriter
keyboardDrummer Mar 10, 2022
6ae3f6f
Fix tests that call engine.ProcessProgram so they wait for it to finish
keyboardDrummer Mar 10, 2022
6f320c8
Fix line endings in test
keyboardDrummer Mar 10, 2022
a1faa69
bug fix (#529)
shazqadeer Mar 10, 2022
ee3c6d6
Support @PROC@ for the -mv option (#530)
keyboardDrummer Mar 10, 2022
dbb602a
Rename writer
keyboardDrummer Mar 11, 2022
0297589
Do not say we're retrieving cached results when we're not
keyboardDrummer Mar 11, 2022
8d9afad
Maintain order of logging that results from use the -traceCaching opt…
keyboardDrummer Mar 11, 2022
53c9b29
Merge remote-tracking branch 'origin/master' into returnVerificationR…
keyboardDrummer Mar 11, 2022
ce5ecbf
Move method
keyboardDrummer Mar 11, 2022
f3ed07d
Move exception handling
keyboardDrummer Mar 11, 2022
4353489
fixed bug in the injection of preconditions for yielding procedures i…
shazqadeer Mar 13, 2022
b0214fc
Add backwards compatibility methods
keyboardDrummer Mar 14, 2022
353c177
Merge branch 'master' into returnVerificationResultTasks
keyboardDrummer Mar 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
env:
SOLUTION: Source/Boogie.sln
Z3URL: https://github.com/Z3Prover/z3/releases/download/z3-4.8.8/z3-4.8.8-x64-ubuntu-16.04.zip
CVC5URL: https://github.com/cvc5/cvc5/releases/latest/download/cvc5-Linux

jobs:
job0:
Expand All @@ -20,6 +21,7 @@ jobs:
strategy:
matrix:
configuration: [Debug, Release]
lit_param: ["batch_mode=True", "batch_mode=False"]
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v1
Expand All @@ -35,6 +37,10 @@ jobs:
wget ${Z3URL}
unzip z3*.zip
export PATH="$(find $PWD/z3* -name bin -type d):$PATH"
# Download a CVC5 release
mkdir -p bin
(cd bin && wget ${CVC5URL} && mv cvc5-Linux cvc5 && chmod +x cvc5)
export PATH="$PWD/bin:$PATH"
# Install python tools
sudo pip3 install setuptools
sudo pip3 install lit OutputCheck pyyaml psutil
Expand All @@ -53,7 +59,7 @@ jobs:
# Run unit tests
dotnet test --no-build -c ${{ matrix.configuration }} ${SOLUTION}
# Run lit test suite
lit -v --timeout=120 -D configuration=${{ matrix.configuration }} Test
lit --param ${{ matrix.lit_param }} -v --timeout=120 -D configuration=${{ matrix.configuration }} Test
- name: Deploy to nuget
if: matrix.configuration == 'Release' && startsWith(github.ref, 'refs/tags/v')
run: dotnet nuget push "Source/**/bin/${{ matrix.configuration }}/Boogie*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
12 changes: 6 additions & 6 deletions Source/AbsInt/IntervalDomain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ abstract class E_Common : NativeLattice.Element

class E_Bottom : E_Common
{
public override Expr ToExpr()
public override Expr ToExpr(CoreOptions options)
{
return Expr.False;
}
Expand All @@ -33,12 +33,12 @@ public E(Node n)
N = n;
}

public override Expr ToExpr()
public override Expr ToExpr(CoreOptions options)
{
Expr expr = Expr.True;
for (var n = N; n != null; n = n.Next)
{
expr = BplAnd(expr, n.ToExpr());
expr = BplAnd(expr, n.ToExpr(options));
}

return expr;
Expand Down Expand Up @@ -212,10 +212,10 @@ public static IEnumerable<Tuple<Node, Node>> Merge(Node a, Node b)
}
}

public Expr ToExpr()
public Expr ToExpr(CoreOptions options)
{
if (!V.IsMutable && CommandLineOptions.Clo.InstrumentInfer !=
CommandLineOptions.InstrumentationPlaces.Everywhere)
if (!V.IsMutable && options.InstrumentInfer !=
CoreOptions.InstrumentationPlaces.Everywhere)
{
// omit invariants about readonly variables
return Expr.True;
Expand Down
51 changes: 29 additions & 22 deletions Source/AbsInt/NativeLattice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public abstract class NativeLattice
/// </summary>
public abstract class Element
{
public abstract Expr ToExpr();
public abstract Expr ToExpr(CoreOptions options);
}

public abstract Element Top { get; }
Expand Down Expand Up @@ -70,14 +70,21 @@ public virtual void Validate()

public class NativeAbstractInterpretation
{
public static void RunAbstractInterpretation(Program program)
private CoreOptions options;

public NativeAbstractInterpretation(CoreOptions options)
{
this.options = options;
}

public void RunAbstractInterpretation(Program program)
{
Contract.Requires(program != null);

Helpers.ExtraTraceInformation("Starting abstract interpretation");
Helpers.ExtraTraceInformation(options, "Starting abstract interpretation");

DateTime start = new DateTime(); // to please compiler's definite assignment rules
if (CommandLineOptions.Clo.Trace)
if (options.Trace)
{
Console.WriteLine();
Console.WriteLine("Running abstract interpretation...");
Expand All @@ -87,11 +94,11 @@ public static void RunAbstractInterpretation(Program program)
WidenPoints.Compute(program);

NativeLattice lattice = null;
if (CommandLineOptions.Clo.Ai.J_Trivial)
if (options.Ai.J_Trivial)
{
lattice = new TrivialDomain();
}
else if (CommandLineOptions.Clo.Ai.J_Intervals)
else if (options.Ai.J_Intervals)
{
lattice = new NativeIntervalDomain();
}
Expand All @@ -100,13 +107,13 @@ public static void RunAbstractInterpretation(Program program)
{
Dictionary<Procedure, Implementation[]> procedureImplementations = ComputeProcImplMap(program);
ComputeProgramInvariants(program, procedureImplementations, lattice);
if (CommandLineOptions.Clo.Ai.DebugStatistics)
if (options.Ai.DebugStatistics)
{
Console.Error.WriteLine(lattice.DebugStatistics);
}
}

if (CommandLineOptions.Clo.Trace)
if (options.Trace)
{
DateTime end = DateTime.UtcNow;
TimeSpan elapsed = end - start;
Expand All @@ -132,7 +139,7 @@ private static Dictionary<Procedure, Implementation[]> ComputeProcImplMap(Progra
/// <summary>
/// Compute and apply the invariants for the program using the underlying abstract domain.
/// </summary>
public static void ComputeProgramInvariants(Program program,
public void ComputeProgramInvariants(Program program,
Dictionary<Procedure, Implementation[]> procedureImplementations, NativeLattice lattice)
{
Contract.Requires(program != null);
Expand All @@ -157,7 +164,7 @@ public static void ComputeProgramInvariants(Program program,
foreach (var impl in procedureImplementations[proc])
{
// add the precondition to the axioms
Substitution formalProcImplSubst = Substituter.SubstitutionFromDictionary(impl.GetImplFormalMap());
Substitution formalProcImplSubst = Substituter.SubstitutionFromDictionary(impl.GetImplFormalMap(options));
var start = initialElement;
foreach (Requires pre in proc.Requires)
{
Expand All @@ -173,14 +180,14 @@ public static void ComputeProgramInvariants(Program program,
}
}

public static void Analyze(Implementation impl, NativeLattice lattice, NativeLattice.Element start)
public void Analyze(Implementation impl, NativeLattice lattice, NativeLattice.Element start)
{
// We need to keep track of some information for each(some) block(s). To do that efficiently,
// we number the implementation's blocks sequentially, and then we can use arrays to store
// the additional information.
var pre = new NativeLattice.Element[impl.Blocks
.Count]; // set to null if we never compute a join/widen at this block
var post = CommandLineOptions.Clo.InstrumentInfer == CommandLineOptions.InstrumentationPlaces.Everywhere
var post = options.InstrumentInfer == CoreOptions.InstrumentationPlaces.Everywhere
? new NativeLattice.Element[impl.Blocks.Count]
: null;
var iterations = new int[impl.Blocks.Count];
Expand Down Expand Up @@ -223,7 +230,7 @@ public static void Analyze(Implementation impl, NativeLattice lattice, NativeLat
// no change
continue;
}
else if (b.widenBlock && CommandLineOptions.Clo.Ai.StepsBeforeWidening <= iterations[id])
else if (b.widenBlock && options.Ai.StepsBeforeWidening <= iterations[id])
{
e = lattice.Widen(pre[id], e);
pre[id] = e;
Expand Down Expand Up @@ -261,22 +268,22 @@ public static void Analyze(Implementation impl, NativeLattice lattice, NativeLat
Instrument(impl, pre, post);
}

static void Instrument(Implementation impl, NativeLattice.Element[] pre, NativeLattice.Element[] post)
void Instrument(Implementation impl, NativeLattice.Element[] pre, NativeLattice.Element[] post)
{
Contract.Requires(impl != null);
Contract.Requires(pre != null);

foreach (var b in impl.Blocks)
{
var element = pre[b.aiId];
if (element != null && (b.widenBlock || CommandLineOptions.Clo.InstrumentInfer ==
CommandLineOptions.InstrumentationPlaces.Everywhere))
if (element != null && (b.widenBlock || options.InstrumentInfer ==
CoreOptions.InstrumentationPlaces.Everywhere))
{
List<Cmd> newCommands = new List<Cmd>();
Expr inv = element.ToExpr();
Expr inv = element.ToExpr(options);
PredicateCmd cmd;
var kv = new QKeyValue(Token.NoToken, "inferred", new List<object>(), null);
if (CommandLineOptions.Clo.InstrumentWithAsserts)
if (options.InstrumentWithAsserts)
{
cmd = new AssertCmd(Token.NoToken, inv, kv);
}
Expand All @@ -289,9 +296,9 @@ static void Instrument(Implementation impl, NativeLattice.Element[] pre, NativeL
newCommands.AddRange(b.Cmds);
if (post != null && post[b.aiId] != null)
{
inv = post[b.aiId].ToExpr();
inv = post[b.aiId].ToExpr(options);
kv = new QKeyValue(Token.NoToken, "inferred", new List<object>(), null);
if (CommandLineOptions.Clo.InstrumentWithAsserts)
if (options.InstrumentWithAsserts)
{
cmd = new AssertCmd(Token.NoToken, inv, kv);
}
Expand All @@ -312,7 +319,7 @@ static void Instrument(Implementation impl, NativeLattice.Element[] pre, NativeL
/// The abstract transition relation.
/// 'cmd' is allowed to be a StateCmd.
/// </summary>
static NativeLattice.Element Step(NativeLattice lattice, Cmd cmd, NativeLattice.Element elmt)
NativeLattice.Element Step(NativeLattice lattice, Cmd cmd, NativeLattice.Element elmt)
{
Contract.Requires(lattice != null);
Contract.Requires(cmd != null);
Expand Down Expand Up @@ -364,7 +371,7 @@ static NativeLattice.Element Step(NativeLattice lattice, Cmd cmd, NativeLattice.
else if (cmd is SugaredCmd)
{
var c = (SugaredCmd) cmd;
elmt = Step(lattice, c.Desugaring, elmt);
elmt = Step(lattice, c.GetDesugaring(options), elmt);
}
else if (cmd is CommentCmd)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/AbsInt/TrivialDomain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public E(bool isTop)
IsTop = isTop;
}

public override Expr ToExpr()
public override Expr ToExpr(CoreOptions options)
{
return Expr.Literal(IsTop);
}
Expand Down
22 changes: 10 additions & 12 deletions Source/BoogieDriver/BoogieDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@ public static int Main(string[] args)
{
Contract.Requires(cce.NonNullElements(args));


var options = new CommandLineOptionsImpl
var options = new CommandLineOptions(new ConsolePrinter())
{
RunningBoogieFromCommandLine = true
};
ExecutionEngine.printer = new ConsolePrinter(options);
CommandLineOptionsImpl.Install(options);

if (!options.Parse(args))
{
return 1;
}
using var executionEngine = ExecutionEngine.CreateWithoutSharedCache(options);

if (options.ProcessInfoFlags())
{
Expand All @@ -31,7 +29,7 @@ public static int Main(string[] args)

if (options.Files.Count == 0)
{
ExecutionEngine.printer.ErrorWriteLine(Console.Out, "*** Error: No input files were specified.");
options.Printer.ErrorWriteLine(Console.Out, "*** Error: No input files were specified.");
return 1;
}

Expand All @@ -46,7 +44,7 @@ public static int Main(string[] args)
string errMsg = options.XmlSink.Open();
if (errMsg != null)
{
ExecutionEngine.printer.ErrorWriteLine(Console.Out, "*** Error: " + errMsg);
options.Printer.ErrorWriteLine(Console.Out, "*** Error: " + errMsg);
return 1;
}
}
Expand All @@ -63,13 +61,13 @@ public static int Main(string[] args)
Console.WriteLine("--------------------");
}

Helpers.ExtraTraceInformation("Becoming sentient");
Helpers.ExtraTraceInformation(options, "Becoming sentient");

var success = ExecutionEngine.ProcessFiles(options, fileList);
var success = executionEngine.ProcessFiles(Console.Out, fileList);

if (CommandLineOptions.Clo.XmlSink != null)
if (options.XmlSink != null)
{
CommandLineOptions.Clo.XmlSink.Close();
options.XmlSink.Close();
}

if (options.Wait)
Expand All @@ -81,7 +79,7 @@ public static int Main(string[] args)
return success ? 0 : 1;
}

private static List<string> GetFileList(CommandLineOptionsImpl options)
private static List<string> GetFileList(CommandLineOptions options)
{
List<string> fileList = new List<string>();
foreach (string file in options.Files)
Expand Down Expand Up @@ -115,7 +113,7 @@ private static List<string> GetFileList(CommandLineOptionsImpl options)

if (extension != ".bpl")
{
ExecutionEngine.printer.ErrorWriteLine(
options.Printer.ErrorWriteLine(
Console.Out,
"*** Error: '{0}': Filename extension '{1}' is not supported. Input files must be BoogiePL programs (.bpl).",
file,
Expand Down
Loading