/usr/local/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 -- Resource bounded thread management
      • 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
      • pairs.pl
      • prolog_source.pl -- Examine Prolog source-files
      • record.pl -- Access compound arguments by name
      • quasi_quotations.pl -- Define Quasi Quotation syntax
      • pure_input.pl
      • solution_sequences.pl
      • 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
      • yall.pl
      • sandbox.pl
      • apply_macros.pl -- Goal expansion rules to avoid meta-calling
      • assoc.pl -- Binary associations
      • prolog_format.pl -- Analyse format specifications
      • predicate_options.pl
      • csv.pl -- Process CSV (Comma-Separated Values) data
      • pprint.pl
      • atom.pl
      • modules.pl -- Module utility predicates
      • occurs.pl -- Finding and counting sub-terms
      • prolog_xref.pl -- Prolog cross-referencer data collection
      • prolog_colour.pl
      • lazy_lists.pl -- Lazy list handling
      • ugraphs.pl -- Graph manipulation library
      • url.pl -- Analysing and constructing URL
      • www_browser.pl
      • prolog_pack.pl
      • git.pl -- Run GIT commands
      • utf8.pl
      • dialect.pl -- Support multiple Prolog dialects
      • system.pl -- System utilities
      • terms.pl -- Term manipulation
      • date.pl -- Process dates and times
      • persistency.pl -- Provide persistent dynamic predicates
      • iostream.pl -- Utilities to deal with streams
      • prolog_stack.pl
      • edinburgh.pl -- Some traditional Edinburgh predicates
      • prolog_clause.pl
      • prolog_breakpoints.pl
      • 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 -- Utilities for numbered terms
      • pio.pl -- Pure I/O
      • base32.pl -- Base32 encoding and decoding
      • charsio.pl
      • codesio.pl -- I/O on Lists of Character Codes
      • coinduction.pl -- Co-Logic Programming
      • heaps.pl -- heaps/priority queues
      • rbtrees.pl -- Red black trees
      • statistics.pl -- Get information about resource usage
      • when.pl -- Conditional coroutining
      • backcomp.pl
      • prolog_versions.pl -- Demand specific (Prolog) versions
      • ansi_term.pl
      • thread.pl
      • listing.pl
      • zip.pl
      • quintus.pl
      • writef.pl -- Old-style formatted write
      • optparse.pl -- command line parsing
      • edit.pl -- Editor interface
      • prolog_coverage.pl
      • nb_set.pl
      • prolog_codewalk.pl
      • prolog_metainference.pl -- Infer meta-predicate properties
      • prolog_profile.pl -- Execution profiler
      • rwlocks.pl -- Read/write locks
      • make.pl -- Reload modified source files
      • macros.pl -- Macro expansion
      • threadutil.pl -- Interactive thread utilities
      • check.pl -- Consistency checking
      • intercept.pl
      • prolog_trace.pl -- Print access to predicates
      • ctypes.pl -- Character code classification
      • increval.pl
      • tables.pl
      • prolog_jiti.pl -- Just In Time Indexing (JITI) utilities
      • strings.pl -- String utilities
      • tty.pl
      • streams.pl
      • files.pl
      • prolog_autoload.pl
      • prolog_debug.pl -- User level debugging tools
      • help.pl -- Text based manual
      • fastrw.pl -- Fast reading and writing of terms
      • readln.pl
      • shell.pl -- Elementary shell commands
      • prolog_history.pl
      • prolog_config.pl
      • hashtable.pl
      • explain.pl
      • prolog_wrap.pl -- Wrapping predicates
 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