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

  • swipl
    • library
      • error.pl
      • debug.pl -- Print debug messages and test assertions
      • apply.pl -- Apply predicates on a list
      • lists.pl -- List Manipulation
      • broadcast.pl -- Event service
      • shlib.pl
      • option.pl -- Option list processing
      • thread_pool.pl
      • gensym.pl -- Generate unique symbols
      • settings.pl -- Setting management
      • arithmetic.pl -- Extensible arithmetic
      • main.pl -- Provide entry point for scripts
      • readutil.pl -- Read utilities
      • operators.pl -- Manage operators
      • pairs.pl -- Operations on key-value lists
      • prolog_source.pl -- Examine Prolog source-files
      • record.pl -- Access compound arguments by name
      • quasi_quotations.pl -- Define Quasi Quotation syntax
      • sandbox.pl -- Sandboxed Prolog code
      • apply_macros.pl -- Goal expansion rules to avoid meta-calling
      • yall.pl -- Lambda expressions
      • assoc.pl -- Binary associations
      • prolog_format.pl -- Analyse format specifications
      • pure_input.pl -- Pure Input from files and streams
      • solution_sequences.pl -- Modify solution sequences
      • ordsets.pl -- Ordered set manipulation
      • random.pl -- Random numbers
        • random/1
        • random_between/3
        • random/3
        • setrand/1
        • getrand/1
        • maybe/0
        • maybe/1
        • maybe/2
        • random_perm2/4
        • random_member/2
        • random_select/3
        • random_subseq/3
        • randset/3
        • randseq/3
        • random_permutation/2
        • random_numlist/4
      • base64.pl -- Base64 encoding and decoding
      • aggregate.pl -- Aggregation operators on backtrackable predicates
      • predicate_options.pl -- Access and analyse predicate options
      • csv.pl -- Process CSV (Comma-Separated Values) data
      • pprint.pl -- Pretty Print Prolog terms
      • atom.pl
      • modules.pl
      • occurs.pl -- Finding and counting sub-terms
      • prolog_xref.pl
      • prolog_colour.pl -- Prolog syntax colouring support.
      • lazy_lists.pl -- Lazy list handling
      • ugraphs.pl -- Graph manipulation library
      • url.pl -- Analysing and constructing URL
      • www_browser.pl -- Open a URL in the users browser
      • prolog_pack.pl -- A package manager for Prolog
      • git.pl -- Run GIT commands
      • utf8.pl -- UTF-8 encoding/decoding on lists of character codes.
      • quintus.pl -- Quintus compatibility
      • prolog_versions.pl -- Demand specific (Prolog) versions
      • prolog_wrap.pl -- Wrapping predicates
      • dialect.pl -- Support multiple Prolog dialects
      • date.pl -- Process dates and times
      • persistency.pl -- Provide persistent dynamic predicates
      • iostream.pl -- Utilities to deal with streams
      • prolog_code.pl
      • strings.pl -- String utilities
      • dif.pl -- The dif/2 constraint
      • edinburgh.pl -- Some traditional Edinburgh predicates
      • terms.pl -- Term manipulation
      • ansi_term.pl -- Print decorated text to ANSI consoles
      • threadutil.pl -- Interactive thread utilities
      • prolog_stack.pl -- Examine the Prolog stack
      • prolog_clause.pl
      • prolog_breakpoints.pl -- Manage Prolog break-points
      • wfs.pl -- Well Founded Semantics interface
      • sort.pl
      • dicts.pl -- Dict utilities
      • varnumbers.pl -- Utilities for numbered terms
      • rbtrees.pl -- Red black trees
      • backcomp.pl -- Backward compatibility
      • charsio.pl -- I/O on Lists of Character Codes
      • base32.pl -- Base32 encoding and decoding
      • codesio.pl -- I/O on Lists of Character Codes
      • coinduction.pl -- Co-Logic Programming
      • heaps.pl -- heaps/priority queues
      • statistics.pl -- Get information about resource usage
      • when.pl -- Conditional coroutining
      • ctypes.pl -- Character code classification
      • intercept.pl -- Intercept and signal interface
      • prolog_history.pl
      • explain.pl -- Describe Prolog Terms
      • writef.pl -- Old-style formatted write
      • thread.pl -- High level thread primitives
      • qsave.pl
      • increval.pl -- Incremental dynamic predicate modification
      • listing.pl -- List programs and pretty print clauses
      • prolog_autoload.pl -- Autoload all dependencies
      • help.pl
      • tables.pl -- XSB interface to tables
      • zip.pl -- Access resource ZIP archives
      • check.pl -- Consistency checking
      • shell.pl -- Elementary shell commands
      • streams.pl -- Manage Prolog streams
      • prolog_trace.pl -- Print access to predicates
      • hashtable.pl -- Hash tables
      • prolog_profile.pl -- Execution profiler
      • prolog_debug.pl -- User level debugging tools
      • qpforeign.pl
      • make.pl -- Reload modified source files
      • edit.pl
      • fastrw.pl -- Fast reading and writing of terms
      • macros.pl -- Macro expansion
      • tty.pl
      • prolog_jiti.pl
      • prolog_codewalk.pl -- Prolog code walker
      • exceptions.pl
      • prolog_coverage.pl -- Coverage analysis tool
      • prolog_metainference.pl
      • tableutil.pl -- Table inspection and statistics utilities
      • optparse.pl -- command line parsing
      • nb_rbtrees.pl
      • oset.pl
      • files.pl
      • system.pl -- System utilities
      • check_installation.pl -- Check installation issues and features
      • nb_set.pl -- Non-backtrackable sets
      • vm.pl
      • readln.pl
      • prolog_config.pl
      • portray_text.pl
      • rwlocks.pl
      • prolog_deps.pl
      • prolog_qlfmake.pl -- Compile the library to QLF format
 random_subseq(+List, -Subseq, -Complement) is det
random_subseq(-List, +Subseq, +Complement) is semidet
Selects a random subsequence Subseq of List, with Complement containing all elements of List that were not selected. Each element of List is included with equal probability in either Subseq or Complement.

random_subseq/3 may also be called with Subseq and Complement bound and List unbound, which will recreate List by randomly interleaving Subseq and Complement. This mode may fail randomly, matching SICStus behavior. The failure probability corresponds to the probability of the "forward" mode selecting a Subseq/Complement combination with different lengths.

Compatibility
- SICStus 4