Define_model: "MacWrite Example" Starting_goal is Edit Document. Task_item: T1 Name is First. Type is copy. Text_size is Word. Text_selection is "foobar". Text_insertion_point is "*". Next is T2. Task_item: T2 Name is T2. Type is copy. Text_size is Arbitrary. Text_selection_start is "Now". Text_selection_end is "country". Next is T3. Task_item: T3 Name is T3. Type is delete. Text_size is Word. Text_selection is "foobar". Text_insertion_point is "*". Next is T4. Task_item: T4 Name is T4. Type is move. Text_size is Arbitrary. Text_selection_start is "Now". Text_selection_end is "country". Next is None. // Dummy visual objects - targets for Look_for and Point_to Visual_object: Dummy_text_word Content is "foobar". Visual_object: Dummy_text_selection_start Content is "Now". Visual_object: Dummy_text_selection_end Content is "country". Visual_object: Dummy_text_insertion_point Content is "*". // Minimal description of the visual objects in the editor interface Visual_object: Edit_menu Label is Edit. Visual_object: Cut_menu_item Label is Cut. Visual_object: Copy_menu_item Label is Copy. Visual_object: Paste_menu_item Label is Paste. // Long-Term Memory contents about which items are in which menu LTM_item: Cut_Command Name is Cut. Containing_Menu is Edit. Menu_Item_Label is Cut. Accelerator_Key is COMMAND-X. LTM_item: Copy_Command Name is Copy. Containing_Menu is Edit. Menu_Item_Label is Copy. Accelerator_Key is COMMAND-C. LTM_item: Paste_Command Name is Paste. Containing_Menu is Edit. Menu_Item_Label is Paste. Accelerator_Key is COMMAND-V. // Top-Level Unit Task Method Method_for_goal: Edit Document Step.Store First under . Step Check_for_done. Decide: If is None, Then Delete ; Delete ; Return_with_goal_accomplished. Step. Get_task_item_whose Name is and_store_under . Step. Accomplish_goal: Perform Unit_task. Step. Store Next of under ; Goto Check_for_done. Selection_rules_for_goal: Perform Unit_task If Type of is move, Then Accomplish_goal: Move Text. If Type of is delete, Then Accomplish_goal: Erase Text. If Type of is copy, Then Accomplish_goal: Copy Text. // ... etc. ... Return_with_goal_accomplished. Method_for_goal: Move Text Step 1. Accomplish_goal: Cut Selection. Step 2. Accomplish_goal: Paste Selection. Step 3. Verify "correct text moved". Step 4. Return_with_goal_accomplished. Method_for_goal: Copy Text Step 1. Accomplish_goal: Copy Selection. Step 2. Accomplish_goal: Paste Selection. Step 3. Verify "correct text copied". Step 4. Return_with_goal_accomplished. Method_for_goal: Erase Text Step 1. Accomplish_goal: Select Text. Step 2. Keystroke DELETE. Step 3. Verify "correct text deleted". Step 4. Return_with_goal_accomplished. Method_for_goal: Cut Selection Step 1. Accomplish_goal: Select Text. Step 2. Accomplish_goal: Issue Command using Cut. Step 3. Return_with_goal_accomplished. Method_for_goal: Copy Selection Step 1. Accomplish_goal: Select Text. Step 2. Accomplish_goal: Issue Command using Copy. Step 3. Return_with_goal_accomplished. Method_for_goal: Paste Selection Step 1. Accomplish_goal: Select Insertion_point. Step 2. Accomplish_goal: Issue Command using Paste. Step 3. Return_with_goal_accomplished. Selection_rules_for_goal: Select Text If Text_size of is Word, Then Accomplish_goal: Select Word. If Text_size of is Arbitrary, Then Accomplish_goal: Select Arbitrary_text. Return_with_goal_accomplished. Method_for_goal: Select Word Step 1. Look_for_object_whose Content is Text_selection of and_store_under . Step 2. Point_to ; Delete . Step 3. Double_click mouse_button. Step 4. Verify "correct text is selected". Step 5. Return_with_goal_accomplished. Method_for_goal: Select Arbitrary_text Step 1. Look_for_object_whose Content is Text_selection_start of and_store_under . Step 2. Point_to . Step 3. Hold_down mouse_button. Step 4. Look_for_object_whose Content is Text_selection_end of and_store_under . Step 5. Point_to ; Delete . Step 6. Release mouse_button. Step 7. Verify "correct text is selected". Step 8. Return_with_goal_accomplished. Method_for_goal: Select Insertion_point Step 1. Look_for_object_whose Content is Text_insertion_point of and_store_under . Step 2. Point_to ; Delete . Step 3. Click mouse_button. Step 4. Verify "insertion cursor is at correct place". Step 5. Return_with_goal_accomplished. Method_for_goal: Issue Command using // Assumes that user does not use command-key shortcuts Step 1. Recall_LTM_item_whose Name is and_store_under . Step 2. Look_for_object_whose Label is Containing_Menu of and_store_under . Step 3. Point_to . Step 4. Hold_down mouse_button. Step 5. Verify "correct menu appears". Step 6. Look_for_object_whose Label is Menu_Item_Label of and_store_under . Step 7. Point_to . Step 8. Verify "correct menu command is highlighted". Step 9. Release mouse_button. Step 10.Delete ; Delete ; Return_with_goal_accomplished.