Skip to content

mikhirurg/DerivationTreeBuilder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DerivationTreeBuilder

Build

Project description

DerivationTreeBuilder is a tool that allows you to automatically generate natural semantics derivation trees for the While programming language programs.

Installation guide

The project requires Java version 13+ in order to run the simulation. There are a few different ways how a user can obtain the jar file to execute the project:

  • The latest stable version of the project is available in the Releases section of the repository
  • The user can build the executable jar from sources by using the script build.sh

After obtaining the executable jar, the user can just run the following command:

java -jar DerivationTreeBuilder.jar

How to use the project

Demo 1

On the top part of the application window, there is a text area for the input program. Below that there is located the tree generation settings:

  • Do we want to use explicit state representation
  • What is the derivation depth of the tree
  • What tree representation format do we want (ASCII / LateX code)

Also, there is a button called "Build" which initiates the process of automatic generation of the derivation tree.

And, at the bottom of the application window, there is a second big text area that displays the output with the derivation tree.

Compiling the produced LateX code

In order to build the PDF document using the produced LateX code, use the packages located here.

Examples

While program ASCII tree LateX tree
x:=27;
(
    y:=8;
    z:=0
)

ASCII

x:=5;
y:=1;
i:=1;
while i <= x do
(
    y := y * x;
    x := x - 1
)

ASCII

x:=27;
y:=8;
z:=0;
while y <= x do
(
    z := z + 1;
    x := x - y
)

ASCII

(
    i:=0;
    while i <= 3 do
    (
        i := i + 1
    )
);
while 0 <= i do
(
    i := i - 1
)

ASCII

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

About

Automatic generation of the derivation proof trees for While programs

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages