Packages

  • package root
    Definition Classes
    root
  • object Main

    Fork of Scala-AM (written by Quentin Stiévenart) https://github.com/acieroid/scala-am with the final goal to parallelize it: https://bitbucket.org/OPiMedia/scala-par-am

    Fork of Scala-AM (written by Quentin Stiévenart) https://github.com/acieroid/scala-am with the final goal to parallelize it: https://bitbucket.org/OPiMedia/scala-par-am

    Before looking at this, we recommend seeing how to use this framework. A detailed example is available in examples/LambdaCalculus.scala.

    This is the entry point. It parses the arguments, parses the input file and launches an abstract machine on the parsed expression (or launches a REPL if no input file is given). The pipeline goes as follows:

    1. The input program is parsed. For Scheme programs, 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).

    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.

    If you want to:

    • Support a new language: you will need:
      • A parser, you can look into exp/SExpParser.scala as an inspiration. If your language is s-expression based, you can use this parser and compile s-expressions into your abstract grammar. To do so, look at exp/scheme/Scheme.scala.
      • An abstract grammar, look at exp/SExp.scala or the SchemeExp class in exp/scheme/Scheme.scala.
      • A semantics, look at semantics/anf/ANFSemantics.scala for a simple example.
      • Support for your language operations at the lattice level. For this, you'll probably need to extend the lattices (see lattice/scheme/SchemeLattice.scala, lattice/scheme/ModularLattice.scala)
    • Play with abstract machines, you can look into AAM.scala.
    • Implement some kind of analysis, look at examples/LambdaCalculus.scala and examples/TaintAnalysis.scala.
    Definition Classes
    root
o

Main

object Main

Fork of Scala-AM (written by Quentin Stiévenart) https://github.com/acieroid/scala-am with the final goal to parallelize it: https://bitbucket.org/OPiMedia/scala-par-am

Before looking at this, we recommend seeing how to use this framework. A detailed example is available in examples/LambdaCalculus.scala.

This is the entry point. It parses the arguments, parses the input file and launches an abstract machine on the parsed expression (or launches a REPL if no input file is given). The pipeline goes as follows:

  1. The input program is parsed. For Scheme programs, 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).

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.

If you want to:

  • Support a new language: you will need:
    • A parser, you can look into exp/SExpParser.scala as an inspiration. If your language is s-expression based, you can use this parser and compile s-expressions into your abstract grammar. To do so, look at exp/scheme/Scheme.scala.
    • An abstract grammar, look at exp/SExp.scala or the SchemeExp class in exp/scheme/Scheme.scala.
    • A semantics, look at semantics/anf/ANFSemantics.scala for a simple example.
    • Support for your language operations at the lattice level. For this, you'll probably need to extend the lattices (see lattice/scheme/SchemeLattice.scala, lattice/scheme/ModularLattice.scala)
  • Play with abstract machines, you can look into AAM.scala.
  • Implement some kind of analysis, look at examples/LambdaCalculus.scala and examples/TaintAnalysis.scala.
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Main
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate() @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. def main(args: Array[String]): Unit
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. def run[Exp, Abs, Addr, Time](machine: AbstractMachine[Exp, Abs, Addr, Time], sem: Semantics[Exp, Abs, Addr, Time])(program: String, outputDot: Option[String], outputJSON: Option[String], timeout: Option[Long], inspect: Boolean)(implicit arg0: Expression[Exp], arg1: JoinLattice[Abs], arg2: Address[Addr], arg3: Timestamp[Time]): (Int, Double)

    Run a machine on a program with the given semantics.

    Run a machine on a program with the given semantics. If @param output is set, generate a dot graph visualizing the computed graph in the given file. Return the number of states and time taken.

  16. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  17. def toString(): String
    Definition Classes
    AnyRef → Any
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. 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 AnyRef

Inherited from Any

Ungrouped