



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Instructions and problems for a midterm examination in the field of logic. The examination covers topics such as prime and composite numbers, edb predicates, dependency graph, and conjunctive queries. Students are required to construct well-founded models, prove inferences, and convert rules. The document also includes a reference to the gupta test.
Typology: Exams
1 / 5
This page cannot be seen from the preview
Don't miss anything!




CSA Midterm Examination Monday May pm
Directions
The exam is open book any written materials may b e used Answer all questions on the exam pap er itself The total numb er of p oints is You may make additional comments at the b ottoms of pages or at the end if you feel the need to clarify or justify your answers Do not forget to sign the pledge b elow
I acknowledge and accept the honor co de
Print your name here
Problem p oints Consider the following rules
pX intX X not cX cX intX pY dividesX Y X Y
Think of pX as meaning X is a prime and cX as X is comp osite The EDB predicate intX says that X is a p ositive integer and in practice it will hold a nite set of integers The EDB predicate div idesX Y means that Y evenly divides X
Supp ose that int f g and div ides is the exp ected relation on these four integers that is div ides f g If we instantiate these rules in all p ossible ways eliminate rules with a known false subgoal and then eliminate known true subgoals from the remaining rules we are left with the following
p not c c p p not c c p p not c c p c p
a In the table at the top of the next page construct the wellfounded mo del by the denition not the alternating xedp oint Indicate what inferences are made ab out the truth or falseho o d of pi and ci for i at each round
Round Positive Inferences Negative Inferences
b In the space b elow draw the dep endency graph for the instantiated atoms pi and ci for i
c Are the rules with the given EDB lo cally stratied If so tell what the strata are if not describ e an innite negative path
d Supp ose int contains the integers from to n and div ides contains all those pairs i j such that j divides i and i and j are integers b etween and n For what values of n will the rules and EDB b e lo cally stratied Explain briey
c Briey explain why your expression from b holds Hint The implication of disjunc tion logical OR can b e shown true by showing that the hyp othesis implies any one of the disjuncts
Problem p oints For the rules
pX Y Z aX Y Z pX Y Z pX Y W pY W Z
draw the rule goal graph starting with the goal pbf^ f^ in the space b elow
Problem p oints Convert the following rules
pX Y aX Y pX Y pX Z pZ Z pZ Y
into equivalent rules with rectied subgoals
Problem p oints For the query p Z apply a magicsets transformation to the following rules
r pX Y cX Y r pX Y aX U pU V bV W pW Y
You may use either the basic transformation or a simplied transformation that eliminates some supplementary predicates