FORMAL TRANSITION MODELS TRB CSI › Programming with C++ › formal transition models

FORMAL TRANSITION MODELS

Formal Transition Model என்பது ஒரு program execute ஆகும் போது, அதன் state ஒரு நிலைமையிலிருந்து மற்றொரு நிலைக்கு எப்படி மாறுகிறது என்பதை mathematical / formal rules மூலம் represent செய்யும் model. Simple Tamil: Program execute ஆகும்போது Cur…

Premium — locked Advanced 30 min 291 cards 52 programs 10 MCQs v2
This is a premium lesson. You can see the shape of every card — unlock to read them. Unlock

FORMAL TRANSITION MODELS…

Premium This card is part of the premium lesson. Unlock
Definition

Formal Transition Model என்பது ஒரு program execute ஆகும் போது, அதன் state ஒரு நிலைமையிலிருந்து மற்றொரு நிலைக்……

Premium This card is part of the premium lesson. Unlock
Definition

1. TRANSITION என்றால் என்ன?…

Premium This card is part of the premium lesson. Unlock
Definition

Transition = ஒரு state-இலிருந……

Premium This card is part of the premium lesson. Unlock
Program
Example
Program
Initially
Program
After executing
Program
New state
Explanation

Therefore: x = 5 ↓ x = x + 1 ……

Premium This card is part of the premium lesson. Unlock
List

1. STATE என்றால் என்ன?…

Premium This card is part of the premium lesson. Unlock
Definition

ஒரு குறிப்பிட்ட நேரத்தில் program-ன் variables, memory மற்றும் execution infor……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

int x = 10; int y = 20; Curre……

Premium This card is part of the premium lesson. Unlock
Explanation

