• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

/usr/lib/swipl/library/solution_sequences.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
      • option.pl -- Option list processing
      • thread_pool.pl
      • gensym.pl -- Generate unique symbols
      • settings.pl
      • arithmetic.pl -- Extensible arithmetic
      • main.pl -- Provide entry point for scripts
      • readutil.pl
      • operators.pl -- Manage operators
      • pairs.pl
      • prolog_source.pl
      • quasi_quotations.pl
      • url.pl
      • www_browser.pl -- Open a URL in the users browser
      • prolog_colour.pl -- Prolog syntax colouring support.
      • record.pl
      • prolog_xref.pl
      • occurs.pl -- Finding and counting sub-terms
      • ordsets.pl
      • assoc.pl -- Binary associations
      • ugraphs.pl
      • solution_sequences.pl -- Modify solution sequences
        • distinct/1
        • distinct/2
        • reduced/1
        • reduced/3
        • limit/2
        • offset/2
        • call_nth/2
        • order_by/2
        • group_by/4
      • atom.pl
      • prolog_pack.pl -- A package manager for Prolog
      • git.pl -- Run GIT commands
      • ctypes.pl
      • utf8.pl
      • base64.pl -- Base64 encoding and decoding
      • persistency.pl -- Provide persistent dynamic predicates
      • pure_input.pl
      • nb_set.pl
      • aggregate.pl -- Aggregation operators on backtrackable predicates
      • csv.pl -- Process CSV (Comma-Separated Values) data
      • iostream.pl -- Utilities to deal with streams
      • dialect.pl -- Support multiple Prolog dialects
      • apply_macros.pl -- Goal expansion rules to avoid meta-calling
      • yall.pl
      • prolog_code.pl -- Utilities for reasoning about code
      • dif.pl -- The dif/2 constraint
      • thread.pl -- High level thread primitives
      • predicate_options.pl
      • rbtrees.pl
      • nb_rbtrees.pl
      • sandbox.pl
      • prolog_format.pl -- Analyse format specifications
      • random.pl -- Random numbers
      • pprint.pl -- Pretty Print Prolog terms
      • modules.pl -- Module utility predicates
      • lazy_lists.pl
      • edinburgh.pl -- Some traditional Edinburgh predicates
      • prolog_clause.pl
      • prolog_breakpoints.pl -- Manage Prolog break-points
      • dicts.pl -- Dict utilities
      • prolog_history.pl -- Per-directory persistent commandline history
      • prolog_config.pl
      • ansi_term.pl
      • prolog_stack.pl -- Examine the Prolog stack
      • tables.pl
      • backcomp.pl -- Backward compatibility
      • optparse.pl
      • strings.pl -- String utilities
      • prolog_jiti.pl
      • listing.pl -- List programs and pretty print clauses
      • wfs.pl -- Well Founded Semantics interface
      • prolog_coverage.pl -- Coverage analysis tool
      • check.pl
      • prolog_codewalk.pl -- Prolog code walker
      • date.pl -- Process dates and times
      • prolog_profile.pl -- Execution profiler
      • charsio.pl
      • macros.pl
      • terms.pl
      • oset.pl -- Ordered set manipulation
      • quintus.pl
      • base32.pl -- Base32 encoding and decoding
      • codesio.pl
      • coinduction.pl -- Co-Logic Programming
      • heaps.pl -- heaps/priority queues
      • sort.pl
      • statistics.pl
      • varnumbers.pl -- Utilities for numbered terms
      • when.pl -- Conditional coroutining
      • system.pl -- System utilities
      • qsave.pl
      • zip.pl
      • prolog_autoload.pl -- Autoload all dependencies
      • prolog_metainference.pl
      • prolog_versions.pl -- Demand specific (Prolog) versions
      • make.pl
      • edit.pl
      • fastrw.pl
      • rwlocks.pl
      • increval.pl
      • prolog_wrap.pl
      • streams.pl
      • prolog_debug.pl
      • hashtable.pl
      • files.pl
      • threadutil.pl -- Interactive thread utilities
      • writef.pl
      • help.pl -- Text based manual
      • intercept.pl
      • shell.pl
      • tableutil.pl
      • prolog_qlfmake.pl -- Compile the library to QLF format
      • exceptions.pl
      • prolog_trace.pl
      • portray_text.pl
 distinct(:Goal)
 distinct(?Witness, :Goal)
True if Goal is true and no previous solution of Goal bound Witness to the same value. As previous answers need to be copied, equivalence testing is based on term variance (=@=/2). The variant distinct/1 is equivalent to distinct(Goal,Goal).

If the answers are ground terms, the predicate behaves as the code below, but answers are returned as soon as they become available rather than first computing the complete answer set.

distinct(Goal) :-
    findall(Goal, Goal, List),
    list_to_set(List, Set),
    member(Goal, Set).
ClioPatria (version V3.1.1-59-g7b9a7a3)