Git Product home page Git Product logo

rtchecks's Introduction

rtchecks

Run-Time Checking of Assertions for SWI-Prolog

Installation

To install the Run-Time checker of assertions, just follow the next sequence of commands in your SWI-Prolog shell:

  $ swipl
  
  ?- pack_install('https://github.com/edisonm/rtchecks.git').
  true.

Based on the run-time checker of Ciao Prolog.

The semantic of run-time checks is explained in the paper, although is out of date:

http://clip.dia.fi.upm.es/papers/assert-lang-disciplbook_bitmap.pdf

Overview

This package provides a complete implementation of run-time checks of predicate assertions. The program is instrumented to check such assertions at run time, or during debugging, and any unsatisfied property is reported.

There are two main applications of run-time checks:

  • To improve debugging of certain predicates, specifying some expected behavior that is checked at run-time with the assertions.

  • To avoid manual implementation of checks that should be done in some predicates, leaving the code clean and understandable.

The run-time checks can be configured using prolog flags. Below we list the valid prolog flags with its values and a brief explanation of the meaning:

  • rtchecks_level

    • exports: Only use rtchecks for external calls of the exported predicates.
    • inner : Use also rtchecks for internal calls. Default.
  • rtchecks_status

    Contains a list of the assertion statuses to be checked, could be a list of [true, false, check, debug, static]. Default value is [check, static].

  • rtchecks_static

    Contains a list of the assertion statuses to be instrumented statically, could be a list of [true, false, check, debug, static]. Default value is [static].

  • rtchecks_entry

    • no : Disable rtchecks for entry assertions.
    • yes : Enable rtchecks for entry assertions. Default.
  • rtchecks_exit

    • no : Disable rtchecks for exit assertions.
    • yes : Enable rtchecks for exit assertions. Default.
  • rtchecks_abort_on_error

    Controls if run time checks must abort the execution of a program (by raising an exception), or if the execution of the program have to continue.

    Note that this option only affect the default handler and the predicate @pred{call_rtc/1}, so if you use your own handler it will not have effect.

    • yes : Raising a run time error will abort the program.
    • no : Raising a run time error will not stop the execution, but a message will be shown. Default.

rtchecks's People

Contributors

edisonm avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.