• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

A.11 library(debug): Print debug messages and test assertions
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(debug): Print debug messages and test assertions
          • debugging/1
          • debugging/2
          • debug/1
          • nodebug/1
          • list_debug_topics/0
          • debug_message_context/1
          • debug/3
          • assertion/1
    • Packages
Availability::- use_module(library(debug)).(can be autoloaded)
Source[det]assertion(:Goal)
Acts similar to C assert() macro. It has no effect if Goal succeeds. If Goal fails or throws an exception, the following steps are taken:

  • call prolog:assertion_failed/2. If prolog:assertion_failed/2 fails, then:

    • If this is an interactive toplevel thread, print a message, the stack-trace, and finally trap the debugger.
    • Otherwise, throw error(assertion_error(Reason, G),_) where Reason is one of fail or the exception raised.
ClioPatria (version V3.1.1-51-ga0b30a5)