//concerns the portrayal of parse tree hubs for articulations made…

Question Answered step-by-step //concerns the portrayal of parse tree hubs for articulations made… //concerns the portrayal of parse tree hubs for articulationsmade out of number constants, identififiers, and whole number administrators for expansion,deduction, increase and division. In a typeless language, like BCPL,every hub can be executed as a vector whose fifirst component holds a whole numberdistinguishing the hub administrator. The size of the vector and the sorts of significant worth held indifferent components then relies upon this hub administrator.(a) Complete the portrayal of how you would address such whole number articulationsin a typeless language. [5 marks](b) Suggest how you would address such number articulations in C and either MLor on the other hand Java. [10 marks](c) Brieflfly talk about the overall benefits of your C information structure contrasted and thatutilized in the typeless methodology. [5 marks]6 Compiler Construction(a) Assuming a Java type is given to every variable, express a technique by which anover-burden administrator, (for example, +,- and so forth) in a Java program not entirely set in stoneto be an int, genuine or other administrator. [3 marks](b) Explain, involving pseudo-code as proper, how to change over a sentence structure tree intostack code, for example, that utilized in the JVM. For the reasons for this inquiry, youjust need consider trees addressing assemblages of void-returning capacities, andthese bodies just as comprising of a rundown of proclamations of the structure int x = e;or on the other hand x = e; where x reaches over factors and e over articulations; articulationscontain factors, number constants, the parallel administrator + and static techniquesummons. [10 marks](c) Show how an arrangement of straightforward stack code guidelines, for example, those utilizedin your response to part (b) above, can be converted into an arrangement ofdirections for a register-situated design of your decision, for instanceARM or Pentium. [7 marks]5Image transcription textWrite detailed Java code (or Java-like code) to implement a new array-list member method, called printList(),for the following specifications: Method printList() print all elements in the list from first element(head) to lastelement(tail). But it must be loop with iterator. –> It means you cannot use loop with normal ind… Show more… Show more[TURN OVERCST.2002.5.67 Prolog for Artifificial Intelligence(a) Give a straightforward defifinition of the Prolog predicate dfx that can perform emblematicdifffferentiation concerning the variable x of articulations made out ofwhole numbers (for example 0, 1, . . .), representative constants (for example a, b, . . .), representative factors(for example x, y, . . .) and the administrators +, – and *, for expansion, deduction andincrease. The fifirst contention of dfx is the articulation to difffferentiatewhat’s more, the subsequent contention is the outcome. Your defifinition need not play out anysimplifification of the outcome. [6 marks](b) Trace the execution of the call: dfx(x*x-2, R). [2 marks](c) Now adjust your defifinition with the goal that it simplififies the outcome by the applicationsof revamping rules, for example, 1*x?x and x-0?x. [8 marks](d) Discuss how much, if any, both of your predicates could be utilized tocoordinate an articulation. [4 marks]8 Databases(a) Describe the social model of information. [6 marks](b) Explain the accompanying ideas in social information bases:(I) substance honesty limitation; [1 mark](ii) unfamiliar key and how it can indicate a referential honesty limitationbetween two relations; [4 marks](iii) semantic uprightness requirement. [1 mark](c) (I) What is a practical reliance? [1 mark](ii) Defifine Boyce-Codd Normal Form (BCNF). [3 marks](iii) Defifine Third Normal Form (3NF). [3 marks](iv) What is the connection among BCNF and 3NF? [1 mark]6CST.2002.5.7Area C9 Semantics of Programming Languages(a) The whole number articulationseof a C-like language take the structuree ::= n | x | x++ | ++x | e + e, where n ranges over whole number constants andx over number capacity factors. The articulation x++ returns the worth put awayin the whole number variable x and afterward increases the put away worth by one; though++x fifirst increases the put away worth by one and afterward brings it back. Expectinga left-to-right assessment request, give a functional semantics for every one of thesearticulations, as an assessment connection h s, ei ? hs0 , ni , where s, s0range over states which are fifinite capacities from whole number stockpiling factors tonumbers. [5 marks](b) The orders (explanations) c of this equivalent language take the structurec ::= x = e | x += e | c;c. The fifirst structure is task and the latter issequencing; the order x += e assesses e, adds the outcome to the worthput away in x and stores the outcome there. Give a functional semantics for theseorders as an assessment connection h s, ci ? s0 (where s, s0 are asabove). [4 marks](c) Defifine the thought of semantic proportionality for these articulations and orders.[3 marks](d) For every one of the accompanying sets of articulations or orders, state, withjustifification, if they are semantically same.(I) ++x and x++ + 1[2 marks](ii) x = ++x and x = x++[2 marks](iii) x = ++x and x += 1[2 marks](iv) x += e and x = x + e, for any e[2 marks]7[TURN OVERCST.2002.5.810 Foundations of Functional Programming(a) Explain how a lambda-term can be changed over into a structure that utilizes just thecombinators S and K. [4 marks](b) Illustrate your technique by recording a lambda term for every one of the accompanyingcapacities and afterward communicating it concerning just S and K.(I) fun I x = x(ii) fun B f g x = f (g x)(iii) fun C f x y = f y x(iv) fun A x y = y (x y)[4 imprints each]11 Logic and Proof(a) For every one of the accompanying formulae, state (with justifification) whether it issatisfifiable, legitimate or not one or the other:((Q ? R) ? Q) ? ¬Q[2 marks]((P ? Q) ? P) ? Q[2 marks]?xy [P(x, y) ? ?xy P(x, y)] [3 marks][?x (P(x) ? Q(x)) ? ?x P(x)] ? ?x Q(x) [3 marks](b) Brieflfly frame the semantics of fifirst-request rationale, taking as an illustration therecipe ?xy f(x, y) = f(y, x). [6 marks](c) Exhibit a model that satisfifies both of the accompanying formulae (a will be a consistent):?x g(x)6=a?xy [g(x) = g(y) ? x = y][4 marks]8CST.2002.5.912 Complexity Theory(a) Give an exact defifinition of what is implied by the proclamation that a choiceissue An is polynomial-time reducible to a choice issue B. [2 marks](b) Consider the accompanying three choice issues on diagrams.Associate — the assortment of diagrams G to such an extent that there is a way betweenany two vertices of G.Hamilton — the assortment of charts that contain a Hamiltonian cycle.non-3-variety — the assortment of diagrams that are not 3-colourable.?For every one of the accompanying assertions, state whether it is valid, misleading or anunsettled open inquiry. Offer a short justifification for your response.?(I) Connect is decidable by a polynomial time calculation.(ii) Hamilton is decidable by a polynomial time calculation.?(iii) non-3-variety is decidable by a polynomial time calculation.(iv) Connect is polynomial-time reducible to Hamilton.(v) Hamilton is polynomial-time reducible to non-3-variety./ Computer Science Engineering & Technology Object-Oriented Programming CSE 1325 Share QuestionEmailCopy link Comments (0)