Skip to content

This is a translator from the language L to Answer Set Prolog (ASP)

Notifications You must be signed in to change notification settings

iensen/LtoASPtranslator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

top

L solver

Description

  • Given a program in the logic-programming language L, the L solver produces models and answers queries.
  • This program combines

Example

Requirement

Python 3.4 or higher

Command-line interface

  • 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

References