
sentence(_1,_2,_3,_4,_5) :-
   declarative(_1,_2,_6,_4,_7),
   terminator(.,_6,_3,_7,_5).
sentence(_1,_2,_3,_4,_5) :-
   wh_question(_1,_2,_6,_4,_7),
   terminator(?,_6,_3,_7,_5).
sentence(_1,_2,_3,_4,_5) :-
   yn_question(_1,_2,_6,_4,_7),
   terminator(?,_6,_3,_7,_5).
sentence(_1,_2,_3,_4,_5) :-
   imperative(_1,_2,_6,_4,_7),
   terminator(!,_6,_3,_7,_5).


declarative(decl(_1),_2,_3,_4,_5) :-
   s(_1,_6,_2,_3,_4,_5).


wh_question(whq(_1,_2),_3,_4,_5,_6) :-
   variable_q(_1,_7,_8,_9,_3,_10,_5,_11),
   question(_8,_9,_2,_10,_4,_11,_6).


np(_1,_2,_3,_4,_5,_6,_7,_8,_8,_9,_10) :-
   virtual(np(_1,_2,_3,_4,_5,_6,_7),_9,_10).
np(np(_1,_2,[]),_1,_3,def,_4,_5,_6,_7,_8,_9,_10) :-
   is_pp(_5),
   pers_pron(_2,_1,_11,_7,_8,_9,_10),
   empty(_6),
   role(_11,decl,_3).
np(np(_1,_2,_3),_1,_4,_5,_6,_7,_8,_9,_10,_11,_12) :-
   is_pp(_7),
   np_head(_2,_1,_5+ _13,_14,_3,_9,_15,_11,_16),
   np_all(_17),
   np_compls(_13,_1,_6,_14,_17,_8,_15,_10,_16,_12).
np(part(_1,_2),3+ _3,_4,indef,_5,_6,_7,_8,_9,_10,_11) :-
   is_pp(_6),
   determiner(_1,_3,indef,_8,_12,_10,_13),
   terminal(of,_12,_14,_13,_15),
   s_all(_16),
   prep_case(_17),
   np(_2,3+plu,_17,def,_5,_16,_7,_14,_9,_15,_11).


variable_q(_1,_2,_3,_4,_5,_6,_7,x(gap,nonterminal,np(_8,_2,_4,_9,_10,_11,_12),_13)) :-
   whq(_1,_2,_8,_3,_5,_6,_7,_13),
   trace0(_11,_12).
variable_q(_1,_2,compl,_3,_4,_5,_6,x(gap,nonterminal,pp(pp(_7,_8),compl,_9,_10),_11)) :-
   prep(_7,_4,_12,_6,_13),
   whq(_1,_2,_8,_14,_12,_5,_13,_11),
   trace0(_9,_10),
   compl_case(_3).
variable_q(_1,_2,compl,_3,_4,_5,_6,x(gap,nonterminal,adv_phrase(pp(_7,np(_2,np_head(int_det(_1),[],_8),[])),_9,_10),_11)) :-
   context_pron(_7,_8,_4,_5,_6,_11),
   trace0(_9,_10),
   verb_case(_3).
variable_q(_1,_2,compl,_3,_4,_5,_6,x(gap,nonterminal,pred(adj,value(_7,wh(_1)),_8),_9)) :-
   terminal(how,_4,_10,_6,_11),
   adj(quant,_7,_10,_5,_11,_9),
   empty(_8),
   verb_case(_3).


pp(_1,_2,_3,_4,_5,_5,_6,_7) :-
   virtual(pp(_1,_2,_3,_4),_6,_7).
pp(pp(_1,_2),_3,_4,_5,_6,_7,_8,_9) :-
   prep(_1,_6,_10,_8,_11),
   prep_case(_12),
   np(_2,_13,_12,_14,_3,_4,_5,_10,_7,_11,_9).


adv_phrase(_1,_2,_3,_4,_4,_5,_6) :-
   virtual(adv_phrase(_1,_2,_3),_5,_6).
