• 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

4.29 Built-in list operations
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
      • Built-in Predicates
        • Built-in list operations
          • is_list/1
          • memberchk/2
          • length/2
          • sort/2
          • sort/4
          • msort/2
          • keysort/2
          • predsort/3
    • Packages
Availability:built-in
[ISO]sort(+List, -Sorted)
True if Sorted can be unified with a list holding the elements of List, sorted to the standard order of terms (see section 4.6). Duplicates are removed. The implementation is in C, using natural merge sort.142Contributed by Richard O'Keefe. The sort/2 predicate can sort a cyclic list, returning a non-cyclic version with the same elements.

Note that List may contain non-ground terms. If Sorted is unbound at call-time, for each consecutive pair of elements in Sorted, the relation E1 @< E2 will hold. However, unifying a variable in Sorted may cause this relation to become invalid, even unifying a variable in Sorted with another (older) variable. See also section 4.6.1.

ClioPatria (version V3.1.1-51-ga0b30a5)