// Simplified: Define_model: "DOS File Maintenance Example" Starting_goal is Perform Disk_Maintenance. Task_item: T1 Name is First. Type is delete_file. Filename is "file1.txt". Enclosing_directory is "Work". Next is T2. Task_item: T2 Name is T2. Type is move_file. Filename is "file2.txt". Enclosing_directory is "Work". Destination_directory is "Documents". Next is T3. Task_item: T3 Name is T3. Type is delete_directory. Directory_name is "Temp". Next is T4. Task_item: T4 Name is T4. Type is move_directory. Directory_name is "Work". Destination_directory is "Documents". Next is None. // assuming Files, directories are visible on screen Method_for_goal: Perform Disk_Maintenance Step 1. Store First under . Step 2. Decide: If is None, Then Delete ; Delete ; Return_with_goal_accomplished. Step 3. Get_task_item_whose Name is and_store_under . // current directory??? // is used as a global WM item Step 3. Accomplish_goal: Perform Disk_Task. Step 4. Store Next of under . Step 5. Goto 2. Selection_rules_for_goal: Perform Disk_Task If Type of is delete_file, Then Accomplish_goal: delete file. If Type of is move_file, Then Accomplish_goal: move file. If Type of is delete_directory, Then Accomplish_goal: delete directory. If Type of is move_directory, Then Accomplish_goal: move directory. Return_with_goal_accomplished. // assuming directory is current directory? Method_for_goal: delete file Step 1. Accomplish_goal: perform command using "ERASE", Enclosing_directory of , Filename of , nil, and nil. Step 2. Return_with_goal_accomplished. Method_for_goal: move file Step 1. Accomplish_goal: copy file. Step 2. Accomplish_goal: delete file. Step 3. Return_with_goal_accomplished. Method_for_goal: copy file Step 1. Accomplish_goal: perform command using "COPY", Enclosing_directory of , Filename of , Destination_directory of , Filename of . Step 2. Return_with_goal_accomplished. // the file specs maybe should be separate task items? Method_for_goal: delete directory Step 1. Accomplish_goal: delete all_files_in_directory. Step 2. Accomplish_goal: remove directory. Step 3. Return_with_goal_accomplished. Method_for_goal: delete all_files_in_directory Step 1. Accomplish_goal: perform command using "ERASE", Directory_name of , "*.*" , nil, nil. Step 2. Return_with_goal_accomplished. Method_for_goal: remove directory Step 1. Accomplish_goal: perform command using "RMDIR", Directory_name of , nil, nil, nil. Step 2. Return_with_goal_accomplished. Method_for_goal: move directory Step 1. Accomplish_goal: copy directory. Step 2. Accomplish_goal: delete directory. Step 3. Return_with_goal_accomplished. Method_for_goal: copy directory Step 1. Accomplish_goal: create directory. Step 2. Accomplish_goal: copy all_files_in_directory. Step 3. Return_with_goal_accomplished. Method_for_goal: create directory Step 1. Accomplish_goal: perform command using "MKDIR", Destination_directory of , nil, // which directory? nil, nil. Step 2. Return_with_goal_accomplished. Method_for_goal: copy all_files_in_directory Step 1. Accomplish_goal: perform command using "COPY", Directory_name of , "*.*" , Destination_directory of , "*.*" . Step 2. Return_with_goal_accomplished. Method_for_goal: perform command using , , , , and Step 1. Type_in . Step 2. Accomplish_goal: Enter filespec using , and . Step 3. Decide: If is nil, and is nil, Then Goto 5. Step 4. Accomplish_goal: Enter filespec using , and . Step 5. Verify "command is correctly entered". Step 6. Keystroke CR. Step 7. Return_with_goal_accomplished. Method_for_goal: Enter filespec using , and Step 1. Keystroke SPACE. Step 2. Decide: If is nil, Then Goto 5. Step 3. Type_in . Step 5. Decide: If is nil, Then Return_with_goal_accomplished. Step 4. Decide: If is_not nil, Then Keystroke "\". Step 6. Type_in . Step 7. Return_with_goal_accomplished.