This repository includes Alk, an educational platform designed to help in learning algorithms and acquiring algorithmic thinking. Some references:
- Lungu, A., Lucanu, D.: A matching logic foundation for Alk. In: Seidl, H., Liu, Z., Pasareanu, C.S. (eds.) Theoretical Aspects of Computing - ICTAC 2022 - 19th International Colloquium, Tbilisi, Georgia, September 27-29, 2022, Proceedings. Lecture Notes in Computer Science, vol. 13572, pp. 290–304. Springer (2022). https://doi.org/10.1007/978-3-031-17715-6_19
- Lungu, A., Lucanu, D.: Supporting algorithm analysis with symbolic execution in Alk. In: Ameur, Y.A., Craciun, F. (eds.) Theoretical Aspects of Software Engineering - 16th International Symposium, TASE 2022, Proceedings. Lecture Notes in Computer Science, vol. 13299, pp. 406–423. Springer (2022), https://doi.org/10.1007/978-3-031-10363-6_27
- A.-I. Lungu , V. Teodorescu , A. Zaborilă , O. Andrei, D. Lucanu. Alk: A Formal-Methods-based Educational Platform for Enhancing Algorithmic Thinking, Scientific Annals of Computer Science (SACS), pages 39-66, doi: 10.7561/SACS.2024.1.39
The examples used in the papers can be found here.
Read the reference manual to review the Alk syntax. Also consider the Alk-by example wiki to understand how Alk behaves in real-scenarios.
-
Install VS Code from the official page.
-
In the Extensions tag in the left side, check for the "Alk Visual Studio Code Extension" and install.
-
Enter the Alk VS Code Extension repository and check the usage manual.
Note. The symbolic exection engine might not work on Mac M1 becauses of incompatibilty between Java machine and Z3 library. We are working to fix that.
- Be sure you have installed the latest version of Java. Alk interpreter works now on Java 1.8.
- Download the Java interpreter of Alk:
- if you have git on your system, then the best is to make a clone of the JAVA definition of alk from https://github.com/alk-language/java-semantics
- otherwise, you may download a zip archive from https://github.com/alk-language/java-semantics/releases/download/v4.0/alki-v4.0.zip
- Make sure you have rights to execute the scripts:
- Linux/Mac OS:
chmod +x alki.sh
- Test the Alk interpreter:
-
Go to the
examples/miscelanea
folder and test some examples:-
an example that does not require the input state:
- Linux/Mac OS:
../../bin/alki.sh -a gcd-no-input.alk 4
- Windows:
..\..\bin\alki.bat -a gcd-no-input.alk 4
-
an example that does require the input state:
- Linux/Mac OS:
../../bin/alki.sh -a gcd.alk -i gcd.in 14
- Windows:
..\..\bin\alki.bat -a gcd.alk -i gcd.in 14
-
It is strongly recommended to include the folder Linux_Mac
or Windows
in the PATH environment variable. This allow to call the the interpreter without mentioning the path to its location.
Optionally (and remmended) is to create a symbolic link named alki
:
- Linux/Mac OS:
ln -s ../../bin/alki.sh ../../bin/alki
- Linux/Mac OS:
Note that this will set the PATH only for the current shell. Opening another shell will not have Alk set in PATH. For pesistent set, use:
export PATH=[ALK-PATH]/bin:$PATH alki.sh -h
Note thatecho 'PATH=[ALK-PATH]/bin:$PATH' >> ~/.bashrc alki.sh -h
[ALK-PATH]
is a placeholder for the actual place wherejava-semantics
is. For example:~/Alk/java-semantics
. - Windows
- Search for
Edit the system environment variables
- Open the
System Properties
window and pressEnvironment variables...
- Select in the bottom grid (
System variables
) thePath
variable and pressEdit...
- Press
New...
in order to set up a new path toward thebin
folder ofjava-semantics
. Example:C:\Alk\java-semantics\bin
alki -h
- Search for
- Be sure you have installed the latest version of Java. Alk interpreter works now on Java 1.8.
- Alk development is based on Maven as automatic building tool, thus having Maven installed is a prerequisite condition in order to build the Alk sources.
- Linux:
sudo apt-get install maven mvn -v
- Mac OS:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" brew install maven mvn -v
- Windows:
- Download the latest Maven Binary zip archive from
https://maven.apache.org/download.cgi
- Unzip the downloaded archive
- Presuming that the unzipped folder is
%PATH%\apache-maven
, add the%PATH%\apache-maven\bin
folder to the path system variable. - Make sure that the
JAVA_HOME
system variable is also set correctly.
mvn -v
- Download the latest Maven Binary zip archive from
- Download the sources of the Alk Java interpreter from https://github.com/alk-language/java-semantics
- Build the sources using Maven:
- Linux/Mac OS:
cd java-semantics mvn package cd bin chmod +x alki.sh ./alki.sh -a example.alk -i input.in
- Windows:
cd java-semantics mvn package cd bin alki.bat -a example.alk -i input.in