/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 -- Resource bounded thread management
      • gensym.pl
      • settings.pl
      • arithmetic.pl -- Extensible arithmetic
      • main.pl -- Provide entry point for scripts
      • readutil.pl
      • operators.pl
      • pairs.pl
      • prolog_source.pl
      • record.pl
      • quasi_quotations.pl
      • pure_input.pl
      • solution_sequences.pl
      • 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 -- Sandboxed Prolog code
      • apply_macros.pl -- Goal expansion rules to avoid meta-calling
      • assoc.pl
      • prolog_format.pl
      • predicate_options.pl
      • csv.pl
      • pprint.pl -- Pretty Print Prolog terms
      • atom.pl
      • modules.pl
      • occurs.pl -- Finding and counting sub-terms
      • prolog_xref.pl
      • prolog_colour.pl
      • lazy_lists.pl -- Lazy list handling
      • ugraphs.pl -- Graph manipulation library
      • url.pl
      • www_browser.pl
      • prolog_pack.pl
      • git.pl
      • utf8.pl
      • dialect.pl
      • system.pl -- System utilities
      • terms.pl
      • 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
      • prolog_code.pl
      • sort.pl
      • dicts.pl -- Dict utilities
      • dif.pl -- The dif/2 constraint
      • varnumbers.pl -- Utilities for numbered terms
      • pio.pl
      • quintus.pl
      • threadutil.pl -- Interactive thread utilities
      • rbtrees.pl
      • backcomp.pl -- Backward compatibility
      • base32.pl -- Base32 encoding and decoding
      • charsio.pl
      • codesio.pl
      • coinduction.pl
      • heaps.pl
      • statistics.pl
      • when.pl
      • prolog_profile.pl
      • make.pl -- Reload modified source files
      • qsave.pl
      • zip.pl
      • streams.pl -- Manage Prolog streams
      • ansi_term.pl -- Print decorated text to ANSI consoles
      • prolog_history.pl
      • prolog_config.pl
      • shell.pl -- Elementary shell commands
      • check.pl -- Consistency checking
      • optparse.pl
      • prolog_debug.pl -- User level debugging tools
      • macros.pl
      • thread.pl -- High level thread primitives
      • prolog_autoload.pl
      • strings.pl
      • nb_set.pl -- Non-backtrackable sets
      • ctypes.pl -- Character code classification
      • prolog_jiti.pl
      • listing.pl
      • prolog_metainference.pl
      • prolog_codewalk.pl
      • prolog_versions.pl
      • portray_text.pl
      • tty.pl
      • prolog_coverage.pl -- Coverage analysis tool
      • rwlocks.pl
      • prolog_wrap.pl
      • fastrw.pl
      • intercept.pl
      • increval.pl
      • tables.pl
      • hashtable.pl
      • explain.pl
      • writef.pl
      • exceptions.pl
      • files.pl
      • readln.pl
      • edit.pl
      • prolog_trace.pl
      • help.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?