1:- if((prolog_load_context(source,S),prolog_load_context(file,S))).    2
    3:- module(lps_syntax,[
    4     op(900,fy,(not)), 
    5     op(1200,xfx,(then)),
    6     op(1185,fx,(if)),
    7     op(1190,xfx,(if)),
    8     op(1100,xfy,else), 
    9     op(1050,xfx,(terminates)),
   10     op(1050,xfx,(initiates)),
   11     op(1050,xfx,(updates)),
   12% Rejected    (      op(1050,fx,impossible), 
   13     op(1050,fx,(observe)),
   14     op(1050,fx,(false)),
   15     op(1050,fx,initially),
   16     op(1050,fx,fluents),
   17     op(1050,fx,events),
   18     op(1050,fx,prolog_events),
   19     op(1050,fx,actions),
   20     op(1050,fx,unserializable),
   21% notice ',' has priority 1000
   22     op(999,fx,update),
   23     op(999,fx,initiate),
   24     op(999,fx,terminate),
   25     op(997,xfx,in),
   26     op(995,xfx,at),
   27     op(995,xfx,during),
   28     op(995,xfx,from), 
   29     op(994,xfx,to), % from's priority higher
   30     op(1050,xfy,::),
   31
   32% lps.js syntax extras
   33     op(1200,xfx,(<-)),
   34     op(1050,fx,(<-)),
   35% -> is already defined as 1050, xfy, which will do given that lps.js does not support if-then-elses
   36     op(700,xfx,(<=))
   37  ]).   38
   39:- endif.   40
   41% Surface syntax .pl
   42:- op(900,fy,(not)). 
   43:- op(1200,xfx,(then)).   44:- op(1185,fx,(if)).   45:- op(1190,xfx,(if)).   46% the following is for "conditional expressions", (if C then T else E)
   47% this maybe slightly confusing versus (if Antecedent then Consequent) rules, 
   48% and other choices would be possible, e.g. Python's or C et.al... but this still feels
   49% easier on newcomers, hoping that context (and the obligation to use parenthesis) helps:
   50:- op(1100,xfy,else). 
   51:- op(1050,xfx,(terminates)).   52:- op(1050,xfx,(initiates)).   53:- op(1050,xfx,(updates)).   54% Rejected:-( :- op(1050,fx,impossible). 
   55:- op(1050,fx,(observe)).   56:- op(1050,fx,(false)).   57:- op(1050,fx,initially).   58:- op(1050,fx,fluents).   59:- op(1050,fx,events).   60:- op(1050,fx,prolog_events).   61:- op(1050,fx,actions).   62:- op(1050,fx,unserializable).   63% notice ',' has priority 1000
   64:- op(999,fx,update).   65:- op(999,fx,initiate).   66:- op(999,fx,terminate).   67:- op(997,xfx,in).   68:- op(995,xfx,at).   69:- op(995,xfx,during).   70:- op(995,xfx,from). 
   71:- op(994,xfx,to). % from's priority higher
   72:- op(1050,xfy,::).   73
   74% lps.js syntax extras
   75:- op(1200,xfx,(<-)).   76:- op(1050,fx,(<-)).   77% -> is already defined as 1050, xfy, which will do given that lps.js does not support if-then-elses
   78:- op(700,xfx,(<=)).