By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,559 Members | 1,150 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,559 IT Pros & Developers. It's quick & easy.

Short-Circuit Evaluation of Boolean Expressions

P: n/a
Hi,

I am looking for information on a data structure (and associated
algorithm) to do short-circuit evaluation of boolean expressions and
haven't found a single one even after googing for two days! Can anyone
point me to good resources (or implementations) that do this.
Basically is there any way to optimize a boolean expression expressed
in RPN (reverse polish notation)?

I want to implement the algorithm/data structure in C. If you have a
reference implementation can you please point me to it. I am sorry if
this is off topic for this group. Because I want a C implementaion I
posted here!

your help is highly appreciated
thanks
Andy
Nov 14 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
webposter <we***********@yahoo.com> spoke thus:
I am looking for information on a data structure (and associated
algorithm) to do short-circuit evaluation of boolean expressions and
I'm not sure what you're asking, but C by definition uses
short-circuit evaluation to evaluate boolean expressions, if that
helps you.
I want to implement the algorithm/data structure in C. If you have a
reference implementation can you please point me to it. I am sorry if
this is off topic for this group. Because I want a C implementaion I
posted here!


We can't help you figure out what the algorithm/data structures you
want are, but once you get those figured out, we can help you
implement them.

http://www.ungerhu.com/jxh/clc.welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
http://benpfaff.org/writings/clc/off-topic.html

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Nov 14 '05 #2

P: n/a
Groovy hepcat Christopher Benson-Manica was jivin' on Mon, 13 Sep 2004
13:26:54 +0000 (UTC) in comp.lang.c.
Re: Short-Circuit Evaluation of Boolean Expressions's a cool scene!
Dig it!
webposter <we***********@yahoo.com> spoke thus:
I am looking for information on a data structure (and associated
algorithm) to do short-circuit evaluation of boolean expressions and


I'm not sure what you're asking, but C by definition uses
short-circuit evaluation to evaluate boolean expressions, if that
helps you.


I'm not certain because he's not too clear, but I think he is trying
to write an expression parser that has short circuit boolean
operators.

--

Dig the even newer still, yet more improved, sig!

http://alphalink.com.au/~phaywood/
"Ain't I'm a dog?" - Ronny Self, Ain't I'm a Dog, written by G. Sherry & W. Walker.
I know it's not "technically correct" English; but since when was rock & roll "technically correct"?
Nov 14 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.