adv_phrase(pp(_1,_2),_3,_4,_5,_6,_7,_8) :-
   loc_pred(_1,_5,_9,_7,_10),
   pp(pp(prep(of),_2),compl,_3,_4,_9,_6,_10,_8).


pred(_1,_2,_3,_4,_4,_5,_6) :-
   virtual(pred(_1,_2,_3),_5,_6).
pred(_1,_2,_3,_4,_5,_6,_7) :-
   adj_phrase(_2,_3,_4,_5,_6,_7).
pred(neg,_1,_2,_3,_4,_5,_6) :-
   s_all(_7),
   pp(_1,compl,_7,_2,_3,_4,_5,_6).
pred(_1,_2,_3,_4,_5,_6,_7) :-
   s_all(_8),
   adv_phrase(_2,_8,_3,_4,_5,_6,_7).


whq(_1,_2,_3,undefined,_4,_5,_6,_7) :-
   int_det(_1,_2,_4,_8,_6,_9),
   s_all(_10),
   np(_3,_2,_11,_12,subj,_10,_13,_8,_5,_9,_7).
whq(_1,3+ _2,np(3+ _2,wh(_1),[]),_3,_4,_5,_6,_7) :-
   int_pron(_3,_4,_5,_6,_7).


int_det(_1,3+ _2,_3,_4,_5,_6) :-
   whose(_1,_2,_3,_4,_5,_6).
int_det(_1,3+ _2,_3,_4,_5,_6) :-
   int_art(_1,_2,_3,_4,_5,_6).


np_head0(_1,_2,_3,_4,_4,_5,_6) :-
   virtual(np_head0(_1,_2,_3),_5,_6).
np_head0(name(_1),3+sin,def+proper,_2,_3,_4,_5) :-
   name(_1,_2,_3,_4,_5).
np_head0(np_head(_1,_2,_3),3+ _4,_5+common,_6,_7,_8,_9) :-
   determiner(_1,_4,_5,_6,_10,_8,_11),
   adjs(_2,_10,_12,_11,_13),
   noun(_3,_4,_12,_7,_13,_9).
np_head0(_1,_2,def+proper,_3,_4,_5,x(nogap,nonterminal,gen_marker,_6)) :-
   poss_pron(_1,_2,_3,_4,_5,_6).
np_head0(np_head(_1,[],_2),3+sin,indef+common,_3,_4,_5,_6) :-
   quantifier_pron(_1,_2,_3,_4,_5,_6).


gen_marker(_1,_1,_2,_3) :-
   virtual(gen_marker,_2,_3).
gen_marker(_1,_2,_3,_4) :-
   terminal('\'',_1,_5,_3,_6),
   an_s(_5,_2,_6,_4).


whose(_1,_2,_3,_4,_5,x(nogap,nonterminal,np_head0(wh(_1),_2,proper),x(nogap,nonterminal,gen_marker,_6))) :-
   terminal(whose,_3,_4,_5,_6).


question(_1,_2,_3,_4,_5,_6,_7) :-
   subj_question(_1),
   role(subj,_8,_2),
   s(_3,_9,_4,_5,_6,_7).
question(_1,_2,_3,_4,_5,_6,_7) :-
   fronted_verb(_1,_2,_4,_8,_6,_9),
   s(_3,_10,_8,_5,_9,_7).


det(_1,_2,_3,_4,_4,_5,_6) :-
   virtual(det(_1,_2,_3),_5,_6).
det(det(_1),_2,_3,_4,_5,_6,_7) :-
   terminal(_8,_4,_5,_6,_7),
   det(_8,_2,_1,_3).
det(generic,_1,generic,_2,_2,_3,_3).


int_art(_1,_2,_3,_4,_5,x(nogap,nonterminal,det(_6,_2,def),_7)) :-
   int_art(_1,_2,_6,_3,_4,_5,_7).

subj_question(subj).


subj_question(undefined).


yn_question(q(_1),_2,_3,_4,_5) :-
   fronted_verb(nil,_6,_2,_7,_4,_8),
   s(_1,_9,_7,_3,_8,_5).


