hey every one

i'm new here i have visit this forum many times but today i just register i have a big big problem >__< i try to solve it but i can't

its about the The Predicate Calculus

this is its rule

Every atomic sentence is a sentence
If s is a sentence, then so is its negation, Øs.
If s1 and s2 are sentences, then so is their conjunction, s1 Ù s2.
If s1 and s2 are sentences, then so is their disjunction, s1 Ú s2.
If s1 and s2 are sentences, then so is their implication, s1 Þ s2.
If s1 and s2 are sentences, then so is their equivalence, s1 = s2.
If X is a variable and s a sentence, then " X s is a sentence.
If X is a variable and s a sentence, then \$ X s is a sentence.

and the qustion is to transfer this to c++ code

function verify_sentence(expression)
begin
case
expression is an atomic sentence:return SUCCESS

expression is of the form QXs, where Q is either  or
, X is a variable,
if verify_sentence(s) returns SUCCESS
then return SUCCES
else return FAIL;

expression is of the form s:
if verify_sentence(s) returns SUCCESS
then return SUCCES
else return FAIL;

expression is of the form s1 op s2, where op is a
binary logical operator:
if verify_sentence(s1) return SUCCESS and
verify_sentence(s2) return SUCCESS
then return SUCCESS
else return FAIL;
otherwise : return FAIL
end
end.

i belive we have to solve it by switch but i don't understand how can we make it , it have to many complex cases

3
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by lovely ari

What are you trying to do... your entire post doesn't make a lick of sense.

You need to clearly define terms, such as "sentence", "atomic sentence", "conjunction", etc. Don't just assume we know what those terms mean.

sorry for that friend i"m really confused ><

i attach a slide show explain it

thank you for your help ^,^

Attachments
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.