Tuesday 14 October 2014

Assignment #3 (Concepts of Programming Languages Chapter 3 Review Questions)

Review Questions :
a=Answer

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

a. The mapping functions of a denotational semantics programming language specification, like all functions in math, have a domain and a range, the domain is called the syntactic domain, and the range is called the semantic domain.

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



a. The state of a program for denotational semantics is the value of all its current variable.

18. Which semantics approach is most widely known?


a. The Denotational semantics is the most widely known semantics approach.

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

a. objects and functions 


20. Which part of an inference rule is the antecedent? 
a. The antecedent is the top part of an inference rule.


21. What is a predicate transformer function? 

a. wp(statement, postcondition) = precondition A wp function is often called a predicate transformer, because it takes a predicate, or assertion, as a parameter and returns another predicate.


22. What does partial correctness mean for a loop construct? 

a. If loop termination can be shown, the axiomatic description of the loop is called total correctness. If the other conditions can be met but termination is not guaranteed, it is called partial correctness. computing the precondition for a while loop depends on finding a loop invariant, proving the correctness of programs with while loops using axiomatic semantics can be difficult.


23. On what branch of mathematics is axiomatic semantics based? 
a. Axiomatic semantics, thus named because it is based on mathematical logic.

24. On what branch of mathematics is denotational semantics based?

a. mathematical objects (called denotations). 

No comments:

Post a Comment