Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Latest commit

 

History

History
134 lines (86 loc) · 6.79 KB

File metadata and controls

134 lines (86 loc) · 6.79 KB

README

In this repository you will find the benchmark and instruction to reproduce the evaluation and example presented in the paper "Modelling and Reasoning in Event Calculus using Goal-Directed Constraint Answer Set Programming".

The BEC theory

The file bec_theory.pl contains the translation of the Basic Event Calculus theory.

The light.pl example

This example is based on the example 14 in [Mueller, 2014b] and reason about turning on and off a light.

There are four files implementing different features:

To check the behaviour of the first file with several queries execute the script:

go_bec_light_01

to check the behaviour of the rest of files execute the script:

go_bec_light_02_03_04

The scripts are located here. Note that there are the queries that success returning a valid partial model while others do not. For each of the queries there is a comment which explain the expected result.

Additionally you can execute the example invoking s(CASP) directly from the terminal. As an example let us execute s(CASP) asking for the justification tree with (note that it will execute the last uncommented query that appear in the file):

scasp -j bec_light_01.pl

The tap.pl example

This example is based on an example from [Shanahan, 1999] where a vessel is filled with water.

There are four files implementing different features:

To check the behaviour of each file with several queries execute the scripts (located here):

go_bec_tap_01_overflow
go_bec_tap_02_no_overflow
go_bec_tap_03_two_models
go_bec_tap_04_abducible_infer_event_time

Note that there are the queries that success returning a valid partial model while others do not. For each of the queries there is a comment which explain the expected result.

Installation

CIAO

Ciao is a programming language that builds up from a logic-based simple kernel, and is designed to be extensible and modular. It is available at http://ciao-lang.org. Its supports:

  • constraint logic programming (and, in particular, Prolog)
  • different levels of modularity (from small to large scale):
    • modules as (analysis-friendly) compilation units
    • bundles as collections of modules
  • packages as modules implementing language extensions (syntactic definitions, compilation options, compiler plugins)
  • assertions (as an homogeneous framework that allows static and dynamic verification to work cooperatively in a unified way)
  • multiparadigm constructs (meta-programming, higher-order, mutables, concurrency, functions, etc.) and interfacing with foreign code

The system implements some advanced features such as separate and incremental compilation, global program analysis and static debugging and optimization (via source to source program transformation, CiaoPP preprocessor), a build automation system, documentation generator, debugger, and (Emacs-based) development environment.

To begin the interactive installation type the following one-liner in a sh-compatible terminal:

curl https://ciao-lang.org/boot -sSfL | sh

Do not forget to rerun the bashrc file source ~/.bashrc. If you have any problem go here for details.

s(CASP)

s(CASP) is an implementation of the stable model semantics of constraint logic programming. Unlike similar systems, it does not employ any form of grounding. This allows s(CASP) to execute programs that are not finitely groundable, including those which make use of lists and terms. It is available here.

Once you have Ciao working in your computer to install s(CASP) type the following one-liner in a sh-compatible terminal:

ciao get gitlab.software.imdea.org/ciao-lang/sCASP

If you have any problem go here for details.

Evaluation of s(CASP) against s(ASP)

In order to compare the run time of s(CASP) versus s(ASP) in the folder aux-sasp there are four files:

s(ASP) is available here. We used the version 1.0.7.

In the scripts folder for s(CASP) (located here) there is the script to run the benchmarks in the paper computing the time for s(CAPS):

Evaluation of s(CASP) against clingo

In order to compare the run time of s(CASP) versus clingo in the folder sCASP-clingo there are several programs and scripts. We use extension .pl for s(CASP), the extension .clingo for clingo 5.2.0 and .e for the encoding using F2LP.

In the folder scripts you can find the files used to run the benchmarks:

  • go_light run the evaluation using the light scenario in folder light.
  • go_vessel run the evaluation using the vessel scenario in folder vessel.