verb_form(_1,_2,_3,_4,_5,_5,_6,_7) :-
   virtual(verb_form(_1,_2,_3,_4),_6,_7).
verb_form(_1,_2,_3,_4,_5,_6,_7,_8) :-
   terminal(_9,_5,_6,_7,_8),
   verb_form(_9,_1,_2,_3).


neg(_1,_2,_3,_3,_4,_5) :-
   virtual(neg(_1,_2),_4,_5).
neg(aux+ _1,neg,_2,_3,_4,_5) :-
   terminal((not),_2,_3,_4,_5).
neg(_1,pos,_2,_2,_3,_3).


fronted_verb(_1,_2,_3,_4,_5,x(G,NT,verb_form(_6,_7,_8,_9),
    x(NG,NT,neg(_10,_11),_12))) :-
   NT = nonterminal,
   G = gap,
   NG = nogap,
   verb_form(_6,_7,_8,_13,_3,_14,_5,_15),
   verb_type(_6,aux+ _16),
   role(_1,_9,_2),
   neg(_17,_11,_14,_4,_15,_12).


imperative(imp(_1),_2,_3,_4,_5) :-
   imperative_verb(_2,_6,_4,_7),
   s(_1,_8,_6,_3,_7,_5).


imperative_verb(_1,_2,_3,x(nogap,terminal,you,x(nogap,nonterminal,verb_form(_4,imp+fin,2+sin,main),_5))) :-
   verb_form(_4,inf,_6,_7,_1,_2,_3,_5).


s(s(_1,_2,_3,_4),_5,_6,_7,_8,_9) :-
   subj(_1,_10,_11,_6,_12,_8,_13),
   verb(_2,_10,_11,_14,_12,_15,_13,_16),
   empty(_17),
   s_all(_18),
   verb_args(_11,_14,_3,_17,_19,_15,_20,_16,_21),
   minus(_18,_19,_22),
   plus(_18,_19,_23),
   verb_mods(_4,_22,_23,_5,_20,_7,_21,_9).


subj(there,_1,_2+be,_3,_4,_5,_6) :-
   terminal(there,_3,_4,_5,_6).
subj(_1,_2,_3,_4,_5,_6,_7) :-
   s_all(_8),
   subj_case(_9),
   np(_1,_2,_9,_10,subj,_8,_11,_4,_5,_6,_7).


np_head(_1,_2,_3,_4,_5,_6,_7,_8,_9) :-
   np_head0(_10,_11,_12,_6,_13,_8,_14),
   possessive(_10,_11,_12,_15,_15,_1,_2,_3,_4,_5,_13,_7,_14,_9).


np_compls(proper,_1,_2,[],_3,_4,_5,_5,_6,_6) :-
   empty(_4).
np_compls(common,_1,_2,_3,_4,_5,_6,_7,_8,_9) :-
   np_all(_10),
   np_mods(_1,_2,_11,_3,_4,_12,_10,_13,_6,_14,_8,_15),
   relative(_1,_11,_12,_13,_5,_14,_7,_15,_9).


possessive(_1,_2,_3,[],_4,_5,_6,_7,_8,_9,_10,_11,_12,_13) :-
   gen_case(_10,_14,_12,_15),
   np_head0(_16,_17,_18,_14,_19,_15,_20),
   possessive(_16,_17,_18,_21,[pp(poss,np(_2,_1,_4))|_21],_5,_6,_7,_8,_9,_19,_11,_20,_13).
possessive(_1,_2,_3,_4,_5,_1,_2,_3,_4,_5,_6,_6,_7,_7).


gen_case(_1,_2,_3,x(nogap,terminal,the,_4)) :-
   gen_marker(_1,_2,_3,_4).


an_s(_1,_2,_3,_4) :-
   terminal(s,_1,_2,_3,_4).
an_s(_1,_1,_2,_2).


determiner(_1,_2,_3,_4,_5,_6,_7) :-
   det(_1,_2,_3,_4,_5,_6,_7).