இதனை mathematical form-ல்: σ = {x → 1……

Premium This card is part of the premium lesson. Unlock

STATE MAPPING

Explanation

State பொதுவாக: Variable → Value mapping ஆக பார்க்……

Premium This card is part of the premium lesson. Unlock

FORMAL TRANSITION

Explanation

State transition-ஐ formal-ஆக: σ → σ' என்று represent……

Premium This card is part of the premium lesson. Unlock
Explanation

After: σ' = {x → 6} Thus: σ →……

Premium This card is part of the premium lesson. Unlock

CONFIGURATION

Explanation

Formal semantics-ல் state மட்டும் இல்லாமல், தற்போது execute செய்ய வேண்டிய statement-ஐயும……

Premium This card is part of the premium lesson. Unlock

TRANSITION NOTATION

Explanation

A common notation: → Where:…

Premium This card is part of the premium lesson. Unlock
Explanation

C' = Remaining command σ' = New state Simple: Pro……

Premium This card is part of the premium lesson. Unlock

SIMPLE ASSIGNMENT TRANSITION

Program
Consider
Explanation

Before: σ = {x → 5} After: σ' = {x → 1……

Premium This card is part of the premium lesson. Unlock

EXPRESSION TRANSITION

Program
Example
Explanation

Step 1: 2 + 3 evaluate: 5 Ste……

Premium This card is part of the premium lesson. Unlock
Explanation

Then state update: x → 5 Flow……

Premium This card is part of the premium lesson. Unlock

TRANSITION SYSTEM

Definition

States மற்றும் அவற்றுக்கிடையிலான tra……

Premium This card is part of the premium lesson. Unlock
Explanation
General form

State ↓ Transition ↓ State A transition system……

Premium This card is part of the premium lesson. Unlock

FORMAL TRANSITION MODEL - COMPONENTS

List
Main components

1. State 2. Initial State 3. Transition ……

Premium This card is part of the premium lesson. Unlock
Explanation

Program execution ஆரம்பிக்கும……

Premium This card is part of the premium lesson. Unlock

FINAL STATE

Explanation

Program execution முடிவடைந்த ……

Premium This card is part of the premium lesson. Unlock
Program
Example
Program
Final

STATE TRANSITION SEQUENCE

Program
Example
Program
State 0
Program
State 1
Program
State 2
Program
Therefore
Explanation

S₂ {x=9}…

Premium This card is part of the premium lesson. Unlock
List

1. WHY FORMAL TRANSITION MODE……

Premium This card is part of the premium lesson. Unlock
Explanation

Programming language semantics natural language மட்டும் use செய்து describe செய்தால் ambiguity வரலாம். Formal……

Premium This card is part of the premium lesson. Unlock

OPERATIONAL SEMANTICS

Explanation

Formal transition models-க்கு ம……

Premium This card is part of the premium lesson. Unlock
Definition

Program statements execute ஆகும்போது machine state எப்படி change ஆகிறது என்பதை formal transition r……

Premium This card is part of the premium lesson. Unlock

OPERATIONAL SEMANTICS IDEA

Explanation
Program

+ State ↓ Execution Rule ↓ Ne……

Premium This card is part of the premium lesson. Unlock
Program
Example
Program
State
Output
Result

TWO IMPORTANT OPERATIONAL MODELS

Small-Step Semantics

Big-Step Semantics

இதனை மிகவும் முக்கியமாக படிக்……

Premium This card is part of the premium lesson. Unlock

SMALL-STEP SEMANTICS

Definition

Program execution-ஐ one small computation step at a tim……

Premium This card is part of the premium lesson. Unlock
Program
Example
Explanation

Small steps: 2 + 3 ↓ 5 Then:…

Premium This card is part of the premium lesson. Unlock

SMALL-STEP NOTATION

Explanation

Common notation: → One arrow:……

Premium This card is part of the premium lesson. Unlock

MULTIPLE SMALL STEPS

Explanation

Multiple transitions: →* can ……

Premium This card is part of the premium lesson. Unlock
Definition
Meaning

Command C பல small steps exec……

Premium This card is part of the premium lesson. Unlock

BIG-STEP SEMANTICS

Definition

Program-ன் intermediate execution steps காட்டாமல், initial stat……

Premium This card is part of the premium lesson. Unlock

BIG-STEP EXAMPLE

Program
Initial
Explanation

Big-step: ⇓ {x=5} Symbol: ⇓ m……

Premium This card is part of the premium lesson. Unlock

SMALL-STEP vs BIG-STEP

SIMPLE COMPARISON

ASSIGNMENT RULE

Explanation

Formal assignment semantics c……

Premium This card is part of the premium lesson. Unlock
Explanation

updates state: σ[x ↦ v] Rule: < x := e, σ > → < skip, σ[x ↦ valu……

Premium This card is part of the premium lesson. Unlock

SEQUENCE

Program
Consider
Explanation

Execution: x = 1 ↓ y = 2 ↓ Final State ……

Premium This card is part of the premium lesson. Unlock

SEQUENCE TRANSITION RULE

Explanation

If: → then: →…

Premium This card is part of the premium lesson. Unlock
Definition
Meaning

First statement-ல் ஒரு step execute செய……

Premium This card is part of the premium lesson. Unlock

SEQUENCE COMPLETION RULE

Definition

When first statement complete……

Premium This card is part of the premium lesson. Unlock
Definition
Meaning

First command done; now secon……

Premium This card is part of the premium lesson. Unlock

IF STATEMENT TRANSITION

Program
Example
Explanation

Two possibilities. If: x > 0 = true……

Premium This card is part of the premium lesson. Unlock

IF TRUE RULE

Explanation

Conceptually: if b then C1 el……

Premium This card is part of the premium lesson. Unlock

IF FALSE RULE

Explanation

If b = false: →…

Premium This card is part of the premium lesson. Unlock

IF EXAMPLE

Program
Initial
Explanation

Check: 5 > 0 → true Therefore:…

Premium This card is part of the premium lesson. Unlock
Explanation

Final: {x=5, y=1}…

Premium This card is part of the premium lesson. Unlock

WHILE LOOP TRANSITION

Program
While loop
Explanation

Formal idea: while b do C can be understood as:……

Premium This card is part of the premium lesson. Unlock

WHILE LOOP EXAMPLE

Explanation

int x = 1;…

Premium This card is part of the premium lesson. Unlock
Explanation

State transitions: S₀: x = 1 ↓ S₁: x……

Premium This card is part of the premium lesson. Unlock

WHILE AS STATE TRANSITIONS

Explanation

This is a classic example of ……

Premium This card is part of the premium lesson. Unlock

TRANSITION RELATION

Definition

எந்த state-இலிருந்து எந்த state-க்கு move செய்ய முடியும் என்பதை……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

S1 → S2…

Premium This card is part of the premium lesson. Unlock
Definition
Meaning

S1 state can make one valid t……

Premium This card is part of the premium lesson. Unlock

LABELED TRANSITION SYSTEM

Definition

Transitions actions/events-ன் na……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

S0 --login--> S1 S1 --logout-……

Premium This card is part of the premium lesson. Unlock

LTS FORMAL STRUCTURE

Explanation

A labeled transition system can……

Premium This card is part of the premium lesson. Unlock
Explanation

Often initial state-ஐ சேர்த்த……

Premium This card is part of the premium lesson. Unlock

SIMPLE LTS EXAMPLE

Explanation

Traffic signal: Red ↓ timer Green ↓ timer Yellow ↓ timer Red Formally: Red --timer-->……

Premium This card is part of the premium lesson. Unlock

DETERMINISTIC TRANSITION

Explanation

ஒரு given state + input/action-க்கு onl……

Premium This card is part of the premium lesson. Unlock
Program
Example
Program
Next
Explanation

Only one result.…

Premium This card is part of the premium lesson. Unlock

NON-DETERMINISTIC TRANSITION

Explanation

Same state-இலிருந்து multiple possible next states இருக்க முடிந்தால்: Non-Deterministic Tran……

Premium This card is part of the premium lesson. Unlock

DETERMINISTIC vs NON-DETERMINISTIC

TERMINAL STATE

Explanation

Further transition possible இல்லாத state: Termin……

Premium This card is part of the premium lesson. Unlock

STUCK STATE

Explanation

Program normal final state-க்கு வராமல், valid transition rule apply செய்ய முடியாத state: Stuck ……

Premium This card is part of the premium lesson. Unlock

SKIP COMMAND

Explanation

Formal semantics-ல்: skip means: Do not……

Premium This card is part of the premium lesson. Unlock

BOOLEAN EXPRESSION TRANSITION

Explanation
Example

x > 5 If:…

Premium This card is part of the premium lesson. Unlock
Explanation

then: x > 5 ↓ true Boolean re……

Premium This card is part of the premium lesson. Unlock

ARITHMETIC EXPRESSION SEMANTICS

Explanation
Example

2 + 3 * 4 By precedence: 3 * 4 ↓ 1……

Premium This card is part of the premium lesson. Unlock

EXPRESSION EVALUATION AS TRANSITION

Explanation

Small-step: e → e' means: Expression e ……

Premium This card is part of the premium lesson. Unlock

FORMAL RULE FORMAT

Explanation

Formal transition rules freque……

Premium This card is part of the premium lesson. Unlock
Summary
Conclusion

Example conceptual: e → e'…

Premium This card is part of the premium lesson. Unlock
Definition
Meaning

Expression e one step e' ஆக முடிந்தால்,……

Premium This card is part of the premium lesson. Unlock

INFERENCE RULE

Definition

Known conditions/premises-இலிருந்து valid transitio……

Premium This card is part of the premium lesson. Unlock

AXIOM

Summary

Premise இல்லாமல் directly valid r……

Premium This card is part of the premium lesson. Unlock

→ No additional premise neede……

Premium This card is part of the premium lesson. Unlock

TRANSITIVE CLOSURE

If: S0 → S1 S1 → S2 S2 → S3 then: S0 →* S3 ……

Premium This card is part of the premium lesson. Unlock

ONE-STEP vs MULTI-STEP

→ = one transition. →* = zero or more ……

Premium This card is part of the premium lesson. Unlock

FORMAL MODEL OF A SIMPLE PROGRAM

Explanation

Initial: σ₀ = {x → 0} Step 1:……

Premium This card is part of the premium lesson. Unlock

PROGRAM STATE AND MEMORY

Explanation

State may contain more than variables. Advanced model-ல்: State = Environment + Store + Control……

Premium This card is part of the premium lesson. Unlock

ENVIRONMENT

Definition

Identifier-ஐ storage location / ent……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

ρ(x) = L1 Means: variable x l……

Premium This card is part of the premium lesson. Unlock

STORE

Definition

Memory location-ஐ current val……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

σ(L1) = 10 Thus: x → L1 → 10…

Premium This card is part of the premium lesson. Unlock
List

1. WHY ENVIRONMENT + STORE?…

Premium This card is part of the premium lesson. Unlock
Explanation

Consider: int x = 10; Two different concepts: x → Memory Locati……

Premium This card is part of the premium lesson. Unlock

CONTROL COMPONENT

Explanation

Program-ல் currently எந்த statement execute ஆகிறது என்பதைக……

Premium This card is part of the premium lesson. Unlock

TRANSITION MACHINE

Explanation

ஒரு abstract machine-ல்: Configuration ↓ Transition Rule ↓ Ne……

Premium This card is part of the premium lesson. Unlock

CONNECTION WITH VIRTUAL COMPUTER

Explanation

Earlier பார்த்த Virtual Computer concept நினைவில் கொள்ளுங்கள். Virtual Computer ↓ Has machine state ↓ Execute……

Premium This card is part of the premium lesson. Unlock

CONNECTION WITH BINDING

Explanation
Example

int x = 10; Binding: x → int ……

Premium This card is part of the premium lesson. Unlock
Explanation

binding usually same: x → sam……

Premium This card is part of the premium lesson. Unlock
Important

Binding change மற்றும் state ……

Premium This card is part of the premium lesson. Unlock

CONNECTION WITH SEMANTICS

Important

Syntax tells: How program is written. Semantics tells: What program means. Formal transition ……

Premium This card is part of the premium lesson. Unlock

FORMAL SEMANTICS TYPES

Important

Programming languages-ல் thre……

Premium This card is part of the premium lesson. Unlock
Important

1. Operational Semantics 2. D……

Premium This card is part of the premium lesson. Unlock
Important

Formal transition models mainly……

Premium This card is part of the premium lesson. Unlock

OPERATIONAL SEMANTICS

Definition
Meaning

Program meaning = How an abstract……

Premium This card is part of the premium lesson. Unlock

DENOTATIONAL SEMANTICS

Definition

Program constructs-ஐ mathemat……

Premium This card is part of the premium lesson. Unlock
Concept

Program ↓ Mathematical Meaning…

Premium This card is part of the premium lesson. Unlock
Explanation
Example

[[ expression ]] notation use……

Premium This card is part of the premium lesson. Unlock

AXIOMATIC SEMANTICS

Explanation

Program correctness-ஐ logical assertions ம……

Premium This card is part of the premium lesson. Unlock
Program
Example

OPERATIONAL vs DENOTATIONAL vs AXIOMATIC

Explanation

For your current topic: Formal Transition ……

Premium This card is part of the premium lesson. Unlock

TRANSITION MODEL FOR IF

Program
Initial
Explanation

Step: x > 0 ↓ true Then:…

Premium This card is part of the premium lesson. Unlock
Program
Transition

TRANSITION MODEL FOR LOOP

Program
Initial
Explanation

States: S0: x=3 ↓ S1: x=2 ↓ S2: ……

Premium This card is part of the premium lesson. Unlock

LOOP TERMINATION

Explanation

Formal model மூலம் loop termi……

Premium This card is part of the premium lesson. Unlock
Program
Example
Explanation

Every transition: x → x-1 Eve……

Premium This card is part of the premium lesson. Unlock
Explanation

Therefore termination expecte……

Premium This card is part of the premium lesson. Unlock

INFINITE TRANSITION

Explanation

Program never reaches final s……

Premium This card is part of the premium lesson. Unlock
Explanation

Formal transition: S0 → S1 → S2 → S3 → ... No ……

Premium This card is part of the premium lesson. Unlock

CONCURRENCY AND TRANSITIONS

Explanation

Two processes: P1 P2 can execute in different orders. State: S0 Possible: S0 --……

Premium This card is part of the premium lesson. Unlock

REACHABLE STATE

Explanation

Initial state-இலிருந்து valid transitions மூலம் reac……

Premium This card is part of the premium lesson. Unlock

UNREACHABLE STATE

Explanation

No valid transition sequence leads to a state: Unreachable……

Premium This card is part of the premium lesson. Unlock

SAFETY PROPERTY

Explanation

Formal transition model பயன்படுத்தி: "Bad state never occurs" என்று prove செய்ய முயற……

Premium This card is part of the premium lesson. Unlock

LIVENESS PROPERTY

Explanation

System eventually something good செய்கிறதா என்பதை check செய்யும் property……

Premium This card is part of the premium lesson. Unlock

FORMAL TRANSITION MODEL ADVANTAGES

Explanation

Precise semantics No ambiguity Program verification Compiler verificati……

Premium This card is part of the premium lesson. Unlock

LIMITATIONS

Explanation

Large programs-க்கு: Huge number of states Complex rules State exp……

Premium This card is part of the premium lesson. Unlock

STATE EXPLOSION

Explanation

Suppose each component has many states. Multiple components combine செய்தால் total states rapidly increas……

Premium This card is part of the premium lesson. Unlock
Flow

Formal Transition Model complete flow: Program ↓ Initial C……

Premium This card is part of the premium lesson. Unlock
Comparison
State vs Transition
Comparison
Small-Step vs Big-Step
Remember

State = Current values / memory information Transition = Change from one ……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Common error

Do not confuse: State ≠ Variable Transition ≠ Assignment only Binding ≠ State Transition Syntax ……

Premium This card is part of the premium lesson. Unlock
Memory Trick

S → State T → Transition R → Rule C → Configuration F ……

Premium This card is part of the premium lesson. Unlock
TRB Point

1. A formal description of pr……

Premium This card is part of the premium lesson. Unlock
TRB Point

Answer: Formal Transition Mod……

Premium This card is part of the premium lesson. Unlock
TRB Point

1. The current values of prog……

Premium This card is part of the premium lesson. Unlock
TRB Point

Answer: State…

Premium This card is part of the premium lesson. Unlock
TRB Point

1. A change from one state to……

Premium This card is part of the premium lesson. Unlock
TRB Point

Answer: Transition…

Premium This card is part of the premium lesson. Unlock

Small-step semantics is also called:

TRB Point

Answer: Structural Operationa……

Premium This card is part of the premium lesson. Unlock

Big-step semantics is also called:

TRB Point

Answer: Natural Semantics…

Premium This card is part of the premium lesson. Unlock

Symbol usually representing one-step transition:

TRB Point

Answer: →…

Premium This card is part of the premium lesson. Unlock

→* generally represents:

TRB Point

Answer: Zero or more transiti……

Premium This card is part of the premium lesson. Unlock
TRB Point

1. A state with no further no……

Premium This card is part of the premium lesson. Unlock
TRB Point

Answer: Final / Terminal State…

Premium This card is part of the premium lesson. Unlock

Multiple possible next states indicate:

TRB Point

Answer: Non-determinism…

Premium This card is part of the premium lesson. Unlock

Formal transition models are strongly related to:

TRB Point

Answer: Operational Semantics…

Premium This card is part of the premium lesson. Unlock
MCQ

A program state represents:…

Premium This card is part of the premium lesson. Unlock
MCQ

A transition represents:…

Premium This card is part of the premium lesson. Unlock
MCQ

Which notation normally repre……

Premium This card is part of the premium lesson. Unlock
MCQ

Small-step semantics describe……

Premium This card is part of the premium lesson. Unlock
MCQ

Big-step semantics relates:…

Premium This card is part of the premium lesson. Unlock
MCQ

Which is another name for sma……

Premium This card is part of the premium lesson. Unlock
MCQ

Big-step semantics is also ca……

Premium This card is part of the premium lesson. Unlock
MCQ

If one state has two possible……

Premium This card is part of the premium lesson. Unlock
MCQ

Which formal semantics direct……

Premium This card is part of the premium lesson. Unlock
MCQ

A configuration usually conta……

Premium This card is part of the premium lesson. Unlock
TRB Point
Exam point

2 Marks - Define Formal Transition Model Formal Transition Model is a mathematical model that describes progr……

Premium This card is part of the premium lesson. Unlock
TRB Point

1. Definition 2. State 3. Configuration 4. Transition relation 5. Initial and fin……

Premium This card is part of the premium lesson. Unlock
Summary

Program ↓ Initial State S₀ ↓ Transiti……

Premium This card is part of the premium lesson. Unlock
Formula
Formal notation

→ where: C = Current command σ = Current state C' = Remaining/new command σ' = New state Most important relat……

Premium This card is part of the premium lesson. Unlock
Text size
17px
Theme
Contents
Print / PDF
Program