propositions and inference exercise it is possible to be asymptotically more efficient (in terms of the number of elements in bodythan the method in the previous question by noticing that each element of the body of clause only needs to be checked once for examplethe clause dneeds only be considered when is added to fp once is added to fpif is already in pf we know that can be added as soon as is added implement this what is its complexity as function of and bthe maximum number of atoms in the body of clause top-down proofs (with askablesprove(kbgoalis used to prove goal from knowledge basekbwhere goal is list of atoms it returns true if kb goal the indent is used when displaying the code (and doesn' need to have non-default valuelogictopdown py -top-down proof procedure for definite clauses from logicproblem import yes def prove(kbans_bodyindent="")"""returns true if kb |ans_body ans_body is list of atoms to be proved ""kb display( ,indent,'yes <-',join(ans_body)if ans_bodyselected ans_body[ select first atom from ans_body if selected in kb askablesreturn (yes(input("is "+selected+true")and prove(kb,ans_body[ :],indent+")elsereturn any(prove(kb,cl body+ans_body[ :],indent+"for cl in kb clauses_for_atom(selected)elsereturn true empty body is true the following provides simple unit test that is hard wired for triv_kblogictopdown py -(continued from logicproblem import triv_kb def test() prove(triv_kb,['i_am']assert "triv_kb proving i_am gave "+str( prove(triv_kb,['i_smell']assert not "triv_kb proving i_smell gave "+str( print("passed unit tests"if __name__ ="__main__"test(try from logicproblem import elect elect max_display_level= give detailed trace prove(elect,['live_w ']prove(elect,['lit_l ']version june