Programming Languages Chapter 1/3

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

What is an ambiguous grammar?

A grammar that generates a sentential form for which there are two or more distinct parse trees

What is an assertion in axiomatic semantics?

Describes the constraints on the program variables at that point in the program.

Which is the most popular markup language for Web development?

HTML

Why is the von Neumann bottleneck important?

keeps us thinking in a word-at-a-time terms in much the same way the computer's bottleneck does

What is a metalanguage?

A language that is used to describe another language

Why is the VAX instruction design orthogonal?

Because the instruction for 32 bit integer addition of the farm where each of the op i's can refer to either a register or a memory location.

Which is the first successful high-level programming language for business?

COBOL

Why is a list of programming language evaluation criteria for the development of software controversial?

Criteria is better precisely defined nor exactly measurable

Which programming language for scientific applications was the first to be used successfully?

Forton

When can the parse tree be called fully attributed?

If all the attribute values in the parse tree have been computed

Why is it useful for a programmer to have the ability to learn new languages, even though he or she may have a good knowledge of a number of programming languages?

Increased capacity to express ideas, better understanding of the significance of implementing, better use of languages already known, overall advancement of computing

In which programming language were most of the AI applications developed prior to 1990?

LISP

What are the three fundamental features of an object-oriented programming language?

Polymorphism, inheritance, and encapsulation

In denotational semantics, what are the syntactic and semantic domains?

The domain is called the syntactic domain, because it is syntactic structures that are mapped. The range is called the semantic domain.

What is the weakest precondition?

The least restrictive precondition that will guarantee the validity of the associated postcondition.

What is meant by decorating a parse tree?

The process of computing the attribute values of a parse tree.

Which part of an inference rule is the antecedent?

The top part of an inference rule.

What is stored in the state of a program for denotational semantics?

The values of all of the program's variables.

What are the three general methods of implementing a programming language?

Three general methods of implementing a programming language are compilation, pure interpretation, and hybrid implementation.

When is a function called a predicate transformer?

When it takes a predicate, or assertion, as a parameter and returns another predicate.

Which produces faster program execution, a compiler or a pure interpreter?

A compiler will produce faster program execution due to the fact that translating high level language to machine code is substantially more complex.

What is an inference rule?

A method of inferring the truth of one assertion on the basis of the values of other assertions.

What two things must be defined for each language entity in order to construct a denotational description of the language?

Both a mathematical object and a function that maps instances of that language entity onto instances of the mathematical object.

How does the execution of a machine code program on a von Neumann architecture computer occur?

By 1950, the basic architecture of digital computers had been established (and described nicely in John von Neumann's EDVAC report). A computer's machine language is a reflection of its architecture, with its assembly language adding a thin layer of abstraction for the purpose of making easier the task of programming. When FORTRAN was being designed in the mid to late 1950's, one of the prime goals was for the compiler to generate code that was as fast as the equivalent assembly code that a programmer would produce "by hand". To achieve this goal, the designers —not surprisingly— simply put a layer of abstraction on top of assembly language, so that the resulting language still closely reflected the structure and operation of the underlying machine. To have designed a language that deviated greatly from that would have been to make the compiler more difficult to develop and less likely to produce fast-running machine code.

What is the use of intrinsic attributes?

Can be used to compute the remaining attribute values.

Why does too much orthogonality cause problems?

Intuition leads one to ascribe certain advantages to orthogonality: the reduction in the number of special rules or exceptions to rules should make a language easier "to describe, to learn, and to implement" — in the words of the Algol 68 report. On the other hand, strict application of the orthogonality principle may lead to constructs which are conceptually obscure when a rule is applied to a context in an unusual combination. Likewise the application of orthogonality may extend the power and generality of a language beyond that required for its purpose, and thus may require increased conceptual ability on the part of those who need to learn and use it.

Give an example of a logical pretest loop.

Msl and Mb, that map statement lists and states to states and Boolean expressions to Boolean values (or error), respectively.

Explain the use of meta symbols in EBNFs.

Notational tools and not terminal symbols in the syntactic entities they help describe . These include brackets, braces, and parentheses in the EBNF extensions.

How does the overall simplicity of a programming language affect its readability?

Number of basic constructs/features, feature multiplicity, operator overloading.

What are the advantages in implementing a language with a pure interpreter?

One of the advantages of implementing a language with a pure interpreter is easy implementation of many source-level debugging operations, because all run-time errors can refer to the source-level units. An example of this is an array index is found to be out of rang.

On what branch of mathematics is denotational semantics based?

Recursive function theory.

What language was the first to support the three fundamental features of object-oriented programming?

Smalltalk

How is the total cost of a programming language calculated?

Smalltalk, developed by Goldberg and Robson in 1989.

What is the purpose of a predicate function?

States the static semantic rules of the language and associated with grammar rules.

Explain how "writability" is used as a measure of how easily a language can be used to create programs.

The easier a program is to write, the more likely it is to be correct. Readability affects writability in both development and maintenance phases of the software cycle.

Why is too much orthogonality a detriment to "writability"?

Too much orthogonality can be detrimental: if all combinations are meaningful, errors are difficult to detect

How are programming languages formally defined?

Two distinct ways: by recognition and by generation

What two programming language deficiencies were discovered as a result of the research in software development in the 1970s?

Two programming language deficiencies were discovered as a result of the research in software development in the 1970s were called top-down design and stepwise refinement.

What is type checking?

Type checking is a program analysis that verifies something about the types that are used in the program

In what fundamental way do operational semantics and denotational semantics differ?

Unlike operational semantics, denotational semantics does not model the step- by-step computational processing of programs.

What is a left-recursive grammar?

When a grammar rule has its LHS also appearing at the beginning of its RHS, the rule is said to be left recursive

How is the order of evaluation of attributes determined for the trees of a given attribute grammar?

With the construction of a dependency graph to show all attribute dependencies.

What does a linker do?

a program used with a compiler or assembler to provide links to the libraries needed for an executable program.

In which form is the programming language syntax commonly described?

by context-free grammars.

What is the use of the well-definedness criterion?

the completeness and precision of the language's official defining document

What is an example of two language design criteria that are in direct conflict with each other?

the ease with which programs that work on one platform can be modified to work on another. This is strongly influenced by to what degree a language is standardized.

What role does the symbol table play in a compiler?

the symbol table serves as a database for the compilation process in a compiler.


Kaugnay na mga set ng pag-aaral

Ch. 27 - Community Mental Health Nursing

View Set

Chapter 1 (Part #1): The Life-Span Perspective

View Set

Psych Exam 1 - Ch. 32 (Serious Mental Illness)

View Set

Medical Terminology: Suffix Meanings

View Set

Chapter 8: Fluid and Electrolyte Management + Chapter 44: Diabetic Emergencies Questions & Answers

View Set

Practice - Introduction to Excel

View Set

Physical science moles Chapter 8

View Set