Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
 
 

For simplicity, all instructions using the 'sbt' command line.

  1. The output directories are ep-scala-XXX for Scala generated code or ep-java-XXX for Java-generated code. Note that 'dispatch' is not generated (yet) by the Scala generator. The following are the systems that you can generate:

    • ep-java (GenerateAllMain)

      • System: system-main.json
      • Approaches: oo visitor visitorSideEffect extensibleVisitor interpreter coco trivially dispatch algebra
      • Evolutions: M0 M1 M2 M3 M4 M5 M6 M7 M7I2 M8 M9 I1 A1 A1M3 A1M3I2 A3 I2 O1 O2 OA O1OA OD1 OD2 OD3 OO1 OO2 OO3
    • ep-java-j (GenerateAllJ)

      • System: system-j.json
      • Approaches: oo visitor visitorSideEffect extensibleVisitor interpreter coco trivially dispatch algebra
      • Evolutions: M0 J1 J2 J3 K1 K2 J4 J5 J6 K2J6 J7 J8
    • ep-java-d1d2 (GenerateAllD1D2)

      • Approaches: oo visitor visitorSideEffect extensibleVisitor interpreter coco trivially dispatch algebra
      • Evolutions: M0 M1 D1 D2 D1D2 D3
    • ep-java-merging (GenerateAllMerging)

      • Approaches: oo visitor visitorSideEffect extensibleVisitor interpreter coco trivially dispatch algebra
      • Evolutions: M0 M1 M2 I1 I2 N1 M2_ABS M3 M3I1 I2M3I1N1
    • ep-java-extended (GenerateAllExtended)

      • Approaches: oo visitor visitorSideEffect extensibleVisitor interpreter coco trivially dispatch algebra
      • Evolutions: M0 M1 M2 M3 W1 M3W1 Q1 C2 V1
    • ep-java-third-alternate (GenerateAllThirdAlternate)

      • Approaches: oo visitor visitorSideEffect extensibleVisitor interpreter coco trivially dispatch algebra
      • Evolutions: M0 X1 X2 X3 X2X3 X4

For Scala-generated code, the above are replaced with ep-scala-XXX and approaches and evolutions remain the same.

Note: you can generate all of these from the command line where the build.sbt file exists by typing:

sbt "language-java/runMain org.combinators.ep.language.java.GenerateAllXXX"

or

sbt "language-newScala/runMain org.combinators.ep.language.scala.codegen.GenerateAllXXX"

Depending on the system, this could take 5 minutes (GenerateAllD1D2) or 45 minutes (GenerateAllMain).

  1. Produce full report to validate which AIPs are truly correct

c:\Python37\python.exe ..\..\scripts\compare.py ..\..\scripts\systems\[EVOLUTION-JSON] >> REPORT

or

python3 ../../scripts/compare.py ../../scripts/systems/[EVOLUTION-JSON] >> REPORT

Example EVOLUTION-JSON files are system-j.json or system-main.json

If you are comparing Scala generated code, be sure to include 'scala' as the final argument

Note that the JSON files look like the following and contain predecessor information for each EIP to make the Python processing a bit easier.

     {
       "evolutions" : [
         { "J1" : ["M0"] },
         { "J2" : ["J1"] },
         ...
      }

This script assesses whether an approach minimally satisfies the Expression Problem. That is, future evolutions do not require any changes to former artifacts.

This script must be run in the directory that was generated by GenerateAllXXX invocations.

Note that it does not identify situations where, for example, non-trivial code is copied and used in a subsequent evolution. For example, the interpreter approach requires code to be copies with producer operations.

 // Within original M4 evolution
 // ------------------------------
 public Exp simplify() {
        if ((Double.valueOf(((Exp) this.left).eval()).equals(0.0) || Double.valueOf(((Exp) this.right).eval()).equals(0.0))) {
            return new Lit(0.0);
        } else if (Double.valueOf(((Exp) this.left).eval()).equals(1.0)) {
            return ((Exp) this.right).simplify();
        } else if (Double.valueOf(((Exp) this.right).eval()).equals(1.0)) {
            return ((Exp) this.left).simplify();
        } else {
            return new ep.m4.Mult(((Exp) this.left).simplify(), ((Exp) this.right).simplify());
        }
    }

 // Within original M7I2 evolution
 // ------------------------------
 public Exp simplify() {
     if ((Double.valueOf(((Exp) this.left).eval()).equals(0.0) || Double.valueOf(((Exp) this.right).eval()).equals(0.0))) {
         return new Lit(0.0);
     } else if (Double.valueOf(((Exp) this.left).eval()).equals(1.0)) {
         return ((Exp) this.right).simplify();
     } else if (Double.valueOf(((Exp) this.right).eval()).equals(1.0)) {
         return ((Exp) this.left).simplify();
     } else {
         return new ep.m7i2.Mult(((Exp) this.left).simplify(), ((Exp) this.right).simplify());
     }
 }
  1. Compile and run tests cases to generate jacoco.* code coverage reports.

In the respective ep-java-XXX directories, execute the following Python script:

c:\Python37\python.exe ..\..\scripts\compile.py

or

python3 ../../scripts/compile.py

In the respective ep-scala-XXX directories, execute the following Python script:

c:\Python37\python.exe ..\..\scripts\compile.py

or

python3 ../../scripts/compile.py

Note: The length of the compilation time depends on the complexity of the Extension Graph for the chosen system. Be prepared for this process to take about 30-45 minutes. Information about the compilation and testing process is stored in created jacoco.* files, one per approach.

  1. Generate statistics regarding the results of generating the source code, compiling the source code, executing the test cases and code coverage statistics. This script also detects errors in these three phases.

    In the respective ep-java-XXX directories, execute the following Python script:

c:\Python37\python.exe ..\..\scripts\process.py > STATISTICS

or

python3 ../../scripts/process.py > STATISTICS

In the respective ep-scala-XXX directories, execute the following Python script:

c:\Python37\python.exe ..\..\scripts\process.py > STATISTICS

or

python3 ../../scripts/process.py > STATISTICS

  1. If you are on a Linux machine and have generated GenerateAllJ and have CLOC installed within the target/ directory, additional code statistics can be generated using the stats.sh script.

  2. When all scripts have run, you may need to delete temporary directories inside of target/bg-jobs that were created by sbt (but not deleted). A full run of the scripts often results in several GB worth of directories.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.