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

9.4 Debugging CHR programs
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
      • CHR: Constraint Handling Rules
        • Debugging CHR programs
          • CHR debug ports
          • Tracing CHR programs
          • CHR Debugging Predicates
            • chr_trace/0
            • chr_notrace/0
            • chr_leash/1
            • chr_show_store/1
            • find_chr_constraint/1
    • Packages

9.4.3 CHR Debugging Predicates

The library(chr) module contains several predicates that allow inspecting and printing the content of the constraint store.
chr_trace
Activate the CHR tracer. By default the CHR tracer is activated and deactivated automatically by the Prolog predicates trace/0 and notrace/0.
chr_notrace
Deactivate the CHR tracer. By default the CHR tracer is activated and deactivated automatically by the Prolog predicates trace/0 and notrace/0.
chr_leash(+Spec)
Define the set of CHR ports on which the CHR tracer asks for user intervention (i.e. stops). Spec is either a list of ports as defined in section 9.4.1 or a predefined‘alias’. Defined aliases are: full to stop at all ports, none or off to never stop, and default to stop at the call, exit, fail, wake and apply ports. See also leash/1.
chr_show_store(+Mod)
Prints all suspended constraints of module Mod to the standard output. This predicate is automatically called by the SWI-Prolog top level at the end of each query for every CHR module currently loaded. The Prolog flag chr_toplevel_show_store controls whether the top level shows the constraint stores. The value true enables it. Any other value disables it.
find_chr_constraint(-Constraint)
Returns a constraint in the constraint store. Via backtracking, all constraints in the store can be enumerated.

ClioPatria (version V3.1.1-51-ga0b30a5)