4.16 Examining the program
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Built-in Predicates
        • Examining the program
          • current_atom/1
          • current_blob/2
          • current_functor/2
          • current_flag/1
          • current_key/1
          • current_predicate/1
          • current_predicate/2
          • predicate_property/2
          • dwim_predicate/2
          • clause/2
          • clause/3
          • nth_clause/3
          • clause_property/2
    • Packages
Availability:built-in
[ISO]clause(:Head, ?Body)
True if Head can be unified with a clause head and Body with the corresponding clause body. Gives alternative clauses on backtracking. For facts, Body is unified with the atom true. Note that SWI-Prolog allows clause/2 to work on both dynamic and static code.94Using clause/2 is disallowed if either the flag iso or protect_static_code is true. Note that clause/2 decompiles the actual clause and may return a clause that is different from the source or asserted clause, i.e., clause/2 only promises semantic equivalence.