|
1 | 1 | # SeRu |
2 | 2 |
|
3 | | -SeRu is a tool for automatic program reduction. |
| 3 | +SeRu is a framework and tool for automatic program reduction. |
4 | 4 | It uses a combination of syntactic and semantic reduction strategies to combine speed and effectiveness. |
5 | 5 |
|
6 | | -SeRu is designed to support any semantic reduction command and any language. |
| 6 | +SeRu is designed to support any syntactic reduction command and any language. |
7 | 7 |
|
8 | 8 | # Usage |
9 | 9 |
|
10 | 10 | SeRu currently supports: |
| 11 | + |
11 | 12 | - Syntactic reducers |
12 | | - - Perses |
13 | | - - Vulcan |
| 13 | + - Perses |
| 14 | + - Vulcan |
14 | 15 | - Semantic reducers for languages |
15 | | - - CUE |
| 16 | + - CUE |
16 | 17 |
|
17 | 18 | ## Pre-requisites |
18 | 19 |
|
19 | 20 | > Steps 1 & 2 are only necessary while the repository are private |
20 | 21 | > SeRu will download such dependencies automatically |
21 | 22 |
|
22 | 23 | 1. Download Perses & CUE-specific extension (latest from the release page) |
23 | | - 1. [perses_deploy.jar](https://github.com/mandoway/seru/releases/download/v0.0.1-alpha/perses_deploy.jar) |
24 | | - 2. [cue.jar](https://github.com/mandoway/seru/releases/download/v0.0.1-alpha/cue.jar) |
| 24 | + 1. [perses_deploy.jar](https://github.com/mandoway/seru/releases/download/v0.0.1-alpha/perses_deploy.jar) |
| 25 | + 2. [cue.jar](https://github.com/mandoway/seru/releases/download/v0.0.1-alpha/cue.jar) |
25 | 26 | 2. Compile CUE-specific semantic reduction strategies |
26 | | - 1. Run |
| 27 | + 1. Run |
27 | 28 | ```bash |
28 | 29 | go generate ./... |
29 | 30 | ``` |
30 | 31 | 3. Make sure you have Java installed (for Perses) |
31 | | -4. Run SeRu using Go or standalone |
32 | | - 1. `go run .` |
33 | | - 2. `go build && ./seru` |
34 | | - 3. Command line options: |
35 | | - 1. `-i <input>` _Required_ |
36 | | - Target file to reduce |
37 | | - 2. `-t <test>` _Required_ |
38 | | - Test script checking if the reduced file still kept the required property |
39 | | - A test script **must return 0** when the property was kept and 1 (or any code) if the property was lost |
40 | | - 3. `-l <language>` |
41 | | - Programming language of the input file. Will be inferred from the file extension if omitted. |
42 | | - 4. `-r <perses|vulcan>` |
43 | | - Syntactic reducer. |
44 | | - *Default:* perses |
45 | | - Perses is faster, Vulcan is more effective. |
46 | | - 5. `-m` |
47 | | - Enable metrics. |
48 | | - A `metrics.json` file will be generated containing various data about the reduction process. |
49 | | - 6. `-s` |
50 | | - Use strategy isolation. |
51 | | - This mode will apply only one semantic strategy and try to reduce all returned candidates using the syntactic reducer. |
52 | | - Default mode: strategy combination |
53 | | - In strategy combination, all strategies are applied and combined to one "best candidate". Then this one candidate will be reduced by the syntactic reducer. |
| 32 | + |
| 33 | +## Run seru |
| 34 | +Run SeRu using Go or standalone |
| 35 | +- `go run .` |
| 36 | +- `go build && ./seru` |
| 37 | +- Install from the release page |
| 38 | + |
| 39 | +## Command line options |
| 40 | + |
| 41 | +| Option | Shorthand | Required | Description | |
| 42 | +|------------------------------|-----------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |
| 43 | +| `--input <path>` | `-i` | ✅ | path to input file | |
| 44 | +| `--test <path>` | `-t` | ✅ | path to property testscript, a test script **must return 0** when the property holds and 1 (or any code) if the property is invalid | |
| 45 | +| `--lang <string>` | `-l` | | language of file, e.g. cue. Will be inferred from the file extension if omitted. | |
| 46 | +| `--reducer <perses\|vulcan>` | `-r` | | either 'perses' OR 'vulcan' (default "perses"). Perses is faster, Vulcan can be more effective. | |
| 47 | +| `--enable-metrics` | `-m` | | store metrics as a json file | |
| 48 | +| `--strategy-isolation` | `-s` | | (*untested*) Activates strategy isolation.<br/> Modes: <br/>- Isolation (many candidates, slow): only one strategy will be applied before next iteration. This mode will apply only one semantic strategy and try to reduce all returned candidates using the syntactic reducer. <br/>- Strategy combination (**default**, much faster, less calls to syntactic reducer). In strategy combination, all strategies are applied and combined to one "best candidate". Then this single candidate will be reduced by the syntactic reducer. | |
| 49 | +| `--active-strategies <ints>` | | | list of indices of active strategies, enter -1 to disable semantic reduction | |
54 | 50 |
|
55 | 51 | # Future plans |
56 | 52 |
|
|
0 commit comments