determiner(_1,_2,_3,_4,_5,_6,_7) :-
   quant_phrase(_1,_2,_3,_4,_5,_6,_7).


quant_phrase(quant(_1,_2),_3,_4,_5,_6,_7,_8) :-
   quant(_1,_4,_5,_9,_7,_10),
   number(_2,_3,_9,_6,_10,_8).


quant(_1,indef,_2,_3,_4,_5) :-
   neg_adv(_6,_1,_2,_7,_4,_8),
   comp_adv(_6,_7,_9,_8,_10),
   terminal(than,_9,_3,_10,_5).
quant(_1,indef,_2,_3,_4,_5) :-
   terminal(at,_2,_6,_4,_7),
   sup_adv(_8,_6,_3,_7,_5),
   sup_op(_8,_1).
quant(the,def,_1,_2,_3,_4) :-
   terminal(the,_1,_2,_3,_4).
quant(same,indef,_1,_1,_2,_2).


neg_adv(_1,(not)+ _1,_2,_3,_4,_5) :-
   terminal((not),_2,_3,_4,_5).
neg_adv(_1,_1,_2,_2,_3,_3).


sup_op(least,(not)+less).
sup_op(most,(not)+more).


np_mods(_1,_2,_3,[_4|_5],_6,_7,_8,_9,_10,_11,_12,_13) :-
   np_mod(_1,_2,_4,_6,_14,_10,_15,_12,_16),
   trace0(_17),
   plus(_17,_14,_18),
   minus(_6,_18,_19),
   plus(_14,_6,_20),
   np_mods(_1,_2,_3,_5,_19,_7,_20,_9,_15,_11,_16,_13).
np_mods(_1,_2,_3,_3,_4,_4,_5,_5,_6,_6,_7,_7).


np_mod(_1,_2,_3,_4,_5,_6,_7,_8,_9) :-
   pp(_3,_2,_4,_5,_6,_7,_8,_9).
np_mod(_1,_2,_3,_4,_5,_6,_7,_8,_9) :-
   reduced_relative(_1,_3,_4,_5,_6,_7,_8,_9).


verb_mods([_1|_2],_3,_4,_5,_6,_7,_8,_9) :-
   verb_mod(_1,_3,_10,_6,_11,_8,_12),
   trace0(_13),
   plus(_13,_10,_14),
   minus(_3,_14,_15),
   plus(_10,_3,_16),
   verb_mods(_2,_15,_16,_5,_11,_7,_12,_9).
verb_mods([],_1,_2,_2,_3,_3,_4,_4).


verb_mod(_1,_2,_3,_4,_5,_6,_7) :-
   adv_phrase(_1,_2,_3,_4,_5,_6,_7).
verb_mod(_1,_2,_3,_4,_5,_6,_7) :-
   is_adv(_2),
   adverb(_1,_4,_5,_6,_7),
   empty(_3).
verb_mod(_1,_2,_3,_4,_5,_6,_7) :-
   pp(_1,compl,_2,_3,_4,_5,_6,_7).


adjs([_1|_2],_3,_4,_5,_6) :-
   pre_adj(_1,_3,_7,_5,_8),
   adjs(_2,_7,_4,_8,_6).
adjs([],_1,_1,_2,_2).


pre_adj(_1,_2,_3,_4,_5) :-
   adj(_6,_1,_2,_3,_4,_5).
pre_adj(_1,_2,_3,_4,_5) :-
   sup_phrase(_1,_2,_3,_4,_5).


sup_phrase(sup(most,_1),_2,_3,_4,_5) :-
   sup_adj(_1,_2,_3,_4,_5).
sup_phrase(sup(_1,_2),_3,_4,_5,_6) :-
   sup_adv(_7,_3,_8,_5,_9),
   adj(quant,_2,_8,_4,_9,_6).


comp_phrase(comp(_1,_2,_3),_4,_5,_6,_7,_8) :-
   comp(_1,_2,_5,_9,_7,_10),
   np_no_trace(_11),
   prep_case(_12),
   np(_3,_13,_12,_14,compl,_11,_4,_9,_6,_10,_8).


