I have the following simple expression parser:
expr(+(T,E))-->term(T),\"+\",expr(E). expr(T)-->term(T). term(*(F,T))-->factor(F),\"*\",term(T). ter
Can you provide a sample input?
I think this might work:
nat(N)-->number(N).
If that fails try:
nat(N)-->number(N),!.
The ! is a cut it stops the unification. You can read about it in books/tutorials.