/usr/local/lib/swipl/library/aggregate.pl
All Application Manual Name SummaryHelp

  • swipl
    • library
      • error.pl
      • debug.pl
      • apply.pl
      • lists.pl
      • broadcast.pl
      • shlib.pl
      • option.pl
      • thread_pool.pl
      • gensym.pl
      • settings.pl
      • arithmetic.pl
      • main.pl -- Provide entry point for scripts
      • readutil.pl -- Read utilities
      • operators.pl
      • pairs.pl -- Operations on key-value lists
      • prolog_source.pl
      • record.pl
      • quasi_quotations.pl
      • pure_input.pl
      • solution_sequences.pl
      • ordsets.pl
      • random.pl
      • base64.pl
      • aggregate.pl -- Aggregation operators on backtrackable predicates
        • safe_meta/2
        • aggregate/3
        • aggregate/4
        • aggregate_all/3
        • aggregate_all/4
        • foldall/4
        • foreach/2
        • free_variables/4
      • yall.pl
      • sandbox.pl -- Sandboxed Prolog code
      • apply_macros.pl -- Goal expansion rules to avoid meta-calling
      • assoc.pl -- Binary associations
      • prolog_format.pl
      • predicate_options.pl
      • csv.pl
      • pprint.pl -- Pretty Print Prolog terms
      • atom.pl -- Operations on atoms
      • modules.pl
      • occurs.pl -- Finding and counting sub-terms
      • prolog_xref.pl
      • prolog_colour.pl
      • lazy_lists.pl -- Lazy list handling
      • ugraphs.pl
      • url.pl
      • www_browser.pl
      • prolog_pack.pl -- A package manager for Prolog
      • git.pl -- Run GIT commands
      • utf8.pl -- UTF-8 encoding/decoding on lists of character codes.
      • dialect.pl
      • system.pl
      • terms.pl
      • date.pl
      • persistency.pl
      • iostream.pl -- Utilities to deal with streams
      • prolog_stack.pl -- Examine the Prolog stack
      • edinburgh.pl
      • prolog_clause.pl
      • prolog_breakpoints.pl -- Manage Prolog break-points
      • wfs.pl
      • prolog_code.pl -- Utilities for reasoning about code
      • sort.pl
      • dicts.pl
      • dif.pl
      • varnumbers.pl
      • pio.pl -- Pure I/O
      • thread.pl
      • nb_set.pl
      • edit.pl
      • backcomp.pl -- Backward compatibility
      • strings.pl
      • base32.pl
      • charsio.pl -- I/O on Lists of Character Codes
      • codesio.pl
      • coinduction.pl -- Co-Logic Programming
      • heaps.pl
      • rbtrees.pl
      • statistics.pl
      • when.pl -- Conditional coroutining
      • increval.pl
      • tables.pl
      • threadutil.pl -- Interactive thread utilities
      • ansi_term.pl
      • hashtable.pl
      • macros.pl
      • intercept.pl
      • prolog_metainference.pl
      • prolog_codewalk.pl -- Prolog code walker
      • fastrw.pl
      • prolog_coverage.pl
      • prolog_debug.pl
      • prolog_profile.pl -- Execution profiler
      • check.pl
      • prolog_autoload.pl -- Autoload all dependencies
      • ctypes.pl -- Character code classification
      • writef.pl
      • prolog_versions.pl
      • explain.pl
      • listing.pl -- List programs and pretty print clauses
      • zip.pl
      • tty.pl
      • prolog_trace.pl
      • prolog_wrap.pl
      • make.pl -- Reload modified source files
      • files.pl
      • portray_text.pl
      • optparse.pl
      • quintus.pl
      • help.pl -- Text based manual
      • shell.pl
      • exceptions.pl
      • rwlocks.pl
      • oset.pl
 free_variables(:Generator, +Template, +VarList0, -VarList) is det
Find free variables in bagof/setof template. In order to handle variables properly, we have to find all the universally quantified variables in the Generator. All variables as yet unbound are universally quantified, unless
  1. they occur in the template
  2. they are bound by X^P, setof/3, or bagof/3

free_variables(Generator, Template, OldList, NewList) finds this set using OldList as an accumulator.

author
- Richard O'Keefe
- Jan Wielemaker (made some SWI-Prolog enhancements)
license
- Public domain (from DEC10 library).
To be done
- Distinguish between control-structures and data terms.
- Exploit our built-in term_variables/2 at some places?