This is a small proof-of-concept implementation of the constraint check in the submitted paper "Integrity Constraints for Microcontroller Programming in Datalog".
The program is being actively developed. Please check again this webpage in a few days. There also will be more examples soon. And a specification of the input syntax. The parser could also check for more errors.
More work on Datalog for Arduino and the Lego EV3 Roboter System is reported at:
https://dbs.informatik.uni-halle.de/microlog/
(Currently, the language of this main project, which contains a compiler from Datalog to Arduino C code, differs in some slight details.)
https://www.swi-prolog.org/.If you have another Prolog system, and my program should not work with that, please let me know: brass@informatik.uni-halle.de. I am interested in portable programming.
?- [ctest].
(here, ?- is the prompt of the Prolog system).
Do not forget the full stop '.' at the end of the command.
Since ctest.pl
loads the other Prolog source files,
the current directory should be the src
directory.
?- example.
This uses a built-in version of the example rules and constraints.
?- load(blink0).
You can also specify the full path, if necessary:
?- load('C:/my/path/blink0.mlg').
To see the loaded rules and constraints
(already transformed to pure Datalog),
use
?- show.
To check whether the constraints are guaranteed to hold:
?- ctest.
?- h.
There are a few options that can be set,
but they are mainly for debugging the program.
All options are listed with:
?- show_opt.
?- halt.
(Again, the full stop at the end is important in Prolog.)
I also defined a predicate quit
that does the same.
http://users.informatik.uni-halle.de/~brass/micrologS/The current version is 0.4 from March 29, 2021.
You can download a zip-archive of all source files.
Prof. Dr. Stefan Brass |