comp(_1,_2,_3,_4,_5,_6) :-
   comp_adv(_1,_3,_7,_5,_8),
   adj(quant,_2,_7,_9,_8,_10),
   terminal(than,_9,_4,_10,_6).
comp(more,_1,_2,_3,_4,_5) :-
   rel_adj(_1,_2,_6,_4,_7),
   terminal(than,_6,_3,_7,_5).
comp(same,_1,_2,_3,_4,_5) :-
   terminal(as,_2,_6,_4,_7),
   adj(quant,_1,_6,_8,_7,_9),
   terminal(as,_8,_3,_9,_5).


relative(_1,[_2],_3,_4,_5,_6,_7,_8,_9) :-
   is_pred(_3),
   rel_conj(_1,_10,_2,_5,_6,_7,_8,_9).
relative(_1,[],_2,_3,_3,_4,_4,_5,_5).


rel_conj(_1,_2,_3,_4,_5,_6,_7,_8) :-
   rel(_1,_9,_10,_5,_11,_7,_12),
   rel_rest(_1,_2,_9,_3,_10,_4,_11,_6,_12,_8).


rel_rest(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10) :-
   conj(_2,_11,_3,_12,_4,_7,_13,_9,_14),
   rel_conj(_1,_11,_12,_6,_13,_8,_14,_10).
rel_rest(_1,_2,_3,_3,_4,_4,_5,_5,_6,_6).


rel(_1,rel(_2,_3),_4,_5,_6,_7,_8) :-
   open(_5,_9,_7,_10),
   variable(_1,_2,_9,_11,_10,_12),
   s(_3,_13,_11,_14,_12,_15),
   trace0(_16),
   minus(_13,_16,_4),
   close(_14,_6,_15,_8).


variable(_1,_2,_3,_4,_5,x(gap,nonterminal,np(np(_1,wh(_2),[]),_1,_6,_7,_8,_9,_10),_11)) :-
   terminal(that,_3,_4,_5,_11),
   trace0(_9,_10).
variable(_1,_2,_3,_4,_5,x(gap,nonterminal,np(_6,_7,_8,_9,_10,_11,_12),_13)) :-
   wh(_2,_1,_6,_7,_8,_3,_4,_5,_13),
   trace0(_11,_12).
variable(_1,_2,_3,_4,_5,x(gap,nonterminal,pp(pp(_6,_7),compl,_8,_9),_10)) :-
   prep(_6,_3,_11,_5,_12),
   wh(_2,_1,_7,_13,_14,_11,_4,_12,_10),
   trace0(_8,_9),
   compl_case(_14).


wh(_1,_2,np(_2,wh(_1),[]),_2,_3,_4,_5,_6,_7) :-
   rel_pron(_8,_4,_5,_6,_7),
   role(_8,decl,_3).
wh(_1,_2,np(_3,_4,[pp(_5,_6)]),_3,_7,_8,_9,_10,_11) :-
   np_head0(_4,_3,_12+common,_8,_13,_10,_14),
   prep(_5,_13,_15,_14,_16),
   wh(_1,_2,_6,_17,_18,_15,_9,_16,_11).
wh(_1,_2,_3,_4,_5,_6,_7,_8,_9) :-
   whose(_1,_2,_6,_10,_8,_11),
   s_all(_12),
   np(_3,_4,_5,def,subj,_12,_13,_10,_7,_11,_9).


reduced_relative(_1,_2,_3,_4,_5,_6,_7,_8) :-
   is_pred(_3),
   reduced_rel_conj(_1,_9,_2,_4,_5,_6,_7,_8).


reduced_rel_conj(_1,_2,_3,_4,_5,_6,_7,_8) :-
   reduced_rel(_1,_9,_10,_5,_11,_7,_12),
   reduced_rel_rest(_1,_2,_9,_3,_10,_4,_11,_6,_12,_8).


