Stipula is a domain specific language that may assist legal practitioners in programming legal contracts through specific patterns. In this repository, we uploaded the prototype and some examples.
The prototype is a Java application. The development has taken three months and ~3000 lines of Java code. We have committed to the ANTLR tool.
- The prototype requires a Java version > 8.
There are two possibilities:
- It is possible to install the source code (folder Stipula-LAN) with the Grammar and the parser
- It is possible to download and run the jar of the prototype
- Java > 8
- ANTLR > 4.4
- Download the zip
- Import the grammar file (Stipula.g4) in the IDE
- Compile with ANTLR and generate the Parser, Visitor, Listener
- Import the rest of the project (package src)
- After downloading the zip, go to the correct folder (./Stipula Executable)
- To run the prototype type the following code
java -jar stipula_lan.jar name_of_the_example.stipula
- When the prototype starts, it displays the type inference
- Then the agreement starts and displays a unique code for each party of the contract (see example below)
--------------------
Lender ef6h4
Borrower MHWBs
Authority gxhZZ
--------------------
- The prototype asks the user to insert these codes and the values for some variables
- Then it shows which functions can start, for instance:
# Please, choose which function should run:
Lender.offer(Type3 x)[]
- The user must call the desired function by inserting the corresponding party's code and the values for the formal parameters
- For instance, if the lender wants to call the function offer with x=10:
ef6h4.offer(10)[]
- Then the prototype executes the body of the chosen function and the execution continues