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

Topic/genc v2: ready for general review #290

Merged
merged 77 commits into from
Feb 14, 2017
Merged

Topic/genc v2: ready for general review #290

merged 77 commits into from
Feb 14, 2017

Commits on Feb 13, 2017

  1. Make GenCSuite more robust

     - augment list of known compilers (with compcert)
     - adapt this list for the current OS
     - use advanced parameters (e.g. sanitizers)
     - run all found compilers
     - add ability to disable a given compiler on a case-by-case basis
     - ignore files generated by tests
     - improve error messages
     - report warnings and other errors from the GenC phase (and others)
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    37b7e5a View commit details
    Browse the repository at this point in the history
  2. Add many regression tests

    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    420b145 View commit details
    Browse the repository at this point in the history
  3. Clean slate for GenC

    Removed GenC in view of GenC v2
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    86a0538 View commit details
    Browse the repository at this point in the history
  4. Add TimedLeonPhase trait

    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    bf7d3b1 View commit details
    Browse the repository at this point in the history
  5. Implement RemoveVCPhase

    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    d35c0d3 View commit details
    Browse the repository at this point in the history
  6. Add GenC v2

    This new implementation of GenC uses a pipelined approach: the translation of Scala code into C99 equivalent code is split into several phases that live in the `leon.genc.phases` package. The overall process is bases on several versions of an Intermediate Representation (IR) that is defined under `leon.genc.ir`. Additionally, the C AST was partially redesigned.
    
    This new implementation is supposed to be better than the previous version in terms of bugs but there remain a few areas for improvement:
      * The `ClassLifter` is slightly incomplete: class fields should be processed as well.
      * When converting nested generic functions, the Scala2IRPhase might not do a proper job.
    
    Both of these points are explained in the source code; see the corresponding TODOs.
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    0e280b1 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c31230a View commit details
    Browse the repository at this point in the history
  8. Make sure to use a new reporter for each test in GenCSuite

    This avoids propagating failures from one test to the next.
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    6e56930 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    0e9528c View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    09cb198 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    6cd74d0 View commit details
    Browse the repository at this point in the history
  12. Add missing update of IR

    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    3c00391 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    f40514e View commit details
    Browse the repository at this point in the history
  14. Blind attempt to improve GenCSuite for Larabot

    Hope is that shutting down fsc will prevent two concurrent build to
    mess with one another.
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    3907f38 View commit details
    Browse the repository at this point in the history
  15. Explicitly reject ArrayUpdated constructs

    ArrayUpdated, which represents Array.updated(index, newValue) and therefore builds a new array, should not be confused by ArrayUpdate, which updates a given array element in place.
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    0321eb5 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    7c5fe34 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    ad0266c View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    862775f View commit details
    Browse the repository at this point in the history
  19. Ensure GenC tests actually test something

    Since the introduction of the new dependency finder, many functions/types were no longer examined by GenC.
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    121d765 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    91b4dff View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    4d4ad3f View commit details
    Browse the repository at this point in the history
  22. Make GenC tests return a value in [0, 255] to avoid false positive

    On most systems, the return value from a program is truncated to its
    least significant byte.
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    be87190 View commit details
    Browse the repository at this point in the history
  23. Add regression test for operator Equals

    Note: this could get supported by generating the proper function definitions and replacing the operator by a function call.
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    240326b View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    ffaa95c View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    bd81242 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    fe3bb1f View commit details
    Browse the repository at this point in the history
  27. Remove useless optimisation of id translation

    This can also prevent some clashes with C std functions.
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    d151c31 View commit details
    Browse the repository at this point in the history
  28. Update regression test about invalid pattern matching

    Xlang now ensures no side effect so we remove this test from GenC.
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    0472cd5 View commit details
    Browse the repository at this point in the history
  29. Minor improvements of FIS/FOS

    Note: when using the private ctor of FIS/FOS, Leon will emit something like this:
    
    [info] [ Error  ] Test.scala:93:16: Class leon.io.FileInputStream not defined?
    [info]                val fis1 = FIS(Some("input.txt"))
    [info]                           ^^^
    
    and therefore identifying the call to the constructor as faulty.
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    1dd6229 View commit details
    Browse the repository at this point in the history
  30. Cosmetic update

    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    8e015bf View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    8460f96 View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    a5f5a76 View commit details
    Browse the repository at this point in the history
  33. Fix shift conversion to C

     - Use >>> in Scala to represent >> in C;
     - Cast signed integer to unsigned integer before shifting, and cast result back to signed integer afterward (see NOTE in code for rational)
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    2516a3c View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    e463dbb View commit details
    Browse the repository at this point in the history
  35. Make GenCSuite robust against encoding issues

    Now the outputs are compared at a byte level, not at a string level
    (which can be invalid).
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    c198ce0 View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    8929200 View commit details
    Browse the repository at this point in the history
  37. Add support for more forms of Pattern Matching in GenC

    Namely, LetTuple & LetPattern constructs
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    c592017 View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    f71f3f1 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    261bcb9 View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    49ae298 View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    a539b6a View commit details
    Browse the repository at this point in the history
  42. Fix more aliasing issues

    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    584ae3b View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    782c9b9 View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    bbf6d6e View commit details
    Browse the repository at this point in the history
  45. Fix some typo

    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    b00e85f View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    b2a45f5 View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    4c99fcc View commit details
    Browse the repository at this point in the history
  48. Update GenC tests

    Make expected errors more obvious in tests
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    739a1c7 View commit details
    Browse the repository at this point in the history
  49. Configuration menu
    Copy the full SHA
    02b89d8 View commit details
    Browse the repository at this point in the history
  50. Add some aliasing regression tests that should get rejected

    They are currently disabled because implementing a rejection phase for those is not as simple as it might seem. Similar cases can occur though pattern matching, for example.
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    9194733 View commit details
    Browse the repository at this point in the history
  51. Emit warnings on recursive functions

    Let the user know this is not 100% MISRA compliant. With stack size analysis this issue could be solved.
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    9b4a33d View commit details
    Browse the repository at this point in the history
  52. Enable more C optimisation by making every function static

    Except for the main function which should not be static
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    1b8e55f View commit details
    Browse the repository at this point in the history
  53. Configuration menu
    Copy the full SHA
    ca6a2de View commit details
    Browse the repository at this point in the history
  54. Configuration menu
    Copy the full SHA
    76b546a View commit details
    Browse the repository at this point in the history
  55. LZW v2.dirty

    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    2855b6b View commit details
    Browse the repository at this point in the history
  56. Remove debug output in LZW

    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    3282308 View commit details
    Browse the repository at this point in the history
  57. Configuration menu
    Copy the full SHA
    bedc207 View commit details
    Browse the repository at this point in the history
  58. Remove old code from LZW

    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    fc1236d View commit details
    Browse the repository at this point in the history
  59. Avoid overflow in LZW

    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    38f1c76 View commit details
    Browse the repository at this point in the history
  60. Update LZW parameters

    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    b687527 View commit details
    Browse the repository at this point in the history
  61. Rename function

    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    34ff8ee View commit details
    Browse the repository at this point in the history
  62. Use a different representation for Dictionary in LZW

    This representation is less efficient in terms of speed of the produced code, but requires far less small arrays and therefore significantly improve the performance of GenC and C compilers to compile the code.
    
    Also, less properties are proven on this implementation.
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    b98422b View commit details
    Browse the repository at this point in the history
  63. Configuration menu
    Copy the full SHA
    ec5db50 View commit details
    Browse the repository at this point in the history
  64. Move some tests around

     - Aliasing3 is disabled because it make verification crash (see #289)
     - Aliasing4 is disabled because it make verification produce incorrect counter-example (see #287)
     - Inheritance9 is disabled because it make xlang crash (see #288)
     - UsingConcreteCLasses is enabled because verification is easy
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    c8ecf7c View commit details
    Browse the repository at this point in the history
  65. Configuration menu
    Copy the full SHA
    8ca576f View commit details
    Browse the repository at this point in the history
  66. Moving LZW implementations to a new testcases section

    Because they are slow to generate, slow to compile and slow to execute,
    they cannot be part of the regression suite.
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    ec37922 View commit details
    Browse the repository at this point in the history
  67. Fix generation of union

    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    1748148 View commit details
    Browse the repository at this point in the history
  68. Update LZW parameters

    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    46be524 View commit details
    Browse the repository at this point in the history
  69. Configuration menu
    Copy the full SHA
    70138c5 View commit details
    Browse the repository at this point in the history
  70. Configuration menu
    Copy the full SHA
    f77238b View commit details
    Browse the repository at this point in the history
  71. Configuration menu
    Copy the full SHA
    a583e1b View commit details
    Browse the repository at this point in the history
  72. Configuration menu
    Copy the full SHA
    05c2136 View commit details
    Browse the repository at this point in the history
  73. Configuration menu
    Copy the full SHA
    a35be9a View commit details
    Browse the repository at this point in the history
  74. Configuration menu
    Copy the full SHA
    3b53420 View commit details
    Browse the repository at this point in the history
  75. Configuration menu
    Copy the full SHA
    5e84253 View commit details
    Browse the repository at this point in the history
  76. Fix typos

    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    bae8c9a View commit details
    Browse the repository at this point in the history
  77. Add case study ImageProcessing for GenC

    Use comments to select the kernel you want to use, then recompile.
    mantognini committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    e27a4f7 View commit details
    Browse the repository at this point in the history