1:- module(plammar_library_operators, [
    2    library_operators/2
    3  ]).    4
    5library_operators(clpfd, Ops) :-
    6  Ops = [
    7    op(760, yfx, '#<==>'),
    8    op(750, xfy, '#==>'),
    9    op(750, yfx, '#<=='),
   10    op(740, yfx, '#\\/'),
   11    op(730, yfx, '#\\'),
   12    op(720, yfx, '#/\\'),
   13    op(710,  fy, '#\\'),
   14    op(700, xfx, '#>'),
   15    op(700, xfx, '#<'),
   16    op(700, xfx, '#>='),
   17    op(700, xfx, '#=<'),
   18    op(700, xfx, '#='),
   19    op(700, xfx, '#\\='),
   20    op(700, xfx, 'in'),
   21    op(700, xfx, 'ins'),
   22    op(450, xfx, '..')
   23  ].
   24
   25library_operators(record, Ops) :-
   26  Ops = [
   27    op(1150, fx, 'record')
   28  ].
   29
   30library_operators(semweb, Ops) :-
   31  Ops = [
   32    op( 110, xfx, @),
   33    op( 650, xfx, ^^),
   34    op(1150,  fx, 'rdf_meta')
   35  ].
   36library_operators(semweb/_, Ops) :-
   37  library_operators(semweb, Ops).
   38
   39library_operators(lib, Ops) :-
   40  Ops = [
   41    op(200, fy, '&')
   42  ].
   43
   44library_operators(Lib, Ops) :-
   45  member(Lib, [dcg_macros, dcg_pair, dcg_core, dcg_codes]),
   46  Ops = [
   47    op(900,  fy, '\\<'),
   48    op(900,  fy, '\\>'),
   49    op(900, xfx, '<\\>'),
   50    op(900,  fy, '<\\>'),
   51    op(900, xfy, '\\#')
   52  ].
   53
   54library_operators(xpath, Ops) :-
   55  Ops = [
   56    op(400, fx, '//'),
   57    op(400, fx, '/'),
   58    op(200, fy, '@')
   59  ].
   60
   61library_operators(real, Ops) :-
   62  Ops = [
   63    op(950, fx, '<-'),
   64    op(950, yfx, '<-'),
   65    op(950, yfx, '<<-'),
   66    op(950, xf, '<<-')
   67  ].
   68
   69library_operators(chr, Ops) :-
   70  Ops = [
   71    op(1180, xfx, '==>'),
   72    op(1180, xfx, '<=>'),
   73    op(1150,  fx, 'constraints'),
   74    op(1150,  fx, 'chr_constraint'),
   75    op(1150,  fx, 'handler'),
   76    op(1150,  fx, 'rules'),
   77    op(1100, xfx, '\\'),
   78    op(1200, xfx, '@'),
   79    op(1190, xfx, 'pragma'),
   80    op( 500, yfx, '#'),
   81    op(1150,  fx, 'chr_type'),
   82    op(1130, xfx, '--->'),
   83    op(1150,  fx, '(?)'),
   84    op(1150,  fx, 'chr_declaration')
   85  ].
   86
   87library_operators(lambda, Ops) :-
   88  Ops = [
   89    op(201,xfx,'+\\')
   90  ].
   91
   92library_operators(clambda, Ops) :-
   93  Ops = [
   94    op(201,xfx,'+\\')
   95  ].
   96
   97library_operators(typedef, Ops) :-
   98  Ops = [
   99    op(1150,fx,'type'),
  100    op(1130,xfx,'--->')
  101  ].
  102
  103library_operators(http/html_write, Ops) :-
  104  Ops = [
  105    op(1150, fx, 'html_meta')
  106  ].
  107
  108library_operators(assertions, Ops) :-
  109  Ops = [
  110    op(975,  xfx, '=>'),
  111    op(978,  xfx, '::'),
  112    op(1150,  fx, 'decl'),
  113    op(1150, xfx, 'decl'),
  114    op(1150,  fx, 'pred'),
  115    op(1150, xfx, 'pred'),
  116    op(1150,  fx, 'prop'),
  117    op(1150, xfx, 'prop'),
  118    op(1150,  fx, 'modedef'),
  119    op(1150,  fx, 'calls'),
  120    op(1150, xfx, 'calls'),
  121    op(1150,  fx, 'success'),
  122    op(1150, xfx, 'success'),
  123    op(1150,  fx, 'comp'),
  124    op(1150, xfx, 'comp'),
  125    op(1150,  fx, 'entry'),
  126    op(1150,  fx, 'exit'),
  127    op(1150, xfx, 'exit'),
  128    op( 550, yfx, '#'),
  129    op( 500,  fx, '?'),
  130    op( 500,  fx, ':'),
  131    op( 500,  fx, '='),
  132    op( 500,  fx, '/'),
  133    op( 500,  fx, '>'),
  134    op( 500,  fx, '!'),
  135    op( 500,  fx, '*'),
  136    op( 500,  fx, '@'),
  137    op(1150,  fx, 'type')
  138  ].
  139
  140library_operators(ffi, Ops) :-
  141  Ops = [
  142    op(200,  fy, '*'),
  143    op(100, xfx, '~'),
  144    op( 20, yf , '[]')
  145  ].
  146
  147library_operators(func, Ops) :-
  148  Ops = [
  149    op(675, xfy, '$'),
  150    op(650, xfy, 'of')
  151  ].
  152
  153library_operators(type_check, Ops) :-
  154  Ops = [
  155    op(1150,  fx, 'type'),
  156    op(1130, xfx, '--->'),
  157    op(1150,  fx, 'pred'),
  158    op(1150,  fx, 'trust_pred'),
  159    op( 500, yfx, '::'),
  160    op( 500, yfx, ':<'),
  161    op( 200,  fy, '?')
  162  ].
  163
  164library_operators(dictoo, Ops) :-
  165  Ops = [
  166    op(2,fx,'?')
  167  ].
  168
  169library_operators(regex, Ops) :-
  170  Ops = [
  171    op(700, xfx, '=~'),
  172    op(700, xfx, '\\~')
  173  ].
  174
  175library_operators(swipe, Ops) :-
  176  Ops = [
  177    op(300, xfy, ':>'),
  178    op(300, yfx, '>:'),
  179    op(200,  fy, '@')
  180  ]