Java Programming Assingment
Write a program to implement a knowledge base and then given a statement it determines if the statement is true or false. In other words, you should implement TT-ENTAILS? function to determine if the knowledge base entails some sentence ‘alpha’. You should also include a function to print the whole knowledge base and the sentence you are testing for entailment in an infix notation format.
Your program should read knowledge base which is a collection of sentences in prefix notations, for example, see below:
(or a b)
(iff a (or b c))
(not b)
c
b
Observe the white spaces and how the sentences are represented. The symbols can be a combination of alphabets, numbers and _ characters only. Note that if the sentence contains only a symbol, the symbol should not be enclosed in the parenthesis.
This kind of knowledge base will be provided in a text file, therefore, your program must read from the text file and build a knowledge base.
In this program, we will consider five connectives: and, or, not, if, iff.
You should test your program on following KB:
(not P_1_1)
(iff B_1_1 (or P_1_2 P_2_1))
(iff B_2_1 (or P_1_1 (or P_2_2 P_3_1)))
B_2_1
(not B_1_1)
B_2_1
and for two alpha values:
P_1_2
(not P_2_1)
"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.
Discount Code: CIPD30
Click ORDER NOW..


