- Given a program in the logic-programming language L, the L solver produces models and answers queries.
- This program combines
- the L-to-ASP translator (by Evgenii Balai & Vu Phan),
- Sparc (by Evgenii Balai), and
- Clingo (by Potassco).
Python 3.4 or higher
- Change current directory to
src
Example with Windows Command Prompt:
cd src
- Specify where to read source L program and overwrite translated ASP program
python3 translator.py examples/ranking.l > examples/ranking.sp
- Choose mode
- Answer set mode
Specify where to read translated ASP program
java -jar sparc.jar -solver clingo examples/ranking.sp -A -loutput
- Querying mode
- Specify where to read translated ASP program
java -jar sparc.jar -solver clingo examples/ranking.sp
- Query
?- student_rank(S, R)
(Press Enter until?-
reappears) - Quit
exit
- Specify where to read translated ASP program
- Answer set mode