/* active_to_passive/2 active_to_passive(+Active,-Passive) The predicate active_to_passive accepts the derivation of an active sentence and transforms it into the derivation of an analogous sentence in passive form. Example: active_to_passive(sentence(noun_phrase(article(the),noun(man)), verb_phrase(verb(hit), noun_phrase(article(the), noun(ball)))), D). returns D = sentence(noun_phrase(article(the),noun(ball)), verb_phrase(auxilliary(was), verb(hit), prep_phrase(prep(by), noun_phrase(article(the), noun(man))))) Warren Sack May 2017 */ active_to_passive(sentence(noun_phrase(A1,X1), verb_phrase(verb(X2), noun_phrase(A2,X3))), sentence(noun_phrase(A2,X3), verb_phrase(auxilliary(Aux), verb(X2), prep_phrase(prep(by), noun_phrase(A1,X1))))) :- conjugate_past_tense(X3,be,Aux). conjugate_past_tense(noun(N),Infinitive,PastTense) :- is_singular(N), singular_past_tense(Infinitive,PastTense). conjugate_past_tense(noun(N),Infinitive,PastTense) :- is_plural(N), plural_past_tense(Infinitive,PastTense). is_singular(ball). is_singular(man). is_plural(balls). is_plural(men). plural_past_tense(be,were). singular_past_tense(be,was).