Key things learnt from exam mistakes Flashcards

(7 cards)

1
Q

difference between concrete and abstract

A

Concrete syntax is the one the programmer must know to write their programs
Defined by a grammar

Abstract syntax - describes structure of program used by compiler to check types , generate codes …

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe the main differences between stack-dynamic and heap-dynamic variables.

A


The main difference is in the way the variables are allocated and deallocated. Stack dynamic
variables are created in the stack when the corresponding block of code is executed, and deallocated at the end of the execution of the block. This class of variables includes for example the
local variables declared in subprograms, which are allocated in the stack when the subprogram
is called and deallocated once the control returns to the caller.
Heap dynamic variables are created in the heap, when a command triggering the allocation is
executed (for example a ”new” command). They are deallocated either explicitly (with deallocation commands) or implicitly (by the garbage collector) when they are no longer needed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

substitiution

A

partial mapping from variables to terms with a finite domain that is, only a finite
number of variables are affected, the rest of the variables map to themselves

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

monomorphic

A

Every expression has at most one type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

polymorphic

A

every expression has more than one type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

operational semantics

A

Operational semantics is a kind of formal semantics, where the meaning of a program is described
by giving the computation steps required to execute a program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly