From WspreadP@aol.com  Tue Oct 24 05:34:25 2000
Received: from imo-r12.mail.aol.com (imo-r12.mx.aol.com [152.163.225.66])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id FAA23438
	for <prolog@swi.psy.uva.nl>; Tue, 24 Oct 2000 05:34:25 +0200 (MET DST)
From: WspreadP@aol.com
Received: from WspreadP@aol.com
	by imo-r12.mx.aol.com (mail_out_v28.32.) id u.a0.b382d76 (3969)
	 for <prolog@swi.psy.uva.nl>; Mon, 23 Oct 2000 23:33:53 -0400 (EDT)
Message-ID: <a0.b382d76.27265d21@aol.com>
Date: Mon, 23 Oct 2000 23:33:53 EDT
Subject: Prolog help
To: prolog@swi.psy.uva.nl
MIME-Version: 1.0
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Mailer: Windows AOL sub 111

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  

