DeALSGUI Editor Primer
The DeAL GUI editor is an interface for writing, compiling and executing DeAL programs. The editor provides syntax highlighting help to assist in program development. The editor is extended from jEdit and includes many commands and functionality not discussed here.
DeALS requires Java 1.8.
After uncompressing DeALS.tar.gz, from the DeALS_editor directory, launch the editor. The Linux example is shown below. See readme.txt in the DeALS_editor folder for Windows and Mac start instructions.
The editor will store user settings across sessions. To clear the editor settings, execute clean.sh
Example Workflow
An example workflow of using the editor is as follows:- Edit file
- Save file
- Load file into DeALS
- Compile
- Execute Query
GUI Editor By Example
The first time you start the editor, the file browser (left pane) and DeALS output window (bottom pane) are collapsed. Expand the file browser by clicking "File Browser". This might require multiple clicks. Once expanded, navigate to the working directory. This can be done by typing the path or by selecting the folder through the directory tree. In the example below, we have navigated to the DeALS directory which was created from uncompressing DeALS.tar.gz.
Expand the Deals output pane by clicking on "Deals" at the bottom of the screen. Then, resize the pane by dragging from its borders. Initially, this window is empty. When commands are executed, results are displayed here.
Select a file from the directory displayed in the File Browser. In the screenshot below, we have opened example6.deal.
Some things to take note of:
- The instance of DeALS used by the editor is also managed by the editor. No action is required by the user to start DeALS. The editor is integrated with DeALS's API.
- When a file is loaded, the editor will unload the previously loaded file. As edits are made, and saved, when the file is loaded, only the latest version will be used in DeALS.
- A typical file organization is to have database declarations, rules and exports in a file with extension .deal and facts for the corresponding database predicates in a .fac file. When a .deal file is loaded, the editor will also load the .fac file of the same file name (and vice versa).
At the top right of the Deals pane are four icons. Hovering the cursor over the icon will indicate the command each icon performs. Select the first icon to load the open .deal file into DeALS. The result of the load command will be displayed in the Deals pane, as shown in the screenshot below.
Next, click the compile icon to compile the program. Notification of any errors would be displayed. Now we are ready to execute queries. At the top left of the Deals pane is the query interface. To issue a query, enter the query in the textbox and click the run (triangle) button. The query result will be displayed in the Deals pane. The screenshot below shows the results of executing the query 'ancestor(X,Y)'.
Last Updated 10/8/2014