reduced_rel_rest(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10) :-
   conj(_2,_11,_3,_12,_4,_7,_13,_9,_14),
   reduced_rel_conj(_1,_11,_12,_6,_13,_8,_14,_10).
reduced_rel_rest(_1,_2,_3,_3,_4,_4,_5,_5,_6,_6).


reduced_rel(_1,reduced_rel(_2,_3),_4,_5,_6,_7,_8) :-
   open(_5,_9,_7,_10),
   reduced_wh(_1,_2,_9,_11,_10,_12),
   s(_3,_13,_11,_14,_12,_15),
   trace0(_16),
   minus(_13,_16,_4),
   close(_14,_6,_15,_8).


reduced_wh(_1,_2,_3,_4,_5,x(nogap,nonterminal,np(np(_1,wh(_2),[]),_1,_6,_7,_8,_9,_10),x(nogap,nonterminal,verb_form(be,pres+fin,_1,main),x(nogap,nonterminal,neg(_11,_12),x(nogap,nonterminal,pred(_12,_13,_14),_15))))) :-
   neg(_16,_12,_3,_17,_5,_18),
   pred(_12,_13,_14,_17,_4,_18,_15),
   trace0(_9,_10),
   subj_case(_6).
reduced_wh(_1,_2,_3,_4,_5,x(nogap,nonterminal,np(np(_1,wh(_2),[]),_1,_6,_7,_8,_9,_10),x(nogap,nonterminal,verb(_11,_12,_13,_14),_15))) :-
   participle(_11,_13,_14,_3,_4,_5,_15),
   trace0(_9,_10),
   subj_case(_6).
reduced_wh(_1,_2,_3,_4,_5,x(nogap,nonterminal,np(_6,_7,_8,_9,_10,_11,_12),x(gap,nonterminal,np(np(_1,wh(_2),[]),_1,_13,_14,_15,_16,_17),_18))) :-
   s_all(_19),
   subj_case(_8),
   verb_case(_13),
   np(_6,_7,_20,_9,subj,_19,_21,_3,_4,_5,_18),
   trace0(_11,_12),
   trace0(_16,_17).


verb(_1,_2,_3,_4,_5,_5,_6,_7) :-
   virtual(verb(_1,_2,_3,_4),_6,_7).
verb(verb(_1,_2,_3+fin,_4,_5),_6,_7,_2,_8,_9,_10,_11) :-
   verb_form(_12,_3+fin,_6,_13,_8,_14,_10,_15),
   verb_type(_12,_16),
   neg(_16,_5,_14,_17,_15,_18),
   rest_verb(_13,_12,_1,_2,_4,_17,_9,_18,_11),
   verb_type(_1,_7).


rest_verb(aux,have,_1,_2,[perf|_3],_4,_5,_6,_7) :-
   verb_form(_8,past+part,_9,_10,_4,_11,_6,_12),
   have(_8,_1,_2,_3,_11,_5,_12,_7).
rest_verb(aux,be,_1,_2,_3,_4,_5,_6,_7) :-
   verb_form(_8,_9,_10,_11,_4,_12,_6,_13),
   be(_9,_8,_1,_2,_3,_12,_5,_13,_7).
rest_verb(aux,do,_1,active,[],_2,_3,_4,_5) :-
   verb_form(_1,inf,_6,_7,_2,_3,_4,_5).
rest_verb(main,_1,_1,active,[],_2,_2,_3,_3).


have(be,_1,_2,_3,_4,_5,_6,_7) :-
   verb_form(_8,_9,_10,_11,_4,_12,_6,_13),
   be(_9,_8,_1,_2,_3,_12,_5,_13,_7).
have(_1,_1,active,[],_2,_2,_3,_3).


be(past+part,_1,_1,passive,[],_2,_2,_3,_3).
be(pres+part,_1,_2,_3,[prog],_4,_5,_6,_7) :-
   passive(_1,_2,_3,_4,_5,_6,_7).


passive(be,_1,passive,_2,_3,_4,_5) :-
   verb_form(_1,past+part,_6,_7,_2,_3,_4,_5),
   verb_type(_1,_8),
   passive(_8).
