School of Computing and Information Systems

School of Computing and Information Systems
comp10002 Foundations of Algorithms
Semester 2, 2020
Assignment 2
 
Learning Outcomes
    In this project, you will demonstrate your understanding of dynamic memory and linked data structures (Chapter 10), and extend your skills in terms of program design, testing, and debugging. You will also learn about Robotic Process Automation (RPA) for executing routine clerical tasks in organizations, and implement simple mechanisms for checking candidate routines in a given trace of executed activities.
 
Robotic Process Automation
    RPA is an emerging technology that allows organizations to automate repetitive clerical work by executing software scripts (RPA scripts) that support executions of sequences of fifine-grained interactions with Web and desktop applications. An example of such repetitive clerical work is transferring data across information systems, for instance, from a spreadsheet into a Web form (refer to Figure 1) . A common approach to eliciting RPA scripts nowadays is through observing workers or in terviews, which is time-consuming. Alistair and Artem would like to start a business, called A&A RPA, which will offer a new product to the market. This product will aim to automate the process of identifying routines, i.e., sequences of interactions with User Interfaces of informa tion systems that lead to the same effect. For example, in the context of Figure 1, a routine is a procedure for transferring data from a row in sub-fifigure (a) to the Web form in sub-fifigure (b) and clicking the “Save” button. As the fifirst step, we developed a tool that records a trace of consecutive actions , where an action captures information about user interaction with an infor mation system. Examples of actions include se lecting a cell in a spreadsheet, copying the content of a cell, and clicking a button in a Web form. An action is characterized by a precondition and effect , each captured as a collection of Boolean variables.
    For example, the precondition of clicking the “Save” button action in the Web form in Figure 1(b) may be that variables FirstNameEntered , LastNameEntered , and CountryOfRresidenceEntered are all set to true, and variable InternationalStudentSelected is set to false. The effect of this example action may be that variable NewStudentEntryCreated is set to true, and all the precondition variables are set to false. As the next step, we would like to develop a tool that given a trace and a candidate routine , both specifified as sequences of actions with preconditions and effects, identififies all sub-sequences of actions in the trace that gen erate the same cumulative effect as the candidate routine. Candidate routines that lead to identifying many such sub-sequences can be recommended for implementing in RPA scripts. Note that the identifified sub-sequences may, in general, be different as, for example, a user may be transferring content from the spreadsheet cells to the
form in different orders for different students (fifirst name then last name, or vice versa). Your task is to implement a tool for checking candidate routines.

 
Input Data
Your program should read input from stdin . The input starts by listing names of Boolean variables, one per line, that must be set to true in the initial state , where the initial state is defifined by values of all the Boolean variables before a trace gets executed. All the other variables must be set to false in the initial state. An input line 1 with a single character ‘ # ’ denotes the end of input of the initial state. The lines that follow defifine actions, one action per line. Each action is defifined as a quintuple. The fifirst two elements of an action list its precondition , i.e., variables that must be set to true and false to enable the action. The third element is the name of the action. The last two elements of an action specify its effect , i.e., variables that are set to be true and false after the action is executed. Another input line with a single character ‘ # ’ denotes the end of the action defifinition section of the input. The subsequent input characters encode a trace, each referring to the name of the action executed in the corresponding position of the trace. All the lines of the input, except the last line, are not empty. The following fifile test0.txt defifines the initial state, three actions, and a trace executed from the initial state (the numbers in italics show line numbers and are not part of the input fifile).

Boolean variables are denoted by characters ‘ a ’, ‘ b ’, . . . , ‘ z ’ (lower-case Latin alphabet letters), while action names are referred to as ‘ A ’, ‘ B ’, . . . , ‘ Z ’ (upper-case Latin alphabet letters). Hence, the above input specififies the initial state in which variables a , b , x , y , and z are set to true, while variables c , d , . . . , w are set to false. The input trace consists of fifive actions, see line 11. From the initial state, the trace commences by executing action X , followed by an execution of action V , followed by action U , followed by another occurrence of V , and concludes by another occurrence of action U . Actions U , V , and X are defifined at lines 7–9 of the input. The fifive components
of each action are delimited using the colon character ‘ : ’. For example, the action defifined at line 7 of the input has name X . This action can occur in a state where variables a and b are set to true, and variable c is set to false. Once this action is executed, variables c and f are set to true, while variable b is set to false.
 
