80 likes | 198 Views
Aspect-Oriented Software Development (AOSD) Tutorial #6. Categories of Aspects – contd.; LTL properties formalization; Assume – guarantee specifications. Today: Aspects Categories (contd.), LTL properties. Base system properties preservation guaranteed occasional
E N D
Aspect-Oriented Software Development (AOSD)Tutorial #6 Categories of Aspects – contd.; LTL properties formalization; Assume – guarantee specifications
Today: Aspects Categories (contd.), LTL properties • Base system properties preservation • guaranteed • occasional • From natural language to Temporal Logic • Assume – guarantee aspects specification • Examples Aspect-Oriented Software Development (236608)
Example: Rational Exam (reminder) 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 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(); } Aspect-Oriented Software Development (236608)
Rational Exam System Properties -1 • “After a user answers a question, the system performs correctness check and prints out the result” φ1 = G ( ((get_ans_ret = a) ⋀ (a ≠ null)) → (¬call_check_ansU ( (call_check_ans ⋀ arg1 = a ⋀ arg2 =result) ⋀ X (¬call_check_ans U (print ⋀ arg = check_ans_ret) ) ))) liveness Aspect-Oriented Software Development (236608)
Rational Exam System Properties -2 • “If an answer is a and the fractions in the question – r1 and r2, the correctness check will result in “true” iff a = r1 + r2” φ2 = G ( (call_check_ans →arg2 =r1+r2) ⋀ (ret_c_a -> (check_ans_ret ↔ arg1 = arg2)) ) enough, due to φ1 safety Aspect-Oriented Software Development (236608)
Rational Exam – Properties Preservation φ1= G(((get_ans_ret=a)⋀(a ≠ null))→ (¬call_ch_ans U ((call_ch_ans ⋀ arg1=a ⋀ arg2=result) ⋀X(¬call_ch_ans U (print ⋀ arg = ch_ans_ret))))) φ2= G((call_ch_ans → arg2=r1+r2)⋀ (ret_c_a -> (check_ans_ret ↔ arg1 = arg2)) ) ✔(here) ✔(defn) spectative strongly inv. ✔(here) ✘ weakly inv. ✔(here) ✔(here) regulative ✔(defn) ✔(here) spectative ✔(here) ✔(defn) weakly inv. ✔(here) ✔(here) Aspect-Oriented Software Development (236608)
From natural language to LTL • In this example: Specification of events in the system and their relations • Examples from the ontology of ARCADE temporal patterns: match patterns with temporal logic formulas Aspect-Oriented Software Development (236608)
From natural language to LTL G (A → ((F B) ⋀ ((¬B) U E))) G(A → B) G ( (¬B) U A) meaning (here): A has to be followed by E and then B G (A → F B) G (¬(A ⋀ B)⋀ X(A⋀B)→ X C Aspect-Oriented Software Development (236608)