FORMAL TRANSITION MODELS…
FORMAL TRANSITION MODELS
Formal Transition Model என்பது ஒரு program execute ஆகும் போது, அதன் state ஒரு நிலைமையிலிருந்து மற்றொரு நிலைக்கு எப்படி மாறுகிறது என்பதை mathematical / formal rules மூலம் represent செய்யும் model. Simple Tamil: Program execute ஆகும்போது Cur…
Formal Transition Model என்பது ஒரு program execute ஆகும் போது, அதன் state ஒரு நிலைமையிலிருந்து மற்றொரு நிலைக்……
1. TRANSITION என்றால் என்ன?…
Transition = ஒரு state-இலிருந……
Therefore: x = 5 ↓ x = x + 1 ……
1. STATE என்றால் என்ன?…
ஒரு குறிப்பிட்ட நேரத்தில் program-ன் variables, memory மற்றும் execution infor……
int x = 10; int y = 20; Curre……
இதனை mathematical form-ல்: σ = {x → 1……
STATE MAPPING
State பொதுவாக: Variable → Value mapping ஆக பார்க்……
FORMAL TRANSITION
State transition-ஐ formal-ஆக: σ → σ' என்று represent……
After: σ' = {x → 6} Thus: σ →……
CONFIGURATION
Formal semantics-ல் state மட்டும் இல்லாமல், தற்போது execute செய்ய வேண்டிய statement-ஐயும……
TRANSITION NOTATION
A common notation: → Where:…
C' = Remaining command σ' = New state Simple: Pro……
SIMPLE ASSIGNMENT TRANSITION
Before: σ = {x → 5} After: σ' = {x → 1……
EXPRESSION TRANSITION
Step 1: 2 + 3 evaluate: 5 Ste……
Then state update: x → 5 Flow……
TRANSITION SYSTEM
States மற்றும் அவற்றுக்கிடையிலான tra……
State ↓ Transition ↓ State A transition system……
FORMAL TRANSITION MODEL - COMPONENTS
1. State 2. Initial State 3. Transition ……
Program execution ஆரம்பிக்கும……
FINAL STATE
Program execution முடிவடைந்த ……
STATE TRANSITION SEQUENCE
S₂ {x=9}…
1. WHY FORMAL TRANSITION MODE……
Programming language semantics natural language மட்டும் use செய்து describe செய்தால் ambiguity வரலாம். Formal……
OPERATIONAL SEMANTICS
Formal transition models-க்கு ம……
Program statements execute ஆகும்போது machine state எப்படி change ஆகிறது என்பதை formal transition r……
OPERATIONAL SEMANTICS IDEA
+ State ↓ Execution Rule ↓ Ne……
TWO IMPORTANT OPERATIONAL MODELS
Small-Step Semantics
Big-Step Semantics
இதனை மிகவும் முக்கியமாக படிக்……
SMALL-STEP SEMANTICS
Program execution-ஐ one small computation step at a tim……
Small steps: 2 + 3 ↓ 5 Then:…
SMALL-STEP NOTATION
Common notation: → One arrow:……
MULTIPLE SMALL STEPS
Multiple transitions: →* can ……
Command C பல small steps exec……
BIG-STEP SEMANTICS
Program-ன் intermediate execution steps காட்டாமல், initial stat……
BIG-STEP EXAMPLE
Big-step: ⇓ {x=5} Symbol: ⇓ m……
SMALL-STEP vs BIG-STEP
SIMPLE COMPARISON
ASSIGNMENT RULE
Formal assignment semantics c……
updates state: σ[x ↦ v] Rule: < x := e, σ > → < skip, σ[x ↦ valu……
SEQUENCE
Execution: x = 1 ↓ y = 2 ↓ Final State ……
SEQUENCE TRANSITION RULE
If: → then: →…
First statement-ல் ஒரு step execute செய……
SEQUENCE COMPLETION RULE
When first statement complete……
First command done; now secon……
IF STATEMENT TRANSITION
Two possibilities. If: x > 0 = true……
IF TRUE RULE
Conceptually: if b then C1 el……
IF FALSE RULE
If b = false: →…
IF EXAMPLE
Check: 5 > 0 → true Therefore:…
Final: {x=5, y=1}…
WHILE LOOP TRANSITION
Formal idea: while b do C can be understood as:……
WHILE LOOP EXAMPLE
int x = 1;…
State transitions: S₀: x = 1 ↓ S₁: x……
WHILE AS STATE TRANSITIONS
This is a classic example of ……
TRANSITION RELATION
எந்த state-இலிருந்து எந்த state-க்கு move செய்ய முடியும் என்பதை……
S1 → S2…
S1 state can make one valid t……
LABELED TRANSITION SYSTEM
Transitions actions/events-ன் na……
S0 --login--> S1 S1 --logout-……
LTS FORMAL STRUCTURE
A labeled transition system can……
Often initial state-ஐ சேர்த்த……
SIMPLE LTS EXAMPLE
Traffic signal: Red ↓ timer Green ↓ timer Yellow ↓ timer Red Formally: Red --timer-->……
DETERMINISTIC TRANSITION
ஒரு given state + input/action-க்கு onl……
Only one result.…
NON-DETERMINISTIC TRANSITION
Same state-இலிருந்து multiple possible next states இருக்க முடிந்தால்: Non-Deterministic Tran……
DETERMINISTIC vs NON-DETERMINISTIC
TERMINAL STATE
Further transition possible இல்லாத state: Termin……
STUCK STATE
Program normal final state-க்கு வராமல், valid transition rule apply செய்ய முடியாத state: Stuck ……
SKIP COMMAND
Formal semantics-ல்: skip means: Do not……
BOOLEAN EXPRESSION TRANSITION
x > 5 If:…
then: x > 5 ↓ true Boolean re……
ARITHMETIC EXPRESSION SEMANTICS
2 + 3 * 4 By precedence: 3 * 4 ↓ 1……
EXPRESSION EVALUATION AS TRANSITION
Small-step: e → e' means: Expression e ……
FORMAL RULE FORMAT
Formal transition rules freque……
Example conceptual: e → e'…
Expression e one step e' ஆக முடிந்தால்,……
INFERENCE RULE
Known conditions/premises-இலிருந்து valid transitio……
AXIOM
Premise இல்லாமல் directly valid r……
→ No additional premise neede……
TRANSITIVE CLOSURE
If: S0 → S1 S1 → S2 S2 → S3 then: S0 →* S3 ……
ONE-STEP vs MULTI-STEP
→ = one transition. →* = zero or more ……
FORMAL MODEL OF A SIMPLE PROGRAM
Initial: σ₀ = {x → 0} Step 1:……
PROGRAM STATE AND MEMORY
State may contain more than variables. Advanced model-ல்: State = Environment + Store + Control……
ENVIRONMENT
Identifier-ஐ storage location / ent……
ρ(x) = L1 Means: variable x l……
STORE
Memory location-ஐ current val……
σ(L1) = 10 Thus: x → L1 → 10…
1. WHY ENVIRONMENT + STORE?…
Consider: int x = 10; Two different concepts: x → Memory Locati……
CONTROL COMPONENT
Program-ல் currently எந்த statement execute ஆகிறது என்பதைக……
TRANSITION MACHINE
ஒரு abstract machine-ல்: Configuration ↓ Transition Rule ↓ Ne……
CONNECTION WITH VIRTUAL COMPUTER
Earlier பார்த்த Virtual Computer concept நினைவில் கொள்ளுங்கள். Virtual Computer ↓ Has machine state ↓ Execute……
CONNECTION WITH BINDING
int x = 10; Binding: x → int ……
binding usually same: x → sam……
Binding change மற்றும் state ……
CONNECTION WITH SEMANTICS
Syntax tells: How program is written. Semantics tells: What program means. Formal transition ……
FORMAL SEMANTICS TYPES
Programming languages-ல் thre……
1. Operational Semantics 2. D……
Formal transition models mainly……
OPERATIONAL SEMANTICS
Program meaning = How an abstract……
DENOTATIONAL SEMANTICS
Program constructs-ஐ mathemat……
Program ↓ Mathematical Meaning…
[[ expression ]] notation use……
AXIOMATIC SEMANTICS
Program correctness-ஐ logical assertions ம……
OPERATIONAL vs DENOTATIONAL vs AXIOMATIC
For your current topic: Formal Transition ……
TRANSITION MODEL FOR IF
Step: x > 0 ↓ true Then:…
TRANSITION MODEL FOR LOOP
States: S0: x=3 ↓ S1: x=2 ↓ S2: ……
LOOP TERMINATION
Formal model மூலம் loop termi……
Every transition: x → x-1 Eve……
Therefore termination expecte……
INFINITE TRANSITION
Program never reaches final s……
Formal transition: S0 → S1 → S2 → S3 → ... No ……
CONCURRENCY AND TRANSITIONS
Two processes: P1 P2 can execute in different orders. State: S0 Possible: S0 --……
REACHABLE STATE
Initial state-இலிருந்து valid transitions மூலம் reac……
UNREACHABLE STATE
No valid transition sequence leads to a state: Unreachable……
SAFETY PROPERTY
Formal transition model பயன்படுத்தி: "Bad state never occurs" என்று prove செய்ய முயற……
LIVENESS PROPERTY
System eventually something good செய்கிறதா என்பதை check செய்யும் property……
FORMAL TRANSITION MODEL ADVANTAGES
Precise semantics No ambiguity Program verification Compiler verificati……
LIMITATIONS
Large programs-க்கு: Huge number of states Complex rules State exp……
STATE EXPLOSION
Suppose each component has many states. Multiple components combine செய்தால் total states rapidly increas……
Formal Transition Model complete flow: Program ↓ Initial C……
State = Current values / memory information Transition = Change from one ……
Do not confuse: State ≠ Variable Transition ≠ Assignment only Binding ≠ State Transition Syntax ……
S → State T → Transition R → Rule C → Configuration F ……
1. A formal description of pr……
Answer: Formal Transition Mod……
1. The current values of prog……
Answer: State…
1. A change from one state to……
Answer: Transition…
Small-step semantics is also called:
Answer: Structural Operationa……
Big-step semantics is also called:
Answer: Natural Semantics…
Symbol usually representing one-step transition:
Answer: →…
→* generally represents:
Answer: Zero or more transiti……
1. A state with no further no……
Answer: Final / Terminal State…
Multiple possible next states indicate:
Answer: Non-determinism…
Formal transition models are strongly related to:
Answer: Operational Semantics…
A program state represents:…
A transition represents:…
Which notation normally repre……
Small-step semantics describe……
Big-step semantics relates:…
Which is another name for sma……
Big-step semantics is also ca……
If one state has two possible……
Which formal semantics direct……
A configuration usually conta……
2 Marks - Define Formal Transition Model Formal Transition Model is a mathematical model that describes progr……
1. Definition 2. State 3. Configuration 4. Transition relation 5. Initial and fin……
Program ↓ Initial State S₀ ↓ Transiti……
→ where: C = Current command σ = Current state C' = Remaining/new command σ' = New state Most important relat……