Principles of Programming Languages – Semantics Vocabulary

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/53

flashcard set

Earn XP

Description and Tags

A set of 54 vocabulary flashcards summarizing key terms and definitions from the lecture on language semantics, scoping, memory, and assignment principles.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

54 Terms

1
New cards

Lexical Analysis

The compiler phase that converts raw bytes or characters into a stream of tokens.

2
New cards

Syntax Analysis

The phase that checks sequences of tokens for grammatical correctness and builds a parse tree.

3
New cards

Semantics

The meaning assigned to a parse tree; describes what a program actually does.

4
New cards

Preciseness

A desired property of a semantic definition ensuring it is exact and unambiguous.

5
New cards

Predictability

A property of semantics that guarantees consistent behavior across different executions and implementations.

6
New cards

Completeness

A semantic description covering every construct of a language with no gaps.

7
New cards

English Specification

A natural-language description of language rules, e.g., the 538-page C99 spec; readable but potentially ambiguous.

8
New cards

Reference Implementation

An authoritative interpreter or compiler whose behavior defines the language (e.g., pre-2011 Ruby MRI).

9
New cards

Formal Specification

A mathematically precise description of language semantics enabling proofs about programs.

10
New cards

C99 Specification

The extensive English document defining the C language as standardized in 1999.

11
New cards

Ruby MRI

Matz’s Ruby Interpreter, historically used as Ruby’s reference semantics before an official spec.

12
New cards

Abstract Semantics Transition Relation (F*)

A formal relation expressing how abstract program states transition during execution.

13
New cards

Declaration

A language construct that introduces a name and its attributes (type, storage class, etc.).

14
New cards

Implicit Declaration

Introduction of a construct without an explicit declaration statement (e.g., using a variable first in some languages).

15
New cards

Scope

The region of code where a declaration remains valid and can be referenced.

16
New cards

Static Scoping

Name resolution determined at compile time based on the program’s lexical structure.

17
New cards

Dynamic Scoping

Name resolution performed at run time using the call stack to find the most recent binding.

18
New cards

Block-level Scoping

A scoping rule where declarations are visible only within the enclosing { } block (e.g., C).

19
New cards

Function-level Scoping

A scoping rule where declarations are visible throughout the entire function body (e.g., JavaScript var).

20
New cards

Symbol Table

A data structure mapping names to declarations and attributes during compilation or execution.

21
New cards

Name Resolution

The process of linking a name occurrence to its corresponding declaration using scoping rules.

22
New cards

Function Signature

The set of elements used to disambiguate overloaded functions (name, parameter count/type, etc.).

23
New cards

Overloading

Defining multiple functions with the same name but different signatures (common in C++).

24
New cards

L-value

An expression that refers to a location and can appear on the left side of an assignment.

25
New cards

R-value

An expression that denotes a value; may not necessarily have an associated writable location.

26
New cards

Binding

The association between a name and a location (or sometimes a value).

27
New cards

Location

A storage cell capable of holding a value; identified by an address.

28
New cards

Value

An actual data element stored in or retrieved from a location.

29
New cards

Assignment Semantics

Rules that define how values are transferred between locations via the ‘=’ operator.

30
New cards

Address Operator (&)

Unary operator that produces the address of an l-value, yielding a pointer (T*).

31
New cards

Dereference Operator (*)

Unary operator that accesses or modifies the value at a given pointer address.

32
New cards

Pointer

A variable whose value is an address pointing to another location in memory.

33
New cards

Alias (Programming)

Two or more l-values referring to the same location, so updating one affects the others.

34
New cards

Dangling Reference

A reference that still points to a location after that location has been deallocated.

35
New cards

Garbage (Memory)

Heap-allocated memory that is unreachable by the program yet not freed.

36
New cards

Global Allocation

Memory reserved for the entire program duration, typically for global/static variables.

37
New cards

Stack Allocation

Automatic memory allocation tied to function calls and scopes, freed when out of scope.

38
New cards

Heap Allocation

Program-requested memory (e.g., malloc, new) that persists until explicitly deallocated.

39
New cards

Memory Deallocation

The act of releasing previously reserved heap memory so it may be reused.

40
New cards

Dangling Pointer after free

A pointer left pointing to freed heap memory, leading to undefined behavior if dereferenced.

41
New cards

Copy Semantics

Assignment behavior where the value from one location is copied into another.

42
New cards

Sharing Semantics

Assignment behavior where two names are made to share the same location.

43
New cards

malloc

A C standard library function that allocates a specified number of bytes on the heap and returns a pointer.

44
New cards

free

A C function that deallocates heap memory previously obtained via malloc, realloc, or calloc.

45
New cards

Enumeration Constant

A named integer value defined within an enum declaration in C/C++.

46
New cards

Macro

A preprocessor construct in C that performs textual substitution before compilation.

47
New cards

Tag (C Struct/Union/Enum)

The identifier that names a struct, union, or enum type in C.

48
New cards

Type (Programming)

A classification identifying a set of values and permissible operations (e.g., int, char*, Object).

49
New cards

Control Structure

A language construct that alters the flow of execution (if, while, for, etc.).

50
New cards

Exception

A run-time event signaling abnormal conditions, often handled with try-catch constructs.

51
New cards

Constant

A value that does not change during execution, often declared with const or literal notation.

52
New cards

Variable

A named storage location whose value may change during execution.

53
New cards

Operator

A symbol or keyword that performs an operation on operands (e.g., +, =, &).

54
New cards

Class

A blueprint for creating objects, encapsulating data and behavior in object-oriented languages.