passive(_1,_1,active,_2,_2,_3,_3).


participle(verb(_1,_2,inf,_3,_4),_5,_2,_6,_7,_8,_9) :-
   neg(_10,_4,_6,_11,_8,_12),
   verb_form(_1,_13,_14,_15,_11,_7,_12,_9),
   participle(_13,_2,_3),
   verb_type(_1,_5).


passive(_1+trans).
passive(_1+ditrans).


participle(pres+part,active,[prog]).
participle(past+part,passive,[]).


close(_1,_1,_2,_3) :-
   virtual(close,_2,_3).


open(_1,_1,_2,x(gap,nonterminal,close,_2)).


verb_args(_1+ _2,_3,_4,_5,_6,_7,_8,_9,_10) :-
   advs(_4,_11,_12,_7,_13,_9,_14),
   verb_args(_2,_3,_11,_5,_6,_13,_8,_14,_10).
verb_args(trans,active,[arg(dir,_1)],_2,_3,_4,_5,_6,_7) :-
   verb_arg(np,_1,_3,_4,_5,_6,_7).
verb_args(ditrans,_1,[arg(_2,_3)|_4],_5,_6,_7,_8,_9,_10) :-
   verb_arg(np,_3,_11,_7,_12,_9,_13),
   object(_2,_4,_11,_6,_12,_8,_13,_10).
verb_args(be,_1,[void],_2,_2,_3,_4,_5,_6) :-
   terminal(there,_3,_4,_5,_6).
verb_args(be,_1,[arg(pred,_2)],_3,_4,_5,_6,_7,_8) :-
   pred_conj(_9,_2,_4,_5,_6,_7,_8).
verb_args(be,_1,[arg(dir,_2)],_3,_4,_5,_6,_7,_8) :-
   verb_arg(np,_2,_4,_5,_6,_7,_8).
verb_args(have,active,[arg(dir,_1)],_2,_3,_4,_5,_6,_7) :-
   verb_arg(np,_1,_3,_4,_5,_6,_7).
verb_args(_1,_2,[],_3,_3,_4,_4,_5,_5) :-
   no_args(_1).


object(_1,_2,_3,_4,_5,_6,_7,_8) :-
   adv(_9),
   minus(_9,_3,_10),
   advs(_2,_11,_10,_5,_12,_7,_13),
   obj(_1,_11,_3,_4,_12,_6,_13,_8).


obj(ind,[arg(dir,_1)],_2,_3,_4,_5,_6,_7) :-
   verb_arg(np,_1,_3,_4,_5,_6,_7).
obj(dir,[],_1,_1,_2,_2,_3,_3).


pred_conj(_1,_2,_3,_4,_5,_6,_7) :-
   pred(_8,_9,_10,_4,_11,_6,_12),
   pred_rest(_1,_9,_2,_10,_3,_11,_5,_12,_7).


pred_rest(_1,_2,_3,_4,_5,_6,_7,_8,_9) :-
   conj(_1,_10,_2,_11,_3,_6,_12,_8,_13),
   pred_conj(_10,_11,_5,_12,_7,_13,_9).
pred_rest(_1,_2,_2,_3,_3,_4,_4,_5,_5).


verb_arg(np,_1,_2,_3,_4,_5,_6) :-
   s_all(_7),
   verb_case(_10),
   np(_1,_9,_10,_11,compl,_7,_2,_3,_4,_5,_6).


advs([_1|_2],_3,_4,_5,_6,_7,_8) :-
   is_adv(_4),
   adverb(_1,_5,_9,_7,_10),
   advs(_2,_3,_4,_9,_6,_10,_8).
advs(_1,_1,_2,_3,_3,_4,_4).


adj_phrase(_1,_2,_3,_4,_5,_6) :-
   adj(_7,_1,_3,_4,_5,_6),
   empty(_2).
adj_phrase(_1,_2,_3,_4,_5,_6) :-
   comp_phrase(_1,_2,_3,_4,_5,_6).


no_args(trans).
no_args(ditrans).
no_args(intrans).


