""fp ask_askables(kbadded true while addedadded false added is true when an atom was added to fp this iteration for in kb clausesif head not in fp and all( in fp for in body)fp add( headadded true kb display( , head,"added to fp due to clause",creturn fp def ask_askables(kb)return {at for at in kb askables if yes(input("is "+at+true"))the following provides trivial unit testby default using the knowledge base triv_kblogicbottomup py -(continued from logicproblem import triv_kb def test(kb=triv_kbfixedpt {'i_am','i_think'})fp fixed_point(kbassert fp =fixedpt"kb gave result "+str(fpprint("passed unit test"if __name__ ="__main__"test( from logicproblem import elect elect max_display_level= give detailed trace fixed_point(electexercise it is not very user-friendly to ask all of the askables up-front implement ask-the-user so that questions are only asked if usefuland are not re-asked for exampleif there is clause ewhere and are askablec and only need to be asked if abd are all in fp and they have not been asked before askable only needs to be asked if the user says "yesto askable doesn' need to be asked if the user previously replied "noto this form of ask-the-user can ask different set of questions than the topdown interpreter that asks questions when encountered give an example where they ask different questions (neither set of questions asked is subset of the otherexercise this algorithm runs in time ( )where is the number of clausesfor bounded number of elements in the bodyeach iteration goes through each of the clausesand in the worst caseit will do an iteration for each clause it is possible to implement this in time (ntime by creating an index that maps an atom to the set of clauses with that atom in the body implement this what is its complexity as function of and bthe maximum number of atoms in the body of clauseversion june