|
Reduce the given logic expression into its simplest form:-
Here means the complement of A and so on.
My answer is :-
The answer provided by to me is:-
I am not able to understand any flaw in my answer. Kindly help.
NOTE:- I was required to calculate the...
Started by lakshya_iit on
, 5 posts
by 2 people.
Answer Snippets (Read the full thread at artofproblemsolving):
Is my answer completely wrong or it there a step which... .
Just draw the Karnaugh Map correctly and you'll be done ! When I draw the K-map, I get 4 terms which I then go on reducing and reducing and get to my answer .
The answer is given to you is correct.
|
|
I'm trying to create a logic expression parser for expressions like: ((VariableA -> VariableB) AND NOT VariableC) The parser should be able to return, wheather the result is true or false for given values of variables.
Basicly the expressions will ...
Started by Adam on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
If you use.
Sure there are already tools that do this (logic evaluation), but I couldn't find any.
|
|
What is the best was to evaluate an expression like the following:
(A And B) Or (A And C) Or (Not B And C)
or
(A && B) || (A && C) || (!B && C)
At runtime, I was planning on converting the above expressions to the following:
(True And False) Or (True ...
Started by Bobby Ortiz - DotNetBob on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
Then create a suitable LambdaExpression....
If you're using .NET3.5 then you can parse the text and create an abstract sytax tree using the Expression classes.
Use something like ANTLR and reuse existing grammars.
You can write a simple interpreter/parser.
|
Ask your Facebook Friends
|
Can we put into a single regular expression , boolean logic : line starts with 'a' or 'b' . Question is triggered by using FileHelpers utility which does have a text box "Record Condition Selector" for "ExcludeIfMatchRegex" . Utility is written in C#....
Started by MicMit on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
How about this: ^[ab]
Having a hard time understanding you, but...if you're looking for a match if the string starts with "a" or "b", and a fail otherwise, you could do this:
^(a|b)(.+)$
Then, when you get the match's groups, the first group will be ... .
|
|
I am looking for an open source library in Java for parsing and building sql like expressions.
for example to evaluate validity of expressions like:
"(a = x or y ) and (b != z)"
in addition I want to have an API for building or extending expressions. ...
Started by LiorH on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Antlr is not pragmatic unless you have some basic parser knowledge. .
The grammatic looks very simple ( from here ) :P
Use script engine. .
I'm pretty sure you can have ANTLR do this for you .
|
|
So let's say I've got an expression like this:
((((e1) or (e2)) and (e3 or (e5 and e6)) and (e7)) or (e8))
I need to end up with a list of expressions (e1, e2, e3 etc) followed by and/or operators so that evaluating the list from left to right yields ...
Started by stu on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
You are on the right track with your thoughts about a parser, for indeed you need to parse (but not evaluate) the original expression, and then print it out in....
First off, what you are looking to do is convert infix notation to postfix notation .
|
|
How can I store logical expressions using a RDBMS?
I tag objects and would like to be able to build truth statements based on those tags. (These might be considered as virtual tags.)
Tags
new
for_sale
used
offer
Rule
second_hand_goods = (!new or used)...
Started by chillitom on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
<logic type....
Your second hand goods logic could be stored as...
Using SQL Server 2005 or higher you can also store this nicely in a single table .
This in the past is to use XML to define the logic as it handles nesting very well.
|
|
I have a need to evaluate user-defined logical expressions of arbitrary complexity on some PHP pages. Assuming that form fields are the primary variables, it would need to:
substitute"varibles" for form fields values; handle comparison operators, minimally...
Started by cletus on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Take a look at my infix to postfix example I think you could port it to PHP with relative ease .
Check create_function , it creates an anonymous function from the string parameters passed, I'm not sure about its performance, but it's very flexible.. .
|
|
Regex expressions seems cocumbersome, they always drive me mad when trying to build it up. And i end up asking for help. But once i am given the result it looks really coool. Gurus, is there a way to go about it to break it up.
Started by zapping on
, 11 posts
by 11 people.
Answer Snippets (Read the full thread at stackoverflow):
Actually, the fundamentals aren't that hard to grasp....
The reference there is also invaluable as are the explanations how the regex engine works behind the scenes .
Yuo can start with tutorials at Regular-Expressions.info which provide a good starting point .
|
|
In C#, given the two methods
bool Action1(object Data); bool Action2(object Data);
that are used in an if statement like this:
if ( Action1(Data) || (Action2(Data) ) { PerformOtherAction(); }
will Action2() still be called if Action1() returned true, ...
Started by Treb on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Action2() will only be called if Action1() returns false
This is conceptually similar to
if (Action1(Data)) { PerformOtherAction(); } else if (Action2(Data)) { PerformOtherAction(); }
No, C# support logical short-circuiting so if Action1 returned....
|