• Places
    • Home
    • Graphs
    • Prefixes
  • Amalgame
    • Alignment interface
    • Vocabulary browser
  • 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

4.40 Debugging and declaring determinism
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Built-in Predicates
        • Debugging and declaring determinism
          • det/1
          • $/0
          • $/1
    • Packages
Availability:built-in
Source[experimental,directive]det(+PredicateIndicators)
Declare a number of predicates as det, deterministic. As a result, both failure and success with a choicepoint is considered an error. The behaviour if the declaration is violated is controlled with the Prolog flag determinism_error. The default is to raise an exception (error). Consider the following program:
:- det(p/1).

p(1).
p(2).

Now, a call ?- p(1). behaves normally. However:

?- p(X).
ERROR: Deterministic procedure p/1 succeeded with a choicepoint
ERROR: In:
ERROR:   [10] p(1)

?- p(a).
ERROR: Deterministic procedure p/1 failed
ERROR: In:
ERROR:   [10] p(a)
ClioPatria (version no GIT?)