Stage 0 – Reading and Analyzing Input Data (8/20 marks) 
The fifirst version of your program should read the input from stdin , ensure that the input trace is valid, and print out some basic information so that you can be sure you have read the inputs correctly. A valid trace is composed of actions that occur in states that satisfy their preconditions; otherwise, the trace is invalid . The required output from this stage generated for test0.txt fifile shown above is the summary shown below on the left.

    The basic information printed by your program should specify the number of distinct actions, length of the trace, and the status of the trace read from the input, which are 3 , 5 , and valid , respectively, for input fifile test0.txt . This information should be followed by a delimiter line, followed by the detailed specifification of the trace given as a table of ASCII characters. The columns in this table refer to variables, while rows specify states and executed actions. A state is encoded as a sequence of ‘ 0 ’ and ‘ 1 ’ characters, where ‘ 0 ’ indicates that the corresponding variable (specifified in the column header) is set to false and ‘ 1 ’ indicates that the variable is set to true. The fifirst printed state, denoted by character ‘ > ’ in the left-most column, specififies the initial state. Each subsequent line prints the next executed action, followed by the sequence of zeros and ones that encodes the state one achieves after executing the action. For instance, the execution of action X in the example input trace flflips the values of variables b and f in the initial state.
    If the input trace is invalid, your program should report the corresponding status of the trace and print its valid prefifix. For example, if line 9 in fifile test0.txt is changed from “ fpq:b:U::pq ” to “ fpq:b:U:b:pq ” to obtain fifile test1.txt , then your program should produce the output shown above on the right. In this case, the second occurrence of action U cannot take place as its precondition requires that variable b is set to false. However, b is set to true after the execution of the fifirst four actions of the trace.
    All inputs will follow the format specifified in the Input Data section. No input action will specify that a variable is equal (or should be set) to true and false simultaneously, e.g., “ a:a:X:b:b ”. Also, no input action will set a value of a variable as in the precondition, e.g., “ a:b:Y:a:b ”. Your program will not be tested on erroneous inputs. Refer to the input fifiles distributed with this specifification for the exact formatting of inputs.
 
Stage 1 – Check Basic Routines (16/20 marks)
    Extend your program from Stage 0 to perform a basic check of a candidate routine by identifying all trace sub sequences that produce the same effect. All of the Stage 0 output should be retained. If the input proceeds with a line with a single character ‘ # ’, your program should generate Stage 1 output, which starts with this line:
==STAGE 1===============================
For each subsequent input line containing a candidate routine specifified as a sequence of action names, discover and print non-overlapping sub-sequences of consecutive actions of the trace that produce the same cumulative effect as the candidate routine. Proceed from left to right in the trace. Once the shortest sub-sequence with the desired effect is identifified, record it and restart searching from the next position in the trace.
    The cumulative effect of a routine or sequence of actions is determined as all the values (true and false) set to the Boolean variables as effects of the actions executed in the order they appear in the routine/sequence. Considering input fifile test0.txt , candidate routine VU generates the cumulative effect of setting variables p and q to false. First, action V sets p and q to true. Next, action U updates them to be false. Hence, would input fifile test0.txt be modifified to contain a single character ‘ # ’ at line 12 and string “ VU ” at line 13 to encode a
candidate routine followed by the new line character, Stage 1 output should proceed by printing these lines:
Candidate routine: VU
1: VU
3: VU
Here, the fifirst line specififies the candidate routine and the two subsequent lines refer to two sub-sequences that start at positions 1 and 3 of the input trace (counting positions from zero); trace positions are printed using the formatting string “ %5d ”. These two sub-sequences generate the same cumulative effect as the candidate routine.
    Each subsequent input line with a candidate routine should be processed in the same way, and its output should be separated from the previous output by the delimiter line composed of ‘ - ’ characters, refer to Stage 0 specifification above for examples of using the delimiter line. Consider input fifile test2.txt listed below

The Stage 1 output for input fifile test2.txt is shown below on the left. Indeed, both sequences of actions D and
AB have the cumulative effect of setting variables x , y , and z to true, and are therefore identifified. Sub-sequences
with smaller start positions should be printed fifirst.

Stage 2 – Check Advanced Routines (20/20 marks)
Extend your program from Stage 1 to perform further checks for the input candidate routines. All of the output from Stages 0 and 1 should be retained. If your input after Stage 1 continues with a single character line of ‘ # ’, process subsequent input lines with candidate routines (one routine per line). This time, an identifified sub-sequence of actions in the input trace should be allowed to modify the values of variables not set by the candidate routine. However, in this case, once all the actions of the identifified sub-sequence are executed, the
3 values of such variables must be set to the values they had before executing the sub-sequence. Note that this knowledge of variable values can be obtained from the preconditions of the trace actions.
    For example, the sub-sequence of actions ACGHE in the trace of input fifile test2.txt sets values of variables i , j , x , y , and z . Note that, to execute, action G requires that i and j are both set to false, and sets them to true. However, next, action H sets them to false, which are their original values at the start of the sub-sequence. Hence, the cumulative effect of executing ACGHE is the same as that one of executing D or AB , i.e., setting x , y , and z to true. The complete output of Stage 2 for input fifile test2.txt is proposed on the right of the listings presented in the specifification of Stage 1. If your program concludes with Stage 2, at the end, it should output this line:
==THE END===============================

 

Important...
The outputs generated by your program should be exactly the same as the sample outputs for the corresponding inputs. You should not assume the maximal allowed lengths for the input trace and candidate routines and, thus, use malloc and linked lists to store them. Regardless of the algorithmic techniques you will employ in this assignment, your program should run under 1 second on each sample input.
 
