1/*  Part of Assertion Reader for SWI-Prolog
    2
    3    Author:        Edison Mera
    4    E-mail:        efmera@gmail.com
    5    WWW:           https://github.com/edisonm/assertions
    6    Copyright (C): 2017, Process Design Center, Breda, The Netherlands.
    7    All rights reserved.
    8
    9    Redistribution and use in source and binary forms, with or without
   10    modification, are permitted provided that the following conditions
   11    are met:
   12
   13    1. Redistributions of source code must retain the above copyright
   14       notice, this list of conditions and the following disclaimer.
   15
   16    2. Redistributions in binary form must reproduce the above copyright
   17       notice, this list of conditions and the following disclaimer in
   18       the documentation and/or other materials provided with the
   19       distribution.
   20
   21    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   22    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   23    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
   24    FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
   25    COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
   26    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
   27    BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   28    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   29    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   30    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
   31    ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   32    POSSIBILITY OF SUCH DAMAGE.
   33*/
   34
   35:- module(libprops, []).

Properties of library predicates

*/

   40:- use_module(library(assertions)).   41:- use_module(library(metaprops)).   42:- use_module(library(globprops)).   43:- use_module(library(typeprops)).   44:- init_expansors.   45
   46:- pred functor(+, -constant, -nnegint) is det.
   47:- pred functor(-, +constant, +nnegint) is det.
   48:- pred functor(+, +constant, ?nnegint) is semidet.
   49:- pred functor(+, -constant, +nnegint) is semidet.
   50:- pred predicate_property(callable, ?).
   51:- pred current_predicate(atm, callable).
   52
   53:- pred (+arithexpression  >  +arithexpression) is semidet.
   54:- pred (+arithexpression  <  +arithexpression) is semidet.
   55:- pred (+arithexpression  >= +arithexpression) is semidet.
   56:- pred (+arithexpression =<  +arithexpression) is semidet.
   57:- pred (+arithexpression =\= +arithexpression) is semidet.
   58:- pred (+arithexpression =:= +arithexpression) is semidet.
   59:- pred ((is)/2) : (var*arithexpression) => (num*arithexpression) is det.
   60:- pred ((is)/2) : (num*arithexpression) is semidet.
   61
   62:- pred atomic_list_concat(+list(constant), +constant) is semidet.
   63:- pred atomic_list_concat(+list(constant), -atm) is det.
   64
   65:- pred atomic_list_concat(?list(constant), +constant, +constant) is semidet.
   66:- pred atomic_list_concat(+list(constant), +constant, -atm) is det.
   67
   68:- pred atomics_to_string(+list(constant), +constant) is semidet.
   69:- pred atomics_to_string(+list(constant), -str) is det.
   70
   71:- pred atomics_to_string(?list(constant), +constant, +constant) is semidet.
   72:- pred atomics_to_string(+list(constant), +constant, -str) is det.
   73
   74:- pred atom_number(+atm,-num) is semidet.
   75:- pred atom_number(?atm,+num) is det.
   76
   77:- pred string_upper(+atomic, -str) is det.
   78:- pred string_upper(+atomic, ?atomic) is semidet.
   79
   80:- pred string_lower(+atomic, -str) is det.
   81:- pred string_lower(+atomic, ?atomic) is semidet.
   82
   83:- pred atom_codes(+atomic, -list) is det.
   84:- pred atom_codes(-atm,    +list) is det.
   85:- pred atom_codes(+atomic, ?list) is semidet.
   86
   87:- pred atom_concat(+atomic, +atomic, -atm) is det.
   88:- pred atom_concat(+atomic, +atomic, +atomic) is semidet.
   89:- pred atom_concat(-atm, +atomic, +atomic) is semidet.
   90:- pred atom_concat(+atomic, -atm, +atomic) is semidet.
   91:- pred atom_concat(-atm, -atm, +atomic) is multi.
   92
   93:- pred string_concat(+atomic, +atomic, -str) is det.
   94:- pred string_concat(+atomic, +atomic, +atomic) is semidet.
   95:- pred string_concat(-str, +atomic, +atomic) is semidet.
   96:- pred string_concat(+atomic, -str, +atomic) is semidet.
   97:- pred string_concat(-str, -str, +atomic) is multi.
   98
   99:- pred sub_atom(+atomic,?int,?int,?int,?atm).
  100
  101:- use_module(library(apply)).  102
  103:- pred maplist(1, list).
  104:- pred maplist(2, list, list).
  105:- pred maplist(3, list, list, list).
  106:- pred maplist(4, list, list, list, list).
  107
  108:- pred memberchk(?, ?list) is semidet.
  109
  110:- use_module(library(process)).  111
  112:- pred process_create(+, +list, +) is det.
  113
  114:- true pred [(==)/2,
  115              (\==)/2,
  116              (=)/2,
  117              (\=)/2,
  118              (=@=)/2,
  119              is_list/1,
  120              is_dict/1,
  121              is_stream/1,
  122              cyclic_term/1,
  123              rational/1,
  124              (\+)/1,
  125              forall/2,
  126              once/1,
  127              erase/1,
  128              atom_string/2,
  129              text_to_string/2,
  130              file_directory_name/2,
  131              file_base_name/2,
  132              directory_file_path/3,
  133              compound_name_arity/3,
  134              functor/3,
  135              (=..)/2,
  136              sort/2,
  137              same_file/2,
  138              downcase_atom/2,
  139              upcase_atom/2
  140             ] is semidet.
  141
  142:- true prop [[ground/1,
  143               atom/1,
  144               atomic/1,
  145               float/1,
  146               integer/1,
  147               nonvar/1,
  148               number/1,
  149               var/1,
  150               string/1,
  151               callable/1,
  152               compound/1
  153              ] is semidet,
  154              member/2].
  155
  156:- true