1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Simplest algorithm for computing the resultant of a boolean expression?

  1. Nov 21, 2011 #1
    hi,

    let's take something simple, for example:

    (a>b) && ((b>c) && c>d) || (d > c)

    Intuitively, it's easy to work out given the values of a, b, c and d and just evaluating the brackets in order of precedence.

    i.e.

    Is b > c?? then is c > d
    Then in addition to the above answer being true is a > b?
    Then despite the earlier answer is d > c?
    If true return true, if false return false.

    But surely there is an elegant, simple algorithm for working this out computationally?

    Could you for example take each expression, number them in terms of their evaluation step then evaluate in n steps based on [some factor] to get the answer?

    i.e.

    1) b>c, and then because of [factor], compute &&
    2) c>d, and then because of [factor], compute &&
    3) a>b, and then because of [factor], compute ||
    4) d > c
    5) answer

    I know the factor is sign-right or sign-left of the expression and it could be used to create an algorithm.

    But has anybody got anything more elegant?
     
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted



Similar Discussions: Simplest algorithm for computing the resultant of a boolean expression?
  1. Boolean functions (Replies: 13)

Loading...