Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update traceInduct and clustering #1052

Merged
merged 6 commits into from
May 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions core/src/main/scala/stainless/Component.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ object optFunctions extends inox.OptionDef[Seq[String]] {
val usageRhs = "f1,f2,..."
}

object optCompareFuns extends inox.OptionDef[Seq[String]] {
val name = "comparefuns"
val default = Seq[String]()
val parser = inox.OptionParsers.seqParser(inox.OptionParsers.stringParser)
val usageRhs = "f1,f2,..."
}

object optModels extends inox.OptionDef[Seq[String]] {
val name = "models"
val default = Seq[String]()
val parser = inox.OptionParsers.seqParser(inox.OptionParsers.stringParser)
val usageRhs = "f1,f2,..."
}

trait ComponentRun { self =>
val component: Component
val trees: ast.Trees
Expand Down
6 changes: 6 additions & 0 deletions core/src/main/scala/stainless/MainHelpers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ trait MainHelpers extends inox.MainHelpers { self =>
optVersion -> Description(General, "Display the version number"),
optConfigFile -> Description(General, "Path to configuration file, set to false to disable (default: stainless.conf or .stainless.conf)"),
optFunctions -> Description(General, "Only consider functions f1,f2,..."),
optCompareFuns -> Description(General, "Only consider functions f1,f2,... for equivalence checking"),
optModels -> Description(General, "Consider functions f1, f2, ... as model functions for equivalence checking"),
extraction.utils.optDebugObjects -> Description(General, "Only print debug output for functions/adts named o1,o2,..."),
extraction.utils.optDebugPhases -> Description(General, {
"Only print debug output for phases p1,p2,...\nAvailable: " +
Expand Down Expand Up @@ -166,6 +168,10 @@ trait MainHelpers extends inox.MainHelpers { self =>

import ctx.{ reporter, timers }

if (extraction.trace.Trace.optionsError) {
reporter.fatalError(s"Equivalence checking for --comparefuns and --models only works in batched mode.")
}

if (!useParallelism) {
reporter.warning(s"Parallelism is disabled.")
}
Expand Down
12 changes: 12 additions & 0 deletions core/src/main/scala/stainless/Report.scala
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,18 @@ trait AbstractReport[SelfType <: AbstractReport[SelfType]] { self: SelfType =>
case Level.Error => Console.RED
}

def hasError(identifier: Identifier)(implicit ctx: inox.Context): Boolean = {
annotatedRows.exists(elem => elem match {
case RecordRow(id, pos, level, extra, time) => level == Level.Error && id == identifier
})
}

def hasUnknown(identifier: Identifier)(implicit ctx: inox.Context): Boolean = {
annotatedRows.exists(elem => elem match {
case RecordRow(id, pos, level, extra, time) => level == Level.Warning && id == identifier
})
}

// Emit the report table, with all VCs when full is true, otherwise only with unknown/invalid VCs.
private def emitTable(full: Boolean)(implicit ctx: inox.Context): Table = {
val rows = processRows(full)
Expand Down
Loading