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