conj(conj(_1,_2),conj(_1,_3),_4,_5,conj(_1,_4,_5),_6,_7,_8,_9) :-
   conj(_1,_2,_3,_6,_7,_8,_9).


noun(_1,_2,_3,_4,_5,_6) :-
   terminal(_7,_3,_4,_5,_6),
   noun_form(_7,_1,_2).


adj(_1,adj(_2),_3,_4,_5,_6) :-
   terminal(_2,_3,_4,_5,_6),
   adj(_2,_1).


prep(prep(_1),_2,_3,_4,_5) :-
   terminal(_1,_2,_3,_4,_5),
   prep(_1).


rel_adj(adj(_1),_2,_3,_4,_5) :-
   terminal(_6,_2,_3,_4,_5),
   rel_adj(_6,_1).


sup_adj(adj(_1),_2,_3,_4,_5) :-
   terminal(_6,_2,_3,_4,_5),
   sup_adj(_6,_1).


comp_adv(less,_1,_2,_3,_4) :-
   terminal(less,_1,_2,_3,_4).
comp_adv(more,_1,_2,_3,_4) :-
   terminal(more,_1,_2,_3,_4).


sup_adv(least,_1,_2,_3,_4) :-
   terminal(least,_1,_2,_3,_4).
sup_adv(most,_1,_2,_3,_4) :-
   terminal(most,_1,_2,_3,_4).


rel_pron(_1,_2,_3,_4,_5) :-
   terminal(_6,_2,_3,_4,_5),
   rel_pron(_6,_1).


name(_1,_2,_3,_4,_5) :-
   opt_the(_2,_6,_4,_7),
   terminal(_1,_6,_3,_7,_5),
   name(_1).


int_art(_1,plu,quant(same,wh(_1)),_2,_3,_4,_5) :-
   terminal(how,_2,_6,_4,_7),
   terminal(many,_6,_3,_7,_5).
int_art(_1,_2,_3,_4,_5,_6,_7) :-
   terminal(_8,_4,_5,_6,_7),
   int_art(_8,_1,_2,_3).


int_pron(_1,_2,_3,_4,_5) :-
   terminal(_6,_2,_3,_4,_5),
   int_pron(_6,_1).


adverb(adv(_1),_2,_3,_4,_5) :-
   terminal(_1,_2,_3,_4,_5),
   adverb(_1).


poss_pron(pronoun(_1),_2+ _3,_4,_5,_6,_7) :-
   terminal(_8,_4,_5,_6,_7),
   poss_pron(_8,_1,_2,_3).


pers_pron(pronoun(_1),_2+ _3,_4,_5,_6,_7,_8) :-
   terminal(_9,_5,_6,_7,_8),
   pers_pron(_9,_1,_2,_3,_4).


quantifier_pron(_1,_2,_3,_4,_5,_6) :-
   terminal(_7,_3,_4,_5,_6),
   quantifier_pron(_7,_1,_2).


context_pron(prep(in),place,_1,_2,_3,_4) :-
   terminal(where,_1,_2,_3,_4).
context_pron(prep(at),time,_1,_2,_3,_4) :-
   terminal(when,_1,_2,_3,_4).


number(nb(_1),_2,_3,_4,_5,_6) :-
   terminal(_7,_3,_4,_5,_6),
   number(_7,_1,_2).


terminator(_1,_2,_3,_4,_5) :-
   terminal(_6,_2,_3,_4,_5),
   terminator(_6,_1).


opt_the(_1,_1,_2,_2).
opt_the(_1,_2,_3,_4) :-
   terminal(the,_1,_2,_3,_4).


conj(_1,list,list,_2,_3,_4,_5) :-
   terminal(',',_2,_3,_4,_5).
conj(_1,list,end,_2,_3,_4,_5) :-
   terminal(_1,_2,_3,_4,_5),
   conj(_1).


loc_pred(_1,_2,_3,_4,_5) :-
   terminal(_6,_2,_3,_4,_5),
   loc_pred(_6,_1).
