external_fun_type('STRING_TO_REAL',[],[string,real]).
external_fun_type('RADD',[],[real,real,real]).
external_fun_type('RSUB',[],[real,real,real]).
external_fun_type('RMUL',[],[real,real,real]).
external_fun_type('RDIV',[],[real,real,real]).
external_fun_type('RINV',[],[real,real]).
external_fun_type('RPI',[],[real]).
external_fun_type('RZERO',[],[real]).
external_fun_type('RONE',[],[real]).
external_fun_type('REULER',[],[real]).
external_fun_type('REPSILON',[],[real]).
external_fun_type('RMAXFLOAT',[],[real]).
external_fun_type('RSIN',[],[real,real]).
external_fun_type('RCOS',[],[real,real]).
external_fun_type('RTAN',[],[real,real]).
external_fun_type('RCOT',[],[real,real]).
external_fun_type('RSINH',[],[real,real]).
external_fun_type('RCOSH',[],[real,real]).
external_fun_type('RTANH',[],[real,real]).
external_fun_type('RCOTH',[],[real,real]).
external_fun_type('RASIN',[],[real,real]).
external_fun_type('RACOS',[],[real,real]).
external_fun_type('RATAN',[],[real,real]).
external_fun_type('RACOT',[],[real,real]).
external_fun_type('RASINH',[],[real,real]).
external_fun_type('RACOSH',[],[real,real]).
external_fun_type('RATANH',[],[real,real]).
external_fun_type('RACOTH',[],[real,real]).
external_fun_type('RATAN2',[],[real,real,real]).
external_fun_type('RHYPOT',[],[real,real,real]).
external_fun_type('RADIANS',[],[real,real]).
external_fun_type('DEGREE',[],[real,real]).
external_fun_type('RUMINUS',[],[real,real]).
external_fun_type('REXP',[],[real,real]).
external_fun_type('RLOGe',[],[real,real]).
external_fun_type('RSQRT',[],[real,real]).
external_fun_type('RABS',[],[real,real]).
external_fun_type('ROUND',[],[real,integer]).
external_fun_type('RSIGN',[],[real,real]).
external_fun_type('RINTEGER',[],[real,real]).
external_fun_type('RFRACTION',[],[real,real]).
external_fun_type('RMAX',[],[real,real,real]).
external_fun_type('RMIN',[],[real,real,real]).
external_fun_type('RPOW',[],[real,real,real]).
external_fun_type('RDECIMAL',[],[integer,integer,real]).
external_fun_type('RLOG',[],[real,real,real]).
external_fun_type('RLT',[],[real,real,boolean]).
external_fun_type('REQ',[],[real,real,boolean]).
external_fun_type('RNEQ',[],[real,real,boolean]).
external_fun_type('RLEQ',[],[real,real,boolean]).
external_fun_type('RGT',[],[real,real,boolean]).
external_fun_type('RGEQ',[],[real,real,boolean]).
external_fun_type('RMAXIMUM',[],[set(real),real]).
external_fun_type('RMINIMUM',[],[set(real),real]).
external_fun_type('RNEXT',[],[real,real]).
external_fun_type('RPREV',[],[real,real]).
external_fun_type('SFADD16',[],[real,real,real]).
external_fun_type('SFSUB16',[],[real,real,real]).
external_fun_type('SFMUL16',[],[real,real,real]).
external_fun_type('SFDIV16',[],[real,real,real]).
external_fun_type('SFSQRT16',[],[real,real]).
external_fun_type('SFMULADD16',[],[real,real,real,real]).
external_fun_type('SFADD32',[],[real,real,real]).
external_fun_type('SFSUB32',[],[real,real,real]).
external_fun_type('SFMUL32',[],[real,real,real]).
external_fun_type('SFDIV32',[],[real,real,real]).
external_fun_type('SFSQRT32',[],[real,real]).
external_fun_type('SFMULADD32',[],[real,real,real,real]).
external_fun_type('SFADD64',[],[real,real,real]).
external_fun_type('SFSUB64',[],[real,real,real]).
external_fun_type('SFMUL64',[],[real,real,real]).
external_fun_type('SFDIV64',[],[real,real,real]).
external_fun_type('SFSQRT64',[],[real,real]).
external_fun_type('SFMULADD64',[],[real,real,real,real]).
external_fun_type('SFADD80',[],[couple(int,int),couple(int,int),couple(int,int)]).
external_fun_type('SFSUB80',[],[couple(int,int),couple(int,int),couple(int,int)]).
external_fun_type('SFMUL80',[],[couple(int,int),couple(int,int),couple(int,int)]).
external_fun_type('SFDIV80',[],[couple(int,int),couple(int,int),couple(int,int)]).
external_fun_type('SFSQRT80',[],[couple(int,int),couple(int,int)]).
external_fun_type('SFADD128',[],[couple(int,int),couple(int,int),couple(int,int)]).
external_fun_type('SFSUB128',[],[couple(int,int),couple(int,int),couple(int,int)]).
external_fun_type('SFMUL128',[],[couple(int,int),couple(int,int),couple(int,int)]).
external_fun_type('SFDIV128',[],[couple(int,int),couple(int,int),couple(int,int)]).
external_fun_type('SFSQRT128',[],[couple(int,int),couple(int,int)]).
external_fun_type('SFMULADD128',[],[couple(int,int),couple(int,int),couple(int,int),couple(int,int)]).
external_fun_type('svg_points',[T1,T2],[seq(couple(T1,T2)),string]). % T1, T2 should be numbers
external_fun_type('svg_train',[T1,T2],[T1,T1,T2,T2,T2,string]). % T1, T2 should be numbers
external_fun_type('svg_car',[T1,T2],[T1,T1,T2,T2,T2,string]). % T1, T2 should be numbers
external_fun_type('svg_axis',[T1,T2],[set(T1),T2,T2,T2,string]). % T1, T2 should be numbers
external_fun_type('svg_set_polygon',[T2],[set(integer),T2,T2,T2,string]). % T2 should be number type
external_fun_type('svg_set_polygon_auto',[T2],[set(integer),T2,T2,string]). % T2 should be number type
external_fun_type('svg_dasharray_for_intervals',[T1,T2],[set(couple(T1,T2)),string]). % T1, T2 should be numbers
external_fun_type('svg_set_dasharray',[],[set(integer),string]).
external_fun_type('COS',[],[integer,integer]).
external_fun_type('COSx',[],[integer,integer,integer]).
external_fun_type('SIN',[],[integer,integer]).
external_fun_type('SINx',[],[integer,integer,integer]).
external_fun_type('TAN',[],[integer,integer]).
external_fun_type('TANx',[],[integer,integer,integer]).
external_fun_type('PROLOG_FUN',[],[string,integer,integer,integer]).
external_fun_type('LOGx',[],[integer,integer,integer,integer]).
external_fun_type('GCD',[],[integer,integer,integer]).
external_fun_type('LCM',[],[integer,integer,integer]).
external_fun_type('ABS',[],[integer,integer]).
external_fun_type('SIGN',[],[integer,integer]).
external_fun_type('FDIV',[],[integer,integer,integer]).
external_fun_type('CDIV',[],[integer,integer,integer]).
external_fun_type('SQRT',[],[integer,integer]).
external_fun_type('MSB',[],[integer,integer]).
external_fun_type('FACTORIAL',[],[integer,integer]).
external_fun_type('BNOT',[],[integer,integer]).
external_fun_type('BAND',[],[integer,integer,integer]).
external_fun_type('BOR',[],[integer,integer,integer]).
external_fun_type('BXOR',[],[integer,integer,integer]).
external_fun_type('BLSHIFT',[],[integer,integer,integer]).
external_fun_type('BRSHIFT',[],[integer,integer,integer]).
external_fun_type('BITS',[],[integer,seq(integer)]).
external_fun_type('CHOOSE',[X],[set(X),X]).
external_fun_type('MU',[X],[set(X),X]).
external_fun_type('MU_WD',[X],[set(X),X]).
external_fun_type('CHOOSE_n',[X],[integer,set(X),set(X)]).
external_fun_type('SORT',[X],[set(X),seq(X)]).
external_fun_type('SQUASH',[X],[set(couple(integer,X)),seq(X)]). % input not necessarily proper sequence
external_fun_type('REPLACE',[X],[seq(X),seq(X),seq(X),set(seq(X))]).
external_fun_type('LESS',[X],[X,X,boolean]).
external_fun_type('LEQ_SYM_BREAK',[X],[X,X,boolean]).
external_fun_type('LEQ_SYM',[X],[X,X,boolean]).
external_fun_type('FORCE',[T],[T,T]).
external_fun_type('READ_PROB_DATA_FILE',[T],[set(T),string,T]).
external_fun_type('STRING_APPEND',[],[string,string,string]).
external_fun_type('STRING_REV',[],[string,string]).
external_fun_type('STRING_CONC',[],[seq(string),string]).
external_fun_type('STRING_CHARS',[],[string,seq(string)]).
external_fun_type('CODES_TO_STRING',[],[seq(integer),string]).
external_fun_type('STRING_CODES',[],[string,seq(integer)]).
external_fun_type('STRING_TO_UPPER',[],[string,string]).
external_fun_type('STRING_TO_LOWER',[],[string,string]).
external_fun_type('STRING_EQUAL_CASE_INSENSITIVE',[],[string,string,boolean]).
external_fun_type('STRING_LENGTH',[],[string,integer]).
external_fun_type('STRING_SPLIT',[],[string,string,seq(string)]).
external_fun_type('STRING_JOIN',[],[seq(string),string,string]).
external_fun_type('STRING_CONTAINS_STRING',[],[string,string,boolean]).
external_fun_type('SUB_STRING',[],[string,integer,integer,string]).
external_fun_type('STRING_REPLACE',[],[string,string,string,string]).
external_fun_type('STRING_IS_FREETYPE',[],[string,boolean]).
external_fun_type('STRING_TO_FREETYPE',[F],[string,F]). % F is freetype case
external_fun_type('TYPED_STRING_TO_ENUM',[T],[set(T),string,T]).
external_fun_type('STRING_TO_ENUM',[G],[string,G]). % G is enumerated set
external_fun_type('STRING_IS_INT',[],[string,boolean]).
external_fun_type('STRING_IS_NUMBER',[],[string,boolean]).
external_fun_type('STRING_IS_DECIMAL',[],[string,boolean]).
external_fun_type('STRING_IS_ALPHANUMERIC',[],[string,boolean]).
external_fun_type('DEC_STRING_TO_INT',[],[string,integer,integer]).
external_fun_type('STRING_PADLEFT',[],[string,integer,string,string]).
external_fun_type('STRING_TO_INT',[],[string,integer]).
external_fun_type('INT_TO_STRING',[],[integer,string]).
external_fun_type('INT_TO_DEC_STRING',[],[integer,integer,string]).
external_fun_type('REAL_TO_DEC_STRING',[],[real,integer,string]).
external_fun_type('TO_STRING',[X],[X,string]).
external_fun_type('TO_STRING_UNICODE',[X],[X,string]).
external_fun_type('FORMAT_TO_STRING',[X],[string,seq(X),string]).
external_fun_type('STRINGIFY',[X],[X,string]).
external_fun_type('HASH',[X],[X,integer]).
external_fun_type('TO_INT',[X],[X,integer]). % can translate enumerated/deferred set elements to integer
external_fun_type('INT_TO_ENUM',[T],[set(T),integer,T]).
external_fun_type('REGEX_MATCH',[],[string,string,boolean]).
external_fun_type('REGEX_IMATCH',[],[string,string,boolean]).
external_fun_type('IS_REGEX',[],[string,boolean]).
external_fun_type('REGEX_REPLACE',[],[string,string,string,string]).
external_fun_type('REGEX_IREPLACE',[],[string,string,string,string]).
external_fun_type('REGEX_SEARCH_STR',[],[string,string,string]).
external_fun_type('REGEX_ISEARCH_STR',[],[string,string,string]).
external_fun_type('REGEX_SEARCH',[],[string,integer,string,
record([field(length,integer),field(position,integer),
field(string,string),
field(submatches,seq(string))])]).
external_fun_type('REGEX_ISEARCH',TV,T) :- external_fun_type('REGEX_SEARCH',TV,T).
external_fun_type('REGEX_SEARCH_ALL',[],[string,string,seq(string)]).
external_fun_type('REGEX_ISEARCH_ALL',[],[string,string,seq(string)]).
external_fun_type('SHA_HASH',[X],[X,set(couple(integer,integer))]).
external_fun_type('SHA_HASH_HEX',[X],[X,string]).
external_fun_type('SHA_HASH_FILE_HEX',[],[string,string]).
external_fun_type('FILES',[],[string,set(string)]).
external_fun_type('FULL_FILES',[],[string,set(string)]).
external_fun_type('DIRECTORIES',[],[string,set(string)]).
external_fun_type('FULL_DIRECTORIES',[],[string,set(string)]).
external_fun_type('FILE_EXISTS',[],[string,boolean]).
external_fun_type('DIRECTORY_EXISTS',[],[string,boolean]).
external_fun_type('FILE_PROPERTY',[],[string,string,boolean]).
external_fun_type('FILE_PROPERTY_VALUE',[],[string,string,integer]).
external_fun_type('DIRECTORY_PROPERTY',[],[string,string,boolean]).
external_fun_type('DIRECTORY_PROPERTY_VALUE',[],[string,string,integer]).
external_fun_type('printf',[T],[string,seq(T),boolean]).
external_fun_type('SET_PREF',[],[string,string,boolean]).
external_fun_type('GET_PREF',[],[string,string]).
external_fun_type('GET_PREF_DEFAULT',[],[string,string]).
external_fun_type('observe',[T],[T,boolean]).
external_fun_type('observe_silent',[T],[T,boolean]).
external_fun_type('observe_indent',[T],[T,boolean]).
external_fun_type('observe_fun',[X],[X,boolean]).
external_fun_type('vprintf',[T],[string,T,T]).
external_fun_type('ARGV',[],[integer,string]).
external_fun_type('ARGC',[],[integer]).
external_fun_type('RANDOM',[],[integer,integer,integer]).
external_fun_type('RAND',[],[real,real,real]).
external_fun_type('random_element',[T],[set(T),T]).
external_fun_type('random_numset',[],[integer,integer,integer,integer,set(integer)]).
external_fun_type('NORMAL',[],[integer,integer,integer]).
external_fun_type('RNORMAL',[],[real,real,real]).
external_fun_type('random_subset',[T],[set(T),set(T)]).
external_fun_type('random_ordering',[T],[set(T),seq(T)]).
external_fun_type('random_permutation',[T],[seq(T),seq(T)]).
external_fun_type('TIME',[],[string,integer]).
external_fun_type('GET_INFO',[],[string,string]).
external_fun_type('TIMESTAMP_INFO',[],[string,integer,integer]).
external_fun_type('TIMESTAMP',[],[integer,integer,integer,integer,integer,integer,integer]).
external_fun_type('CURRENT_FILE_POSITION',[],[string,string,integer]).
external_fun_type('ASSERT_EXPR',[T],[boolean,string,T,T]).
external_fun_type('STATE_AS_STRING',[],[integer,string]).
external_fun_type('CURRENT_STATE_AS_TYPED_STRING',[],[string]).
external_fun_type('VARS_AS_TYPED_STRING',[],[string,string]).
external_fun_type('STATE_PROPERTY',[],[string,string]).
external_fun_type('STATE_SUCC',[],[integer,integer,boolean]).
external_fun_type('ENABLED',[],[string,boolean]).
external_fun_type('ENABLED_TRANSITION',[],[string,boolean]).
external_fun_type('NON_DET_STATE',[],[boolean]).
external_fun_type('NON_DET_OUTPUT_STATE',[],[boolean]).
external_fun_type('GET_IS_DET',[],[string,boolean]).
external_fun_type('GET_IS_DET_OUTPUT',[],[string,boolean]).
external_fun_type('NON_DET_OUTPUT_OPERATIONS',[],[set(string)]).
external_fun_type('GET_IS_ENABLED_WITH_ARGS',[X],[string,X,boolean]).
external_fun_type('STATE_TRANS',[],[integer,string,integer,boolean]).
external_fun_type('STATE_TRANS_ARGS',[X],[integer,string,X,integer,boolean]).
external_fun_type('STATE_SAT',[],[integer,string,boolean]).
external_fun_type('HISTORY',[],[seq(integer)]).
external_fun_type('EVAL_OVER_HISTORY',[X],[X,integer,seq(X)]).
external_fun_type('MACHINE_INFO',[],[string,string,string]).
external_fun_type('INT_TO_HEX_STRING',[],[integer,string]).
external_fun_type('PROJECT_STATISTICS',[],[string,integer]).
external_fun_type('PROJECT_INFO',[],[string,set(string)]).
external_fun_type('SOURCE',[],[string,string]).
external_fun_type('PROB_INFO_STR',[],[string,string]).
external_fun_type('PROB_STATISTICS',[],[string,integer]).
external_fun_type('STATE_VALUES',[T],[string,set(couple(couple(integer,integer),T))]).
external_fun_type('FORMULA_INFOS',[],[string,seq(string)]).
external_fun_type('FORMULA_VALUES',[],[string,seq(string)]).
external_fun_type('STORE',[X],[X,X]).
external_fun_type('STORE_VALUE',[X],[string,X,boolean]).
external_fun_type('RECALL_VALUE',[X],[string,X]).
external_fun_type('CLOSURE1',[X],[set(couple(X,X)),set(couple(X,X))]).
external_fun_type('SCCS',[X],[set(couple(X,X)),set(set(X))]).
external_fun_type('READ_XML',[],[string,string,seq(XT)]) :- xml_element_type(XT).
external_fun_type('READ_XML_FROM_STRING',[],[string,seq(XT)]) :- xml_element_type(XT).
external_fun_type('READ_JSON',[],[string,seq(XT)]) :- xml_element_type(XT).
external_fun_type('READ_JSON_FROM_STRING',[],[string,seq(XT)]) :- xml_element_type(XT).
external_fun_type('WRITE_XML',[],[seq(XT),string]) :- xml_element_type(XT).
external_fun_type('READ_CSV_STRINGS',[],[string,seq(set(couple(string,string)))]).
external_fun_type('READ_CSV',[T],[string,T]).
external_fun_type('READ_PGM_IMAGE_FILE',[],[string,seq(seq(integer))]).
external_fun_type('WRITE_PGM_IMAGE_FILE',[],[string,seq(seq(integer),boolean)]).