Presentation is loading. Please wait.

Presentation is loading. Please wait.

Aspect-Oriented Software Development (AOSD) Tutorial #5 Categories of Aspects – contd.; LTL properties formalization.

Similar presentations


Presentation on theme: "Aspect-Oriented Software Development (AOSD) Tutorial #5 Categories of Aspects – contd.; LTL properties formalization."— Presentation transcript:

1 Aspect-Oriented Software Development (AOSD) Tutorial #5 Categories of Aspects – contd.; LTL properties formalization

2 Aspect-Oriented Software Development (236608) 2 Today: Aspects Categories (contd.), LTL properties Base system properties preservation –guaranteed –occasional From natural language to Temporal Logic Examples

3 Aspect-Oriented Software Development (236608) 3 LTL Future Operators - Reminder G palways p Fpeventually p (Շ, i) ⊨ Xp ⇔ (Շ, i+1) ⊨ pnext p (Շ, i) ⊨ p U q ⇔ ∃k : k ≥ i ⋀ (Շ, k) ⊨ g ⋀ ∀j : i ≤ j < k → (Շ, j) ⊨ fp until q (Շ, i) ⊨ p W q ≡ G p ⋁ p U q p weak until q k = i  q is true in the current state  ¬∃j. ( Շ, j) ⊨ p (and this is all right) maybe q is never true ( Շ, i) ⊨ G p ( Շ, i) ⊨ F p ( Շ, i) ⊨ X p i ( Շ, i) ⊨ p U q i i i …… …… … … … …… pppp p p pp q computation ( Շ ) = sequence of states

4 Aspect-Oriented Software Development (236608) 4 Base Properties Preservation?(1) p p, q q q, t q t t φ 1 = G (p → X q) φ 2 = G (r → X t) join-points: r becomes true r, q, t r t r r r Spectative aspect; “X” properties result: φ 1 preserved; φ 2 violated

5 Aspect-Oriented Software Development (236608) 5 Base Properties Preservation(2) p p, r q q, t φ 1 = G (p → F q) φ 2 = G (r → F t) r q r t p Regulative aspect; general liveness properties result: φ 1 violated; φ 2 preserved advice effect

6 Aspect-Oriented Software Development (236608) 6 More on Regulative Aspects p p, r q q, t φ 1 = G (p ∨ q) r q r t p Regulative aspect result: new safety property! (φ 1 )

7 Aspect-Oriented Software Development (236608) 7 Example: Rational Exam (reminder) private void doExam() { while (true) { r1 = randomRational(); r2 = randomRational(); result = r1.add(r2); answer = getAnswer(r1, r2); if (answer == null) break; checkAnswer(answer, result); } public static void main(String[] args) { RationalExam exam = new RationalExam(); exam.doExam(); } The system generates and checks online exams for students with simple arithmetic exercises for fractions RationalExam class: initiates exams, generates questions, accepts answers, checks answers

8 Aspect-Oriented Software Development (236608) 8 Rational Exam System Properties -1 “After a user answers a question, the system performs correctness check and prints out the result” –Semi – formally: φ 1 = G ( ((getAnswer() = a) ⋀ (a ≠ null)) → F (call checkAnswer(a,result) ⋀ (F print(checkAnswer(a,result))) ) ) –Formally: φ 1 = G ( ((get_ans_ret = a) ⋀ (a ≠ null)) → F (call_check_ans ⋀ arg1 = a ⋀ arg2 =result) ⋀ (F print ⋀ arg = check_ans_ret) ) ) Not exactly! Problem: calls to check_ans in- between

9 Aspect-Oriented Software Development (236608) 9 Rational Exam System Properties -1 Refinement: φ 1 = G ( ((get_ans_ret = a) ⋀ (a ≠ null)) → (¬ call_check_ans U ( (call_check_ans ⋀ arg1 = a ⋀ arg2 =result) ⋀ X (¬ call_check_ans U (print ⋀ arg = check_ans_ret) ) )))


Download ppt "Aspect-Oriented Software Development (AOSD) Tutorial #5 Categories of Aspects – contd.; LTL properties formalization."

Similar presentations


Ads by Google