A.30 library(occurs): Finding and counting sub-terms
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(occurs): Finding and counting sub-terms
          • contains_term/2
          • contains_var/2
          • free_of_term/2
          • free_of_var/2
          • occurrences_of_term/3
          • occurrences_of_var/3
          • sub_term/2
          • sub_var/2
          • sub_term_shared_variables/3
    • Packages
Availability::- use_module(library(occurs)).(can be autoloaded)
Source[det]occurrences_of_var(@SubTerm, @Term, ?Count)
Count the number of SubTerms in Term that are equal to SubTerm. Equality is tested using ==/2. Can be used to count the occurrences of a particular variable in Term.
See also
occurrences_of_term/3 for a unification (=/2) based variant.