Is there a way or an algorithm to convert DCG into normal definite clauses in Prolog?
I am a newbie in Prolog, and I am trying to understand how a grammar can be translated into a normal definite clause from a DCG. I understood that DCG notation is just syntactic sugar for normal definite clauses in Prolog. I started to depict some similarities between the normal definite grammars, and the DCGs, but failed to apply the same pattern, so I am asking is there some rules that I am missing or an algorithm of conversion that might work. Here is the grammar that I am working on, and here is what I did in order to translate that grammar: expr --> term, addterm. addterm --> []. addterm