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

  • swipl
    • library
      • error.pl
      • debug.pl
      • apply.pl -- Apply predicates on a list
      • lists.pl
      • broadcast.pl
      • shlib.pl -- Utility library for loading foreign objects (DLLs, shared objects)
      • option.pl -- Option list processing
      • thread_pool.pl
      • gensym.pl
      • settings.pl
      • arithmetic.pl
      • main.pl
      • readutil.pl
      • operators.pl
      • pairs.pl
      • prolog_source.pl
      • record.pl
      • quasi_quotations.pl
      • pure_input.pl
      • solution_sequences.pl -- Modify solution sequences
      • ordsets.pl
      • random.pl
      • base64.pl -- Base64 encoding and decoding
      • 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
      • apply_macros.pl -- Goal expansion rules to avoid meta-calling
      • assoc.pl
      • prolog_format.pl
      • predicate_options.pl -- Access and analyse predicate options
      • csv.pl -- Process CSV (Comma-Separated Values) data
      • pprint.pl
      • atom.pl -- Operations on atoms
      • modules.pl
      • occurs.pl
      • prolog_xref.pl
      • prolog_colour.pl
      • lazy_lists.pl
      • ugraphs.pl
      • url.pl
      • www_browser.pl
      • prolog_pack.pl -- A package manager for Prolog
      • git.pl -- Run GIT commands
      • utf8.pl
      • dialect.pl
      • system.pl -- System utilities
      • terms.pl -- Term manipulation
      • date.pl
      • persistency.pl
      • iostream.pl -- Utilities to deal with streams
      • prolog_stack.pl
      • edinburgh.pl
      • prolog_clause.pl
      • prolog_breakpoints.pl -- Manage Prolog break-points
      • wfs.pl -- Well Founded Semantics interface
      • prolog_code.pl -- Utilities for reasoning about code
      • sort.pl
      • dicts.pl -- Dict utilities
      • dif.pl -- The dif/2 constraint
      • varnumbers.pl
      • pio.pl
      • base32.pl
      • charsio.pl -- I/O on Lists of Character Codes
      • codesio.pl
      • coinduction.pl -- Co-Logic Programming
      • heaps.pl
      • rbtrees.pl -- Red black trees
      • statistics.pl
      • when.pl
      • backcomp.pl
      • prolog_autoload.pl
      • check.pl -- Consistency checking
      • intercept.pl
      • qsave.pl -- Save current program as a state or executable
      • zip.pl
      • shell.pl
      • ctypes.pl
      • optparse.pl
      • strings.pl
      • listing.pl
      • prolog_codewalk.pl -- Prolog code walker
      • threadutil.pl -- Interactive thread utilities
      • edit.pl -- Editor interface
      • ansi_term.pl -- Print decorated text to ANSI consoles
      • prolog_versions.pl -- Demand specific (Prolog) versions
      • quintus.pl
      • thread.pl
      • explain.pl
      • readln.pl
      • make.pl -- Reload modified source files
      • prolog_profile.pl
      • prolog_coverage.pl -- Coverage analysis tool
      • prolog_debug.pl
      • portray_text.pl
      • macros.pl
      • prolog_trace.pl
      • prolog_history.pl
      • prolog_config.pl
      • prolog_jiti.pl
      • writef.pl
      • prolog_metainference.pl
      • help.pl
      • exceptions.pl
      • files.pl
      • tables.pl
      • nb_set.pl
      • prolog_wrap.pl
      • increval.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?