Boring But Important...
This project is worth 20% of your fifinal mark, and is due at 11:00pm on Friday 30 October . Submissions that are made after that deadline will incur penalty marks at the rate of two marks per day or part day late. Students seeking extensions for medical or other “outside my control” reasons should email ammoffat@unimelb.edu.au as soon as possible after those circumstances arise. If you attend a GP or other health care service as a result of illness, be sure to take a Health Professional Report (HPR) form with you (get it from the Special Consideration section of the Student Portal), you will need this form to be fifilled out if your illness develops in to something that later requires a Special Consideration application to be lodged. You should scan the HPR form and send it with any non-Special Consideration assignment extension requests. 
A rubric explaining the marking expectations is provided on the FAQ page. You need to submit your program for assessment; detailed instructions on how to do that will be posted on the FAQ page once submissions are opened. Submission will not be done via the LMS or grok , and you will instead use a software system known as submit . You can (and should) use submit both early and often – to get used to the way it works, and also to check that your program compiles correctly on our test system, which has some different characteristics to the lab machines. Failure to follow this simple advice is highly likely to result in tears. Only the last submission that you make before the deadline will be marked. Marks and a sample solution will be available on the LMS two weeks after submissions close.
Academic Honesty : You may discuss your work during your workshop, and with others in the class, but what gets typed into your program must be individual work, not copied from anyone else. So, do not give hard copy or soft copy of your work to anyone else; do not “lend” your “Uni backup” memory stick to others for any reason at all; and do not ask others to give you their programs “just so that I can take a look and get some ideas, I won’t copy, honest”. The best way to help your friends in this regard is to say a very fifirm “ no ” if they ask to see your program, pointing out that your “ no ”, and their acceptance of that decision, are the only way to preserve your friendship. See https://academicintegrity.unimelb.edu.au for more information. Note also that solicitation of solutions via posts to online forums, whether or not there is payment involved, is also Academic Misconduct. In the past students have had their enrolment terminated for such behavior.
The FAQ page contains a link to a program skeleton that includes an Authorship Declaration that you must “sign” and include at the top of your submitted program. Marks will be deducted (see the rubric linked from the FAQ page) if you do not include the declaration, or do not sign it, or do not comply with its expectations. A sophisticated program that undertakes deep structural analysis of C code identifying regions of similarity will be run over all submissions. Students whose programs are identifified as containing signifificant overlaps will have substantial mark penalties applied, or be referred to the Student Center for possible disciplinary action, without further warning. 
Nor should you post your code to any public location ( github , codeshare.io , etc) while the assignment is active or prior to the release of the assignment marks.
 
代码联系微信 lqs_8023
代码编号 000001
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
东南亚位于我国倡导推进的“一带一路”海陆交汇地带,作为当今全球发展最为迅速的地区之一,近年来区域内生产总值实现了显著且稳定的增长。根据东盟主要经济体公布的最新数据,印度尼西亚2023年国内生产总值(GDP)增长5.05%;越南2023年经济增长5.05%;马来西亚2023年经济增速为3.7%;泰国2023年经济增长1.9%;新加坡2023年经济增长1.1%;柬埔寨2023年经济增速预计为5.6%。 东盟国家在“一带一路”沿线国家中的总体GDP经济规模、贸易总额与国外直接投资均为最大,因此有着举足轻重的地位和作用。当前,东盟与中国已互相成为双方最大的交易伙伴。中国-东盟贸易总额已从2013年的443亿元增长至 2023年合计超逾6.4万亿元,占中国外贸总值的15.4%。在过去20余年中,东盟国家不断在全球多变的格局里面临挑战并寻求机遇。2023东盟国家主要经济体受到国内消费、国外投资、货币政策、旅游业复苏、和大宗商品出口价企稳等方面的提振,经济显现出稳步增长态势和强韧性的潜能。 本调研报告旨在深度挖掘东南亚市场的增长潜力与发展机会,分析东南亚市场竞争态势、销售模式、客户偏好、整体市场营商环境,为国内企业出海开展业务提供客观参考意见。 本文核心内容: 市场空间:全球行业市场空间、东南亚市场发展空间。 竞争态势:全球份额,东南亚市场企业份额。 销售模式:东南亚市场销售模式、本地代理商 客户情况:东南亚本地客户及偏好分析 营商环境:东南亚营商环境分析 本文纳入的企业包括国外及印尼本土企业,以及相关上下游企业等,部分名单 QYResearch是全球知名的大型咨询公司,行业涵盖各高科技行业产业链细分市场,横跨如半导体产业链(半导体设备及零部件、半导体材料、集成电路、制造、封测、分立器件、传感器、光电器件)、光伏产业链(设备、硅料/硅片、电池片、组件、辅料支架、逆变器、电站终端)、新能源汽车产业链(动力电池及材料、电驱电控、汽车半导体/电子、整车、充电桩)、通信产业链(通信系统设备、终端设备、电子元器件、射频前端、光模块、4G/5G/6G、宽带、IoT、数字经济、AI)、先进材料产业链(金属材料、高分子材料、陶瓷材料、纳米材料等)、机械制造产业链(数控机床、工程机械、电气机械、3C自动化、工业机器人、激光、工控、无人机)、食品药品、医疗器械、农业等。邮箱:market@qyresearch.com

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值