Luke Manual

Luke is a tool for processing of Lustre files. It contains a Lustre simulator, verification tool, and a compiler.

  • Downloading Luke
  • Simulating Lustre using Luke
  • Verifying Lustre using Luke
  • Luke Command-line Options
  • Lustre Subset supported by Luke
  • Using Luke at home

  • Downloading Luke

    You can also download Luke. Luke is implemented as one single executable, available in the following formats:

  • Luke for Windows

  • Luke for Linux

  • Luke for FreeBSD

  • Luke for Solaris
  • Caution: Luke is still beta software!


    Simulating Lustre Code

    To simulate a Lustre program, you have to pick a main node. Then, if your file is called file.lus and your top node is called Node, you can write:

      prompt> luke file.lus --node Node
      Tracer generated in file 'Luke/Node.html'.
    
    Now, you can use a web browser to look at the result. Either type:
      prompt> mozilla Luke/Node.html &
    
    Or load the file in your favorite web browser. (Or press reload if you were already looking at it!)

    An example of what a simulator produced by Luke might look like is here.


    Verifying Lustre Code

    In order to verify properties about a Lustre program, you will have to write a top-node that is a synchronous observer. Then, if your file is called file.lus and your observer is called Prop, you can write:

      prompt> luke file.lus --verify --node Prop
      Valid. All checks succeeded. Maximal depth was 1.
    
    If you are lucky, your property succeeded and Luke managed to verify it. It also tells you the maximal induction depth it used.

    If your property does not hold, you might get the following behavior:

      prompt> luke file.lus --verify --node Prop
      *** CHECK FAILED ("file.lus", line 147):
      Falsified output 'OK' in node 'Prop' at depth 2.
      Counter-example generated in file 'Luke/Prop.html'.
    
    Your property was not correct, and Luke has generated a trace that exhibits the error in the file Luke/Prop.html, which you again can view using a webbrowser.


    Luke Command-line Options

    --node node
    The name of the top-node. This argument is obligatory!
    Example: --node main
    --verify
    Verify all boolean outputs of top-node, and all checks.
    Default: (off)
    --cutoff num
    Do not perform induction beyond depth num. If greater depth is needed, a warning is issued.
    Example: --cutoff 20
    Default: (off)
    --int num
    Use bitwidth num for integers. If you want to be able to deal with larger numbers, increase this. If you want your verification to go faster, decrease this.
    Example: --int 32
    Default: --int 16
    --verbose
    Display information about all steps of the induction while performing induction.
    --root path
    A directory in which included files will be sought.
    Example: --root Library
    Default: --root .
    --version
    Display the current version of the tool.
    --help
    Displays all options.


    Lustre Subset

    Luke only supports a subset of Lustre. The following constructs are supported:

    node, include,
    bool, int,
    if then else, pre, ->,
    and, or, xor, not, =>,
    =, <>, <, <=, >=, >,
    +, -, *, /, %.

    The following constructs are not supported:

    arrays, const, assert, #, when, with, real.

    Luke relaxes the following restrictions in Lustre (this is important if you want to use other Lustre tools). In Luke (contrary to Lustre):

    nodes with no inputs are allowed,
    = and <> can be used on type bool.


    Using Luke at Home

    If you want to use Luke at home, while being remotely logged in, it is probably easiest to do the following. Here, I assume that you have the possibility on this filesystem to create your own homepage; let the filesystem path to your homepage be /path/to/my/homepage/, and let the URL to your homepage be http://www.url.to/my/homepage/.

    1. Log in remotely in the usual way (using ssh).

    2. Go to the path /path/to/my/homepage/.

    3. Type: mkdir Luke.

    4. Go to your working directory (with your Lustre files).

    5. Remove or move any existing directory called Luke here.

    6. Type: ln -s /path/to/my/homepage/Luke Luke.

    7. Now, you can use luke in the normal way.

    8. If you want to look at your simulators, use the webbrowser on the machine you are working on to look at http://www.url.to/my/homepage/Luke/.

    9. You might have to change file access rights for the Luke files to be visible!




    Course Info

      Announcements

      Syllabus

      Lectures

    Course Work

      Exercises

      Mini Projects

      Exams

      Readings

      Tools

    Misc

      Resources

      Credits