:- op(500,fx,[t,c,g,mg,s,st,sc,ss,sstk,l,r,m,nw,p,pg,q,lr,nwf,nwt,wf,wt]).
:- op(500,xfy,[e]).

pg  :- parse_and_gen.
p   :- parse.  
c X :- compile_gram(X).
c7 :- compile_gram(grammar7b).
c8 :- compile_gram(grammar8a).
i :- interp.
ni :- nointerp.
t X :- show_type X.
st X :- show_type X.
mg X :- mgsat X.
s X :- show_clause X.
sc X :- show_clause X.
l X :- lex(X).
r X :- rule X.
m X :- macro X.
lr X :- lex_rule X.
X e Y :- edge(X,Y).
nwf X :- no_write_feat(X).
nwt X :- no_write_type(X).
wf X :- write_feat(X).
wt X :- write_type(X).
wfs :- write_feats.
wts :- write_types.
p X :- rec X.
q X :- query X.
g X :- gen(X).
pg X :- rec(X,R,S,I),gen(R,S,I).

sb   :- pretty_graphic(sig,bot).
ss X :- pretty_graphic(sig,X).
sbtk :- tk_tree(sig,bot).
sstk X :- tk_tree(sig,X).


:- nl.
:- write('A few macros for interaction with ALE:').
:- format("

compiling:
pg    :- parse_and_gen. (compile for parsing and generation)
p     :- parse.         (compile for parsing only) 
c X   :- compile_gram(X).

inspecting signature:
st X   :- show_type X.
sc X   :- show_clause X.
mg X   :- mgsat X.
sb     :- pretty_graphic(sig,bot). (for displaying 
ss X   :- pretty_graphic(sig,X).    multiple inheritance, 
sbtk   :- tk_tree(sig,bot).         works only 
sstk X :- tk_tree(sig,X).           with HDRUG loaded)

inspecting grammar:
l X   :- lex X.
r X   :- rule X.
m X   :- macro X.
lr X  :- lex_rule X.
q X   :- query X.

processing:
p X   :- rec X.
g X   :- gen(X).
pg X  :- rec(X,R,S,I),gen(R,S,I).
nwf X :- no_write_feat(X).
nwt X :- no_write_type(X).
wf X  :- write_feat(X).
wt X  :- write_type(X).
wfs   :- write_feats.
wts   :- write_types.

debugging:
i     :- interp.
ni    :- nointerp.
X e Y :- edge(X,Y).

",[]).
