Packages

object Main extends App

Scala-Par-AM is a modified version of Scala-AM with the goal to study the parallelization of abstract interpretation, focused on analysis of Scheme programs. Some unused parts of Scala-AM have been removed. The essential parts are in the machine/ sub-directory.

This main program executes some abstract machines on some Scheme programs depending of some parameters and print results in TSV format (data separated by tabulation).

Run with --help command line parameter to show all options:

$ java -jar scala-par-am.jar --help

Or directly with the shell script that also set some JVM configurations:

$ ./scala-par-am.sh --help

This example:

$ ./scala-par-am.sh --files "Scheme-examples/OPi/factorial*.scm" --machines SeqAAMLS,ParAAMLSAPart,ParAAMCPart --processes 1,4,2
runs on files that match the "Scheme-examples/OPi/factorial*.scm" path with machine SeqAAMLS on 1 process, with machine ParAAMLSAPart on 4 and 2 processes, and with machine ParAAMCPart with 1, 4 and 2 processes.

scala-par-am.jar can be downloaded directly https://bitbucket.org/OPiMedia/scala-par-am/downloads/

scala-am.jar must be accessible in the classpath to use oldAAM machine. Download it if necessary: https://bitbucket.org/OPiMedia/scala-am/downloads/

Depending of command line parameters, for each lattice specified, for each bound, for each address, for each file Scheme program, for default step and/or step with filter, for each machine and for each number of processes this program do the following:

1. The input Scheme program is parsed. It is done by:

  • Parsing the file as a list of s-expressions (exp/SExp.scala, exp/SExpParser.scala)
  • Compiling these s-expressions into Scheme expressions (exp/scheme/Scheme.scala)

2. To run the program, we need an abstract machine and some semantics. Semantics definitions have to implement the Semantics interface (semantics/Semantics.scala).

3. Once the abstract machine is created and we have a semantics for the program we want to analyze, the abstract machine can perform its evaluation, relying on methods of the semantics class to know how to evaluate expressions. The abstract machine only deals with which states to evaluate in which order, where to store values, where to store continuations, how to push and pop continuations, etc. The semantics encode what to do when encountering a program construct. For example, the semantics can tell what to evaluate next, that a continuation needs to be pushed, or that a variable needs to be updated. The abstract machine will then respectively evaluate the expression needed, push the continuation, or update the variable.

Multiple abstract machine implementations are available, defined in the machine/ directory. Every abstract machine implementation has to implement the AbstractMachine interface (machine/AbstractMachine.scala).

List of all available machines:

  • oldAAM: to call AAMNS (AAM No Subsumption) of Scala-AM https://bitbucket.org/OPiMedia/scala-am
  • SeqAAM: sequential machine where the worklist implemented with a list of states
  • SeqAAMS: sequential machine where the worklist implemented with a set of states
  • SeqAAMLS: sequential machine where the worklist implemented with a list of sets of states
  • SeqAAMLSH: SeqAAMLS that includes to the worklist only the not halted states
  • ParAAMLSAState: ParAAM-L-SA-state for Parallel AAM - Loop - SenderAggregator - state
  • ParAAMLSASet: ParAAM-L-SA-set for Parallel AAM - Loop - SenderAggregator - set
  • ParAAMLSAPart: ParAAM-L-SA-part for Parallel AAM - Loop - SenderAggregator - part
  • ParAAMCSState: ParAAM-C-S-state for Parallel AAM - Concurrent - Sender - state
  • ParAAMCSSet: ParAAM-C-S-set for Parallel AAM - Concurrent - Sender - set
  • ParAAMCSPart: ParAAM-C-S-part for Parallel AAM - Concurrent - Sender - part
  • ParAAMCState: ParAAM-C-state for Parallel AAM - Concurrent - state
  • ParAAMCSet: ParAAM-C-set for Parallel AAM - Concurrent - set
  • ParAAMCPart: ParAAM-C-part for Parallel AAM - Concurrent - part
  • ParAAMCHybrid: ParAAM-C-hybrid
  • ParAAMCSetH: ParAAM-C-set-halt
  • ParAAMCPartH: ParAAM-C-part-halt
  • ParAAMCHybridH: ParAAM-C-hybrid-halt

The abstract machine also uses a lattice to represent values. Lattices should implement the JoinLattice trait that can be found in lattice/JoinLattice.scala, which provides the basic features of a lattice.

Source https://bitbucket.org/OPiMedia/scala-par-am/src/master/scala-par-am/src/main/scala/Main.scala

Authors:

Olivier Pirson

Quentin Stiévenart (for the original Scala-AM that composes the biggest part of this project)

Version

June 18, 2020

Linear Supertypes
App, DelayedInit, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Main
  2. App
  3. DelayedInit
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class ParamsConfig(root: String = "", exceptsFilename: String = "", lattices: Seq[Configuration.Lattice.Value] = List(Configuration.Lattice.TypeSet), bounds: Seq[Int] = List(100), addresses: Seq[Configuration.Address.Value] = ..., filenamesPattern: String = "regex:.+\\.scm", stepFilters: Seq[Boolean] = List(false), machines: Seq[Configuration.Machine.Value] = ..., processes: Seq[Int] = List(1), filenamePrepare: String = "", nbRepetition: Int = 1, timeout: FiniteDuration = FiniteDuration(1, "day"), betweenTime: FiniteDuration = FiniteDuration(1, "second"), headerEnabled: Boolean = true, infoHeaderEnabled: Boolean = false, statsEnabled: Boolean = false, statsEscaped: Boolean = false, kamonEnabled: Boolean = false, outputGraphEnabled: Boolean = false, statsOutputGraphEnabled: Boolean = false, dotGraphEnabled: Boolean = false, isListMachines: Boolean = false, justListEnabled: Boolean = false, estimationTime: FiniteDuration = FiniteDuration(1, "second")) extends Product with Serializable

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def args: Array[String]
    Attributes
    protected
    Definition Classes
    App
    Annotations
    @deprecatedOverriding( "args should not be overridden" , "2.11.0" )
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate() @throws( ... )
  7. val default: ParamsConfig
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. val executionStart: Long
    Definition Classes
    App
    Annotations
    @deprecatedOverriding( ... , "2.11.0" )
  11. def foreachRun[U](config: ParamsConfig): Int

    For each file described in config, for each machine, lattice, process from config.machines, config.lattices and config.processes, apply run(lattice, bound, address, file, stepFilterEnabled, machine, process, config.timeout, config.nbRepetition, config.betweenTime, config.outputGraphEnabled, config.statsOutputGraphEnabled, config.dotGraphEnabled, config.statsEnabled, config.statsEscaped, config.justListEnabled).

    For each file described in config, for each machine, lattice, process from config.machines, config.lattices and config.processes, apply run(lattice, bound, address, file, stepFilterEnabled, machine, process, config.timeout, config.nbRepetition, config.betweenTime, config.outputGraphEnabled, config.statsOutputGraphEnabled, config.dotGraphEnabled, config.statsEnabled, config.statsEscaped, config.justListEnabled).

    If machine is oldAAM then apply runOld(lattice, bound, address, file, config.timeout, config.nbRepetition) instead run.

  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. def loadRunOldMainMethod: Method

    Load and return the MainAsScalaParAM.main method from scala-am.jar.

  16. def main(args: Array[String]): Unit
    Definition Classes
    App
    Annotations
    @deprecatedOverriding( "main should not be overridden" , "2.11.0" )
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. val parser: OptionParser[ParamsConfig] { ... /* 9 definitions in type refinement */ }

    Parses command line parameters and runs

  21. def printAverage(data: Seq[Double]): Unit

    Print average, etc.

    Print average, etc. of data

  22. def printEstimation(nbPrepared: Int, nbExecuted: Int, timeout: FiniteDuration, estimationTime: FiniteDuration, betweenTime: FiniteDuration): Unit

    Print number of estimation of time

  23. def printHeader(nbRepetition: Int, statsEnabled: Boolean, statsEscaped: Boolean): Unit

    Print the header corresponding to TSV data

  24. def printListMachines(): Unit

    Print the list of available machines with parallel information

  25. def readExcepts(filename: String): Set[String]

    Reads the file filename and returns set of files.

    Reads the file filename and returns set of files.

    The format of read filename is, for each line: [#] FILENAME [# COMMENT] Each line beginning by # is ignored.

    If filename doesn't exist then return an empty set.

  26. def run(latticeValue: Configuration.Lattice.Value, bound: Int, addressValue: Configuration.Address.Value, file: Path, stepFilterEnabled: Boolean, machineValue: Configuration.Machine.Value, process: Int, timeout: FiniteDuration, nbRepetition: Int, betweenTime: FiniteDuration, outputGraphEnabled: Boolean, statsOutputGraphEnabled: Boolean, dotGraphEnabled: Boolean, statsEnabled: Boolean, statsEscaped: Boolean, justListEnabled: Boolean): Int

    Dispatch to runOld (for oldAAM machine from Scala-AM) or to runNew (Scala-Par-AM machines).

  27. def runNew(latticeValue: Configuration.Lattice.Value, bound: Int, addressValue: Configuration.Address.Value, file: Path, stepFilterEnabled: Boolean, machineValue: Configuration.Machine.Value, process: Int, timeout: FiniteDuration, nbRepetition: Int, betweenTime: FiniteDuration, outputGraphEnabled: Boolean, statsOutputGraphEnabled: Boolean, dotGraphEnabled: Boolean, statsEnabled: Boolean, statsEscaped: Boolean, justListEnabled: Boolean): Int

    Run the machine (!= oldAAM) on file with corresponding parameters.

  28. def runOld(latticeValue: Configuration.Lattice.Value, bound: Int, address: Configuration.Address.Value, file: Path, timeout: FiniteDuration, nbRepetition: Int): Int

    Run oldAAM machine of Scala-AM on file with MainAsScalaParAM.main of scala-am.jar and corresponding parameters.

    Run oldAAM machine of Scala-AM on file with MainAsScalaParAM.main of scala-am.jar and corresponding parameters.

    The oldAAM machine of Scala-AM corresponds to the AAMNS machine of Scala-AM It is a version of the AAM machine of Scala-AM (written by Quentin Stiévenart) without the subsumption part (AAMNS - AAM No Subsumption). It can be considered as the original version of AAM of this Scala-Par-AM.

  29. lazy val runOldMainMethod: Method

    To run oldAAM machine (AAMNS - AAM No Subsumption) of Scala-AM on file with MainAsScalaParAM.main of scala-am.jar

  30. val scalaParAMVersion: String
  31. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  32. def toString(): String
    Definition Classes
    AnyRef → Any
  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  35. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def delayedInit(body: ⇒ Unit): Unit
    Definition Classes
    App → DelayedInit
    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) the delayedInit mechanism will disappear

  2. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from App

Inherited from DelayedInit

Inherited from AnyRef

Inherited from Any

Ungrouped