Subject: Prolog help

From: [email-masked]
Date: Mon, 23 Oct 2000 23:33:53 EDT

To whomever can help,

    I'm trying to write a Prolog predicate definition that "balances" a 
string.  By balance, I mean it makes sure there are sufficient closing 
parentheses with respect to the number of opening parentheses and vice-versa. 
 
      For example,
    
    balanced("b(c)d(a(e))") would succeed and
      balanced("b(c)d(a(e)")  would fail

I know that the characters '(' and ')' have ASCII codes of 40 and 41 
respectively.  Any help would be much appreciated.
Thanks,
Ryan