Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "rtchecks"

Title:Run-Time Checking for Ciao and SWI-Prolog
Rating:Not rated. Create the first rating!
Latest version:0.0.1
SHA1 sum:e9a4920c62a84dc8b5428aae825a65c05fbd1473
Author:Edison Mera Menendez http://www.edisonm.com/
Maintainer:Edison Mera Menendez http://www.edisonm.com/
Packager:Edison Mera Menendez http://www.edisonm.com/
Home page:https://github.com/edisonm/rtchecks
Download URL:https://github.com/edisonm/rtchecks.git
Requires:assertions

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
0.0.11f77a83f739b710e47359398802d61e079cbdaf11https://github.com/edisonm/rtchecks.git
3be55886858306d88d1a38f9f144a5cb167d03241https://github.com/edisonm/rtchecks.git
46624e6b699baf27bf4ae5a45957fa36ad7c10ca1https://github.com/edisonm/rtchecks.git
53a8bd1326b858b39f6df485935bbe7640a0cf444https://github.com/edisonm/rtchecks.git
77dd8f9d6275336e4d0effc9b0824ae68faf34291https://github.com/edisonm/rtchecks.git
7f311777e045bc3929673c6df4ed086cf82e9fd71https://github.com/edisonm/rtchecks.git
8daa9d1c76b8233abc6b03aadf56098071adde311https://github.com/edisonm/rtchecks.git
94917a83c0059fb2ed3584b90142a9c27da277841https://github.com/edisonm/rtchecks.git
9867b86f71e0cdbda67ee6ac7fbd82ce487dba592https://github.com/edisonm/rtchecks.git
a874149f0690d905360ff665b325399a027cca841https://github.com/edisonm/rtchecks.git
b0fb43fe48939720248e83af6aaea073bf02dc141https://github.com/edisonm/rtchecks.git
d2d0947528e939dbcb51d3b4fb1112f55004c2251https://github.com/edisonm/rtchecks.git
d671341e8b29479b8aefcd3e81ccc6156e3eccc33https://github.com/edisonm/rtchecks.git
e9a4920c62a84dc8b5428aae825a65c05fbd14733https://github.com/edisonm/rtchecks.git

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_check
    • no : Disable rtchecks for check assertions.
    • yes : Enable rtchecks for check assertions. Default.
  • rtchecks_trust
    • no : Disable rtchecks for trust assertions.
    • yes : Enable rtchecks for trust assertions. Default.
  • 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_test
    • no : Disable rtchecks for test assertions. Default.
    • yes : Enable rtchecks for test assertions. Used for debugging purposes, but is better to use the unittest library.
  • 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.

Contents of pack "rtchecks"

Pack contains 19 files holding a total of 64.9K bytes.