Contact Address Dr. Mark Evered
- 格式:pdf
- 大小:33.09 KB
- 文档页数:15
Intermediate view synthesis considering occluded and ambiguously referenced image regions1Jeffrey S. McVeigh*, M. W. Siegel** and Angel G. Jordan**Department of Electrical and Computer Engineering**Robotics Institute / School of Computer ScienceCarnegie Mellon University, Pittsburgh, PA 15213Contact Address:Jeffrey S. McVeighDepartment of Electrical and Computer EngineeringCarnegie Mellon University5000 Forbes AvenuePittsburgh, PA 15213jmcveigh@Total number of pages: 16Number of figures: 3Number of footnotes: 2Running headline: Intermediate view synthesisKeywords: Stereoscopic image processing, view interpolation, disparity estimation, occlusion detection, motion par-allax, viewer-specified inter-camera separation.ABSTRACTIn this paper, we present an algorithm for synthesizing intermediate views from a single stereopair. The key con-tributions of this algorithm are the incorporation of scene assumptions and a disparity estimation confidence measure that lead to the accurate synthesis of occluded and ambiguously referenced regions. The synthesized views have been displayed on a multi-view binocular imaging system, with subjectively effective motion parallax and diminished eye strain.1. INTRODUCTIONFor three-dimensional television (3D-TV) to become feasible and acceptable on a wide scale, the added realism must outweigh any required increases in processing and system complexity, and the stereoscopic information must be comfortable to view. Both of these goals can be achieved if intermediate views of the scene are available. An interme-diate view is defined as the image that would be obtained from a camera located between and on a straight-line con-necting the given stereopair’s cameras.While binocular systems provide depth information through the sensation of stereopsis, a system consisting of only two views of a scene lacks the important depth cue of motion parallax, which provides the distinction between binocular and three-dimensional systems [14]. Motion parallax can be synthesized from multiple intermediate views of the scene by presenting the correct stereopair according to the observer’s position.Discomfort is often experienced when viewing stereoscopic images on two-dimensional displays [9]. As with any subjective assessment, this discomfort is viewer-dependent. The authors observe that viewers prefer varying degrees of depth perception from binocular imagery based on individual stereoscopic viewing ability and the range of depth present in the scene. A greater sense of depth is provided by a relatively large inter-camera separation, but the larger the separation the more difficulty marginal viewers have in fusing the images. If intermediate views of a scene are available, a viewer can dynamically select the inter-camera separation for comfort and preferred sense of depth2.After a brief discussion of prior work on image interpolation, we describe our algorithm for intermediate view synthesis. Synthesis is performed, in the standard manner, using the geometric relationship between the given views and estimated disparity values [1, 4, 6, 7, 10-12]. Depth information for occluded and ambiguously referenced regions are approximated through the development of reasonable scene assumptions and the utilization of the signal-to-noise ratio (SNR) from the disparity estimation procedure as a confidence measure; these novel steps, which are discussed in detail, allow for the accurate synthesis of “difficult” regions, and are the key contributions of this paper. We conclude with experimental results and potential directions for future research.2. PRIOR WORKA common technique for the synthesis of intermediate views is through the generation of epipolar plane images (EPI) [4, 6]. Skerjanc and Liu base their synthesis on the mapping of feature points from three camera views [11]. While these techniques reduce the occurrence of occlusion and improve disparity estimation performance through the use of multiple views of the scene, they require increases in camera complexity and bandwidth to transmit the addi-tional views. Other prior work has attempted to construct a three-dimensional model of the scene from two or more images and then utilize computer-graphics routines to synthesize intermediate views [2]. However, the construction of a 3D model may be an unnecessary and time-consuming step if the ultimate goal is only the intermediate view.Intermediate view synthesis is closely related to work performed on motion compensated interpolation for frame rate conversion, de-interlacing and frame skipping, where views are generated from two temporally offset images [1, 7, 10, 12]. For these techniques, when a portion of the interpolated image is not mapped from the given displacement vectors, zero displacement is often assumed most probable and the missing region is mapped from the corresponding region in one of the two reference image. However, for stereopairs only a single plane in the three-dimensional scene will exhibit zero displacement, and using replication from one of the given views for these unmapped regions results in unsatisfactory synthesis performance. Ribas-Corbera and Sklansky addressed the problem of ambiguously refer-enced regions by assuming a static background and no inter-object occlusion [10].Our technique attempts to handle potentially large occluded regions, without requiring multiple views, by infer-ring depth information for these regions from the estimated disparity of adjacent unoccluded regions. We attempt to handle ambiguously referenced regions more appropriately for stereopairs by evaluating the estimation performance for the disparity values in question.3. SYNTHESIS ALGORITHMWe assume that the cameras used to capture a given stereopair were separated by a horizontal distance and arranged in the parallel camera configuration, as detailed by Grinberg,et. al. [3]. A point in the scene generates corre-sponding points p l and p r in the left- and right-eye images, respectively. If the scene point is unoccluded (visible in both images), the disparity is defined as the distance, in pixels, between the corresponding points in the appropriately framed images. Due to the parallel camera axis geometry, the disparity is only in the horizontal direction and the rela-tionship between p l and p r is given by,(1)where is the disparity from the left pixel to the corresponding right pixel.Figure 1 depicts a simple scene containing a background and a single foreground object, in one-dimension. In Fig. 1a, the object and background are located at the distances they are perceived to lie based on their disparities.Interesting rays from the background to the eyes are included in the figure, and the foreground object and background have been shaded according to whether a particular portion is visible to both, one, or neither of the eyes. In Fig. 1b,the overlaid images have been separated for clarity and the disparity vectors for unoccluded portions have been indi-cated.The geometric relationship between unoccluded pixels in the given stereopair and the desired intermediate view can be derived from sample points lying along a disparity vector in Fig. 1b. The distance between the left and right eye is normalized to one. The desired intermediate view is then parameterized by its relative location (v), where . The mapping from the given left image to the position in the intermediate view is a function of disparity, as shown by the linear relationship,(2)The symmetrical relationship can be written for the right image. If the actual disparity values are known, the pixel intensity values for unoccluded regions are mapped easily from either given image to the point in the intermediate image. However, so far we have neglected two important considerations: 1) the effect of disparity vector estimation errors, and 2) the synthesis from occluded regions in the original stereopair. We next describe our solutions to these problems.In Fig. 2a, two disparity vectors pass through the desired intermediate pixel (x i ). This situation may arise whenp r x r y r x l d lr x l y l ,()+y l p l d lr x l y l ,()0+===d lr x l y l ,()0v 1<<p i x iy i x l vd lr x l y l ,()+y l ==Figure 1:an object lies in front of another object and the difference in disparities between the two objects is greater than thewidth of the foreground object. However, ambiguously referenced regions are most likely the result of disparity esti-mation errors. We select the most probable disparity for ambiguously referenced pixels through the use of a disparityestimate confidence measure. In our synthesis algorithm, we perform block-based disparity estimation in both direc-tions. We first attempt to eliminate false estimates due to occluded regions with a procedure similar to one proposedby Cafforio,et. al. [1]. If only a single vector was detected as coming from an unoccluded region, this vector is usedto perform the mapping. Otherwise, the ambiguously referenced intermediate pixel is mapped using the disparity vec-tor with maximum estimation confidence. We use the signal-to-noise ratio between the desired and estimated blocksfrom the disparity estimation procedure as the confidence measure, since this provides an easily calculated indicationof estimation performance [5].Figure2:Figure 2b illustrates generating an intermediate image pixel from an occluded region, where the occlusion is in the left image. Since disparity is undefined for occluded regions, we cannot use Eq. (2) directly to map pixel intensi-ties from these regions. We handle the synthesis from occluded regions by making best reasonable assumptions of thescene. These assumptions are that occluded regions have constant depth, and that this depth is equal to the depth ofthe unoccluded region located on the appropriate side of the occlusion. If the occlusion is visible in the left image, theappropriate side is to the left of the occlusion, and vice versa for an occlusion in the right image (see Fig. 1a). Theseassumptions, when valid, allow for depth information to be inferred for occluded regions, resulting in accurate inter-mediate view synthesis for these regions.With these tools to handle ambiguously referenced pixels and the synthesis from occluded regions in hand, we proceed with the complete intermediate view synthesis algorithm. Synthesis is performed separately from both leftand right images, and then the individual intermediate views are combined into the final synthesized view. This seem-ingly redundant process allows us to minimize the effect of disparity estimation errors and to select the correct map-ping for occluded regions.Our occlusion detection procedure is similar to one proposed by Cafforio, et. at.; however, our procedure takes the form of a classic detection problem, and does not require a search step [1, 13]. For each pixel in both images, wesum the disparity vector in one direction with the corresponding disparity vector in the opposite direction. If the abso-lute value of the sum is greater than a threshold the pixel is assumed to be occluded. The threshold is derived fromstatistical descriptions of disparity estimates for occluded and unoccluded regions.The actual synthesis from both images then is performed using the estimated and processed disparity values and Eq. (2). All disparity values detected as coming from unoccluded regions are used to map the pixel intensity values to the intermediate image pixels. If the intermediate pixel is mapped by more than one disparity vector, the vector with maximum block SNR is used for the mapping. The image block SNR (in dB) is given by,(3)where and respectively denote the original image block variance and prediction block mean squared error. For the case of one or more valid mappings, the intermediate pixel is marked as being mapped from an unoccluded region.If no disparity values map to a particular intermediate pixel, the intermediate pixel is marked as coming from an occluded region. After the intermediate view has been synthesized from all unoccluded regions, these missing pixels are mapped using the relationship established for the pixels on the appropriate side of the occlusion (e.g., the mapping on the left side of the occlusion for the synthesis from the left reference image). After mapping a set of intermediate image pixels resulting from occluded regions, the disparity values used for the pixels bounding this set are examined to verify that the occluded portion was in fact visible in the reference image. For example, if the synthesis is being performed from the left image and the bounding disparity values indicate that the object to the right of the occlusion lies in front of the object to the left, we conclude that the occluded portion was present in the left image. If the occluded region was mapped correctly it is marked as such, otherwise the pixels are marked as being incorrectly mapped from occluded regions. This information is used in the decision process when the two separately synthesized intermediate views are combined, which is the final step.The selection between choosing the pixel intensity value from the view synthesized from the left or right image is based on the mapping performed and the relative signal-to-noise ratios. The order of preference for the selection is as follows: 1) pixels mapped from unoccluded regions over those from occluded regions, 2) pixels correctly mapped from occluded regions over those incorrectly mapped, and 3) pixels mapped using disparity values with higher SNR.SNR 10σ2σe2-----log =σ2σe 24. EXPERIMENTAL RESULTSWe have examined eight image pairs in varying degrees of detail; in this section we discuss the synthesis results of one exemplary stereopair. The initial disparity estimates were obtained from an exhaustive search, block-based displacement estimation technique, where the block sizes and disparity search ranges were manually defined. The disparity estimation included the realistic possibility of a vertical disparity component, which was handled by extend-Figure3:ing the occlusion detection procedure and the geometric mapping relationship to two dimensions.An “original” stereopair and two intermediate views were obtained from four frames of the Flower Garden monoscopic image sequence (Stereopair: Figs. 3a and 3b; Intermediate views: Figs. 3c and 3d). Since the motion in this sequence is almost entirely horizontal camera motion, two temporally offset frames provide an effective ste-reopair. A block size of 5 pixel widths and 8 pixel heights was selected, and the search range was±18 horizontal and ±3 vertical pixels.The occluded regions in the left-eye image are the regions to the left of the large foreground tree and the left image borders, and vice versa for the right-eye image. The occluded portions are estimated to occupy roughly 7% of the original stereopair. The reader is encouraged to inspect especially these areas in the following synthesized views to evaluate the performance of the algorithm.Twenty equally spaced intermediate views were synthesized from the original stereopair (Figs. 3a and 3b).Assuming that Figs. 3(a, c, d, b) are equally spaced, synthesized Figs. 3(e, f) correspond to Figs. 3(c, d). A binocular imaging system equipped with a head-tracking device was used to display the appropriate stereopair based on the viewer’s horizontal position. A “stereo-dial” was also incorporated in the imaging system to allow the viewer to spec-ify the inter-camera separation [8]. Viewers reported effective motion parallax and diminished eye strain with this system.The error images for these two intermediate views are shown in Figs. 3g and 3h, where the absolute value of the error signal has been normalized to the range [0, 255]. As expected, the residuals are small, but relatively largest at the left and right edges of the foreground objects, especially the tree. Note that since we do not know that Figs. 3(a, c, d, b) are exactly equally spaced, the technique may actually be even better than the comparison of (c) against (e) and(d) against (f) suggests.5. CONCLUSIONWe have presented a technique for the synthesis of intermediate views from a single stereopair that can accu-rately handle occluded and ambiguously referenced regions. The gain in terms of improved synthesis for “difficult”regions is obtained with a relatively small increase in the number of processing steps compared with techniques that do not consider these regions. We have provided experimental results that illustrate the algorithm’s synthesis perfor-mance for both unoccluded and occluded regions. The majority of the imperfectly synthesized image regions were located at the discontinuity between occluded and unoccluded regions. The errors are most likely due to the blocking effects of the disparity estimation procedure and the inability of the occlusion detection scheme to precisely find the edges of occluded regions. Errors may also occur when objects are actually visible in the intermediate view, but are occluded from both of the images in the stereopair used to estimate this view.Our future work will address improving the performance of the disparity estimation and occlusion detection steps. If successful, this will reduce the errors now present at occlusion discontinuities. We also plan to increase the computational efficiency of this algorithm to avoid the need to pre-compute the intermediate views used in the exper-iments.6. REFERENCES[1]. C. Cafforio, F. Rocca and S. Tubaro, “Motion compensated image interpolation”,IEEE Trans. on Communica-tions, V ol. 38, No. 2, February 1990, pp. 215-222.[2]. T. Fujii and H. Harashima, “Data compression of an autostereoscopic 3-D image”, Technical Report, Universityof Tokyo, 1994.[3]. V. S. Grinberg, G. Podnar and M. W. Siegel, “Geometry of binocular imaging”,Proc. SPIE Internat. Conf. onStereoscopic Displays and Virtual Reality Systems, V ol. 2177, San Jose, CA, 6-10 February 1994, pp. 56-65. [4]. R. Hsu, K. Kodama and K. Harashima, “View interpolation using epipolar plane images”,Proc. IEEE Internat.Conf. on Image Processing, V ol. 2, Austin, TX, 13-16 November 1994, pp. 745-749.[5]. A. K. Jain,Fundamentals of Digital Image Processing, Prentice Hall, Englewood Cliffs, NJ, 1989, Chapter 3, pp.59.[6]. A. Katayama, K. Tanaka, T. Oshino and H. Tamura, “A viewpoint dependent stereoscopic display using interpo-lation of multi-viewpoint images”,Proc. SPIE Internat. Conf. on Stereoscopic Displays and Virtual Reality Sys-tems II, V ol. 2409, San Jose, CA, 7-9 February 1995, pp. 11-20.[7]. J.-S. Kim and R.-H. Park, “Local motion-adaptive interpolation technique based on block matching algorithms”,Signal Processing: Image Communication, V ol. 4, No. 6, November 1992, pp. 519-528.[8]. J. S. McVeigh, V. S. Grinberg and M. W. Siegel, “Double buffering technique for binocular imaging in a win-dow”,Proc. SPIE Internat. Conf. on Stereoscopic Displays and Virtual Reality Systems II, V ol. 2409, San Jose, CA, 7-9 February 1995, pp. 168-175.[9]. S. Pastoor, “3D-television: A survey of recent research results on subjective requirements”,Signal Processing:Image Communication, V ol. 4, No. 1, November 1991, pp. 21-32.[10]. J. Ribas-Corbera and J. Sklansky, “Interframe interpolation of cinematic sequences”,Journal of Visual Commu-nication and Image Representation, V ol. 4, No. 4, December 1993, pp. 392-406.[11]. R. Skerjanc and J. Liu, “A three camera approach for calculating disparity and synthesizing intermediate pic-tures”,Signal Processing: Image Communication, V ol. 4, No. 1, November 1991, pp. 55-64.[12]. R. Thoma and M. Bierling, “Motion compensating interpolation considering covered and uncovered back-ground”,Signal Processing: Image Communications, V ol. 1, No. 2, October 1989, pp. 191-212.[13]. H. L. Van Trees,Detection, Estimation, and Modulation Theory, John Wiley & Sons, New York, 1968, Chapter2, pp. 19-46.[14]. C. D. Wickens, “Three-dimensional stereoscopic display implementation: Guidelines derived from humanvisual capabilities”,Proc. SPIE Internat. Conf. on Stereoscopic Displays and Applications, V ol. 1256, Santa Clara, CA, 12-14 February 1990, pp. 2-11.1. This research was supported by the Advanced Research Projects Agency under ARPA Grant No. MDA 972-92-J-1010.2. We speculate that those viewers who have difficulty fusing stereopairs may derive as much stereopsis sensationfrom the reduced depth range image as other viewers who have no difficulty derive from increased depth range.These assessments are informal in the sense that designed and controlled human factors experiments were not con-ducted. They are our impressions based on perceptions reported by colleagues and the many visitors to our lab.Figure 1: Sample scene in 1-D (pixels represented by tic-marks on image scan-lines). (a). Scene from viewer’sperspective, where objects are placed at the distance they are perceived to lie based on disparity, (b). Image scan-lines showing disparity vectors and occluded regions for sample scene. Shaded area represents disparity between corresponding points.Figure 2: Disparity structures for “difficult-to-synthesize” regions. (a). Ambiguously referenced intermediate pixel.Two disparity vectors reference the lightly-shaded area. (b). Intermediate pixel resulting from occluded portion visible in left image. Dashed disparity vectors provide inferred mapping relationship for occluded region.Figure 3:Flower Garden views: (a). Original left image (frame 0), (b). Original right image (frame 3), (c). Originalintermediate view (frame 1), (d). Original intermediate view (frame 2), (e). Synthesized intermediate viewat v= (PSNR=24.97 dB), (f). Synthesized intermediate view at v= (PSNR=24.62 dB), (g). Error image for (c) vs. (e), (h). Error image for (d) vs. (f).13--23--ObjectFigure 1:a.b.BackgroundLeft eyeRight eyeScreen surfaceVisible to:Both Left Right NeitherRight imageLeft imageIntermediate 1vRight imageLeft imageIntermediateAppropriate sidex ib.Right imageLeft imageIntermediatex ia.Figure 2:1v1va .b .c .d .F i g u r e 3:e .f .g .hF i g u r e 3: (c o n t .)。
Dear Hiring Manager,I am writing to express my interest in the [position/role] at your esteemed organization. After researching your company and understanding the requirements of the position, I am confident that my skills, experience, and qualifications make me a strong candidate for the role.I have [years of experience/a degree in [field of study]] from [university/college name], which has provided me with a solid foundation in [relevant skills or knowledge]. Throughout my academic and professional journey, I have developed a strong passion for[industry/field] and have consistently strived to enhance my skills and knowledge in this area.In my previous roles, I have successfully [mention specific achievements, such as leading projects, improving processes, or exceeding targets]. These experiences have equipped me with the necessary skills to excel in the [position/role] at your company. I am a highly motivated individual who thrives in fast-paced environments and am capable of adapting to new challenges quickly.One of the key reasons I am drawn to your company is its reputation for [mention specific company values, such as innovation, inclusivity, or commitment to sustainability]. I am particularly impressed by [mention specific initiatives, projects, or achievements of the company]. I believe that my values align closely with those of your organization,and I am excited about the opportunity to contribute to your ongoing success.In addition to my professional experience and qualifications, I am also a strong advocate for continuous learning and personal development. I regularly attend relevant industry conferences, workshops, and training sessions to stay up-to-date with the latest trends and best practices in [field]. I am confident that my commitment to lifelong learning will enable me to adapt to any new requirements or challenges that may arise in the role.I have attached my resume for your review, which provides furtherdetails about my background and experiences. I would be grateful for the opportunity to discuss how my skills and qualifications align with the needs of your company in more detail. Please feel free to contact me at [your phone number] or [your email address] to schedule a conversation at your convenience.Thank you for considering my application. I am excited about the possibility of joining your team and contributing to the continued growth and success of your company.Sincerely,[Your Name]。
快递常用语言中英文对照版词汇篇:快递公司:express company快递员:courier personal始发地:departure发件人:shipperPlease tell me the name of shipper.收件人:consignee电话号码: phone number姓名:namePut your name here. Writer down your name here.地址:address※注:英文地址的书写原则:从最小的单位写到最大的单位Example:上海市徐汇区肇嘉浜路1065号2402室Room 2402, No. 1065, Zhaojiabang Road, Xujiahui District, Shanghai运单:waybill/ shipping order air transport waybill (航空运单)签名:Sign your name! signature首重:preset weight续重:extra weight查扣:confiscate贵公司、贵部门:your company上门取件:door-to-door collection and delivery service for customers 姓氏+先生、小姐:Mr. Mrs.※注:英文人名的构成,怎样区分姓和名英文人名名在前,姓在后怎么辨别姓氏:Monica White (White是其姓氏)零公里速递服务平台:Infinite Express Service Platform常用语句篇:您说、请讲。
Please.是的,嗯,知道,明白。
En, I got it.还请您阅读一下。
Please read it.打扰一下,请您在这里签个字。
Excuse me,please sign your name here.请让我来帮您包装快件吧?Let me pack your parcel.真是对不起,刚才搞错了,我马上更正,请您谅解。
招聘广告缩略语中英文对照abbreviation来源时间1天前阅读699 次字体[ 大中小] [收藏] [划词已启用] 评论0 条外企的招聘广告中常常有很多缩略语,让国人看起来头疼不已。
下面是一些此类广告中常见的缩略语,帮助你看懂广告、“对职出招”。
admin: administrative行政的Jr: junior初级freshman newcomer seniorad/adv: advertising 广告advertisementK: 1000元agcy: agency经销商knowl: knowledge 知识appt: appointment约会、预约loc: location 位置、场所address. Avenue street perfumeasst: assistant助理Lv/lvl: level 级/层attn: attention给, 与……联系to advise sb to do/ pay attention to doingmach: machine 机器bkgd: background 背景manuf/mf: manufacturing 制造bldg: building 建筑物、大楼mech: mechanic机械的M&E engineerbus: business 商业、生意mgr: manager 经理mgt management meetingclk: clerk (办公室)职员m-f: Monday-Friday 从周一到周五co: company 公司co, ltd limited detailsmth: month 月coll: college 大专(学历)nec: necessary必要的comm: commission 佣金consultant reimbursementoppty: opportunity机会corp: corporation (有限)公司companyot: overtime 超时data pro: data processing 数据处理process owner sap site construction is proceeding perm: permanent永久性的dept: department 部pls: please 请dir: director 董事boardpos: position 职位div: division 分工、部门dividepref: preference (有经验者)优先inexperienced experienced externaleqpt: equipment 装备prev: previous有先前的(经验)etc.: and so on 等等P/T: part time 兼职(的)full timeevngs: evenings 晚上evngsrefs: references 推荐信exc: excellent 很好的rel: reliable 可靠的exp: experience 经验reps: Representative (销售)代表exp'd: experienced 有经验的req: required 需要ext.: extension 延伸、扩展ext NOsal: salary 工资fr. ben: fringe benefits 额外福利Benefit sb’s benefit sth from sctry: secretary 秘书F/T: full time 全日制sh: shorthand人手不足gd: good 好sr: senior 资深grad stdntgrad: graduate毕业stdnt: student 学生hosp: hospital 医院hospstmts: statement s 报告hdqtrs : headquarters 总部hdqtrstech: technical技术上hr hour: 小时$3/hrtel/ph: telphone 电话cellphonehrly: hourly 每小时temp: temporarily 临时性(工作)HS: high school 高中(学历)Trans: transportation交通Immed: immediate 立即trnee: trainee实习生incl: including 包括typ: typing/typist 打字/打字员ind: industrial工业的wk: week/work 周/工作inexp: inexperienced 无经验的Wpm: words per minute 打字/每分钟int'l: international国际性的yr(s): Year(s) 年arrowhead慈菇asparagus芦笋balsam apple苦瓜bamboo sprout竹笋bean豆荚,蚕豆beet甜菜cabbage卷心菜carrot胡萝卜cassava木薯cauliflower花菜celery芹菜Chinese cabbage白菜,青菜Chinese eddo芋艿chive细香葱coriander香菜cow pea豇豆cress水芹cucumber黄瓜dried bamboo shoot笋干eggplant茄子garlic蒜garlic sprout蒜苗ginger姜green pea嫩豌豆green pepper青椒hot pepper辣椒kale甘蓝菜leek韭菜legume豆荚lentil小扁豆lettuce莴苣,生菜lotus roots藕marrow西葫芦(我更偏爱糖葫芦) marrow bean菜豆mushroom蘑菇mustard芥菜,芥末onion洋葱pea豌豆pepper胡椒,辣椒potato土豆pumpkin南瓜radish萝卜rape油菜red pepper红辣椒romaine我句,生菜salted vegetable咸菜scallion葱shepherd’s purse荠菜snake gourd丝瓜soy大豆Spanish potato番薯spinach菠菜straw mushroom草菇string bean刀豆sweet pepper甜椒taro芋艿tomato番茄toon香椿turnip芜菁water chestnut荸荠water shield莼菜wax gourd冬瓜yam山药中英文对照:房屋租赁合同来出租方(甲方)Lessor (hereinafter referred to as Party A) :承租方(乙方)Lessee (hereinafter referred to as Party B) :根据国家有关法律、法规和有关规定,甲、乙双方在平等自愿的基础上,经友好协商一致,就甲方将其合法拥有的房屋出租给乙方使用,乙方承租使用甲方房屋事宜,订立本合同。
联系方式用英语怎么说contact way请牢记,每个企业或组织的联系方式中至少包含一个管理层和一个具体事务联系人的联系方式。
Please be reminded that all organizations must have a contact listing for their top executive and at least one contact point.联系方式:在简历的顶端列出你的联系方式。
Contact Information: List your contact information at the top of the resume.请牢记,每个企业或组织的联系方式中至少包含一个管理层和一个具体事务联系人的联系方式。
Please be reminded that all organizations must have a contact listing for their top executive and at least one contact point.Aardvark是一种联系方式,你能够通过Aardvark联系任何地方的人。
Aardvark is a contact that you can get in touch with from anywhere.同样,你也能够通过邮件与我们取得联系,邮件联系方式是:1601S.CaliforniaAvenue,PaloAlto,CA94304.You may also contact us by mail at 1601 S. California Avenue, Palo Alto, CA 94304.例如,如果要发出一条UPDATE语句来更改某个特定客户的联系方式信息中的email地址,就必须在 XML 列中提供全部联系方式信息,而不但仅是新的email 元素值。
For example, if you want to issue an UPDATE statement to change the e-mail address of a particular client's contact information, you simply have to supply the new e-mail address.交换生组织为交换生提供联系人或联系方式,以在必要时协助他们。
出国旅游常用英语一览表问候、感谢、交际、询问See you later 再见! Could you do me a favor?能够帮我忙吗?Take care 保重!Please say it again 请再说一次 Yes,I think so 我也这样认。
Anyway 总之 Have a nice trip 祝你旅途平安!By the way 顺便提一下May I have you name? 请问你贵姓?Besides 另外,况且Thank you for your help 谢谢你的帮助。
May I use this phone? 能够使用电话吗?You are welcome 不用谢. May I sit here?能够坐在这里吗?That's right 你说的对May I ask something? 我想问点事情Excuse me,Is there .。
near by? 请问附近有没有。
.。
?Is there a baker near by? 请问附近有没有面包店?bus stop公车站/ department store 百货公司/ post box 邮政局police station here? 附近有警察局吗?Where is the toilet / lavatory/wash room? 厕所在哪里?Whom should I ask to?我应该问谁? As soon as possible 近快——- I'm in a hurry 我时间很急I'm lost 我迷路了What is this for? 这是做什么的?It is important 这非常重要I feel sick 我感觉不舒服I have a reservation. 我做了预订。
This is my voucher。
这是我的凭证。
I’m just looking. Thank you.就是看看,谢谢I’d like to see this我想看看这个搭乘飞机用语boarding check登机牌plane ticket飞机票飞机票(指限定条件)endoresement/restrictions旅客姓名name of passenger旅行经停地点good for passage between 起点城市from 起飞日期date起飞时间time 订座情况status 机票确认ticket confirm 登机口gate前往城市to承运人(公司)carrier 航班号flight no。
英语作文寄信时地址填写When writing a letter, one of the most important aspects is the proper formatting and inclusion of the address on the envelope. The address serves as the roadmap for your letter to reach its intended recipient, so it is crucial to ensure that it is written correctly and includes all the necessary information. In this essay, we will explore the key elements of addressing an envelope and provide guidance on how to format the address properly.The first and most essential component of the address is the recipient's name. This should be written in full, including their first and last name, and should be placed at the top of the address. It is important to ensure that the spelling of the recipient's name is accurate, as any errors can cause delays or even prevent the letter from reaching its destination.Beneath the recipient's name, the next line should include the street address or post office box number. This should be written in a clear and concise manner, with the street number and name separated by a space. If the address includes a unit or apartment number, it shouldbe included on this line as well, typically after the street name and separated by a comma.The third line of the address should include the city and state or province. The city should be written in full, without any abbreviations, and should be followed by a comma. The state or province should be written using the appropriate two-letter abbreviation, as recognized by the postal service.The final line of the address should include the country and postal code, if applicable. The country should be written in full, and the postal code should be placed immediately after, without any spaces or punctuation.It is important to note that the format of the address may vary slightly depending on the country or region to which the letter is being sent. For example, in some countries, the postal code may be placed before the city and state, or the country may be written at the end of the address rather than the beginning.When addressing an envelope, it is also important to consider the placement and alignment of the address. The address should be centered on the envelope, with the recipient's name at the top and the other elements of the address stacked below it. The address should be written in a clear and legible font, using a dark-colored inkthat will be easily visible on the envelope.In addition to the recipient's address, the envelope should also include the return address of the sender. This should be placed in the top left corner of the envelope, and should follow the same format as the recipient's address, with the sender's name at the top, followed by the street address, city and state, and postal code or country.It is also important to note that the envelope should be free of any unnecessary markings or decorations, as this can interfere with the postal service's ability to process and deliver the letter. The envelope should be clean, free of stains or smudges, and should be properly sealed to ensure the privacy and security of the contents.In conclusion, addressing an envelope correctly is an essential aspect of writing a letter. By following the proper formatting guidelines and including all the necessary information, you can ensure that your letter reaches its intended recipient in a timely and efficient manner. Whether you are sending a personal letter to a friend or family member, or a business letter to a client or colleague, taking the time to address the envelope properly can make a significant difference in the successful delivery of your correspondence.。
Certificate Number 20171128-E135493Report ReferenceE135493-A36-ULIssue Date2017-NOVEMBER-28Bruce Mahrenholz, Director North American Certification ProgramUL LLC Issued to:VICOR CORP25 FRONTAGE RDANDOVER, MA 01810-5424 UNITED STATESThis is to certify thatrepresentative samples ofPower Supplies for Information Technology Equipment Including Electrical Business Equipment See Addendum.Have been investigated by UL in accordance with the Standard(s) indicated on this Certificate.Standard(s) for Safety:UL 60950-1, (Information Technology Equipment - Safety - Part 1: General Requirements)CAN/CSA C22.2 No. 60950-1-07, (Information Technology Equipment - Safety - Part 1: General Requirements) Additional Information:See the UL Online Certifications Directory at /database for additional informationOnly those products bearing the UL Certification Mark should be considered as being covered by UL's Certification and Follow-Up Service.The UL Recognized Component Mark generally consists of the manufacturer’s identification and catalog number, model number or other product designat ion as specified under “Marking” for the particularRecognition as published in the appropriate UL Directory. As a supplementary means of identifying products that have been produced under UL’s Component Recognition Program, UL’s Recognized Component Mark: , may be used in conjunction with the required Recognized Marks. The Recognized Component Mark is required when specified in the UL Directory preceding the recognitions or under “Markings” for the individual recognitions.Recognized components are incomplete in certain constructional features or restricted in performancecapabilities and are intended for use as components of complete equipment submitted for investigation rather than for direct separate installation in the field. The final acceptance of the component is dependent upon its installation and use in complete equipment submitted to UL LLC.Look for the UL Certification Mark on the product.Certificate Number 20171128-E135493Report ReferenceE135493-A36-ULIssue Date2017-NOVEMBER-28Bruce Mahrenholz, Director North American Certification ProgramUL LLC This is to certify that representative samples of the product as specified on this certificate were tested according to the current UL requirements.DC-DC ConverterModel: Low Voltage 3814 VIA BCM and VIA NBM Series(see Additional Information or Miscellaneous Enclosure 7-01 for Model nomenclature)UL TEST REPORT AND PROCEDUREThis is to certify that representative samples of the products covered by this Test Report have been investigated in accordance with the above referenced Standards. The products have been found to comply with the requirements covering the category and the products are judged to be eligible for Follow-Up Service under the indicated Test Procedure. The manufacturer is authorized to use the UL Mark on such products which comply with this Test Report and any other applicable requirements of UL LLC ('UL') in accordance with the Follow-Up Service Agreement. Only those products which properly bear the UL Mark are considered as being covered by UL's Follow-Up Service under the indicated Test Procedure.The applicant is authorized to reproduce the referenced Test Report provided it is reproduced in its entirety.UL authorizes the applicant to reproduce the latest pages of the referenced Test Report consisting of the first page of the Specific Technical Criteria through to the end of the Conditions of Acceptability.Any information and documentation involving UL Mark services are provided on behalf of UL LLC (UL) or any authorized licensee of UL. Prepared by: James C. Powley Reviewed by: Lesley GreenLow Voltage VIA BCM and VIA NBM Model Matrix: AAA3814cddewwxxyzz Example: BCM3814V60E15A3T01。
国际货代英文邮件常用语Dear [Contact Name],I hope this email finds you well. I am writing to discuss the common phrases and expressions used in international freight forwarding emails. As an international freight agent, it is important to communicate effectively with clients, partners, and colleagues in English. Mastering the appropriate vocabulary and phrases will help ensure smooth and efficient communication. In this email, I will provide you with a comprehensive list of commonly used English phrases in international freight forwarding emails.1. Opening- Greeting: Dear [Contact Name], Hello [Contact Name],- Introduction: I hope this email finds you well. I am writing to...2. Requesting Information- I would like to inquire about...- Could you please provide me with the following information:- I am interested in obtaining details about...3. Providing Information- Thank you for your inquiry regarding [specific topic].- In response to your question/request, please find below the information you seek:- I am pleased to inform you that...4. Quoting and Pricing- Based on your requirements, we have prepared a quotation for your consideration.- Please find attached our quotation for the requested services.- The total cost for this shipment is...5. Booking and Confirmation- We would like to confirm our shipment/book your services.- Please consider this email as our official booking/confirmation.- Kindly acknowledge the receipt of this email to confirm the booking.6. Shipment Updates- We are happy to inform you that your shipment has been pickedup/sent.- Your cargo is currently in transit and is expected to arrive on [date].- We regret to inform you that there has been a delay in the delivery of your shipment.7. Documents and Customs- Please find attached the shipping documents for your reference.- Kindly provide us with the necessary customsinformation/documentation.- We will assist you in completing the required customs paperwork.8. Payment Terms- Please find attached our invoice for the services rendered.- Payment should be made within [number of days] from the date of the invoice.- We accept payment via [payment method].9. Feedback and Complaints- We appreciate your feedback and would like to address any concerns you may have.- We apologize for any inconvenience caused and will work towards a resolution.- Your satisfaction is important to us, and we value your input.10. Closing- Thank you for your attention and prompt action.- Should you require any further assistance, please do not hesitate to contact us.- We look forward to a successful partnership.I hope the above phrases will assist you in your international freight forwarding emails. It is important to adapt and modify these phrases according to the specific context and requirements of each email. Always maintain a professional tone and clear communication. Should you have any further questions or need additional assistance, please feel free to reach out.Best regards,[Your Name][Your Title/Position] [Your Company Name]。
Unconstraining GenericityMark EveredUniversity of UlmContact Address:Dr. Mark EveredAbteilung RechnerstrukturenUniversität Ulm89069 UlmGermanyTelephone:+49 731 5024179FAX:+49 731 5024182Email:markev@informatik.uni-ulm.deAbstract:Generic classes and especially generic collection libraries can be of great benefit for efficient software production. Constrained genericity is used to guarantee that the type provided as a parameter to a generic class such as a sorted list will offer the methods that class requires. In this paper we argue that constrained genericity is not really the appropriate mechanism for this purpose since it restricts a generic class to one kind of use for each element type. We introduce the concept of 'generic procedure parameters' which allow the properties of a collection class to be specified in the instantiation rather than via the properties of the elements. We show that the concept is very efficiently implementable, more powerful than constrained genericity and more useful for the practical construction of complex data collections.1 IntroductionReusability is an essential factor in efficient software production. Object-oriented programming languages support the reuse of code by providing inclusion polymorphism in the form of inheritance mechanisms. Many commonly-used object-oriented languages also support code reuse by providing parametric polymorphism via some form of generic class definition.Genericity is supported implicitly in untyped languages such as Smalltalk[GR89]. This implicit genericity generally allows more than intended, however. A single generic list may simultaneously contain an integer, a person object and a spoon object. Ada[DoD81] is an example of a strongly-typed language which allows the definition of both generic subprograms and generic modules (packages). Strongly-typed object-oriented languages can combine genericity with inheritance to allow both flexibility and type safety. A 'person_set' can then be defined to contain only objects of type 'person' or a subtype of 'person' such as 'student'. Examples of mechanisms for genericity in object-oriented languages are the 'templates' of C++[Str89], the 'generic classes' of Eiffel[Mey92] and the 'generic modules' of Modula-3[Car92].One of the most important aspects of both system and application programming is the definition and use of data structures for managing collections of data and one of the main uses for genericity is therefore the definition of generic collection types such as 'list' and 'set'. For each widely-used object-oriented language there exists a standard library of collection classes defined generically over the element type. Because such classes are so important for practical software production, there seems now to be wide-spread agreement that even languages such as Java[GJS96], for which a principal design aim was simplicity, should be extended to allow generic class definitions.Recently, a number of proposals have been made for adding genericity to programming languages. Myers et al. [MBL97] have defined an extension of Java in which types can be parameterised (by other types) and have shown how this can be implemented either with or without an extension to the Java Virtual Machine. In the language Pizza[OW97], Odersky and Wadler have extended Java to allow parametric polymorphism, higher-order functions and algebraic types. Roe and Szyperski [RS97] have recently made a proposal as to how 'lightweight' parametric polymorphism can be added to Oberon.One of the major issues in these proposals is how to support constrained genericity (or bounded parametric polymorphism). Constrained genericity allows the programmer of a parameterised type to place a constraint on which types can be provided as parameters. This constraint is of the form that the actual type parameter must have certain methods which the parameterised type can then use. An example is a 'compare' method which is used by a generic 'Sorted_List' class to decide where a new element should be inserted in the list. The Oberon proposal supports only 'unconstrained' genericity with the general constraint that an actual type parameter must be a reference type. This means that only operations known to apply to any reference type can be used on objects of the type parameter. Pizza uses F-bounded polymorphism to restrict the actual type parameters. The proposal by Myers et al. allows a 'where clause' to be associated with each formal type parameter. This indicates directly the method signatures which a type must offer in order to be a valid actual parameter.In this paper we aim to show that while it is indeed necessary for a generic class to use certain operations in manipulating objects of type parameter types, constrained genericity is often not the appropriate way of achieving this. In the following section we give an example of a typical practical programming task which can be more efficiently programmed using genericity. This serves as a basis for investigating the requirementsfor providing a good mechanism. In the third section we summarise the various alternatives for achieving constrained genericity and argue that none of them solves the problem satisfactorily.In the fourth section we propose an alternative to constrained genericity in which the operations required by a parameterised type are not a property of the actual type parameters but a property of the instantiation process on the parameterised type. We show that an extension of our mechanism to allow defaults can also provide constrained genericity for the cases where this is really required.2 An Example using CollectionsIn order to investigate the requirements for a mechanism for genericity we use the example of an 'employees' class which maintains information about the employees of a company. We want the class to allow:•access to and updating of employee information via a unique employee number •search for an employee by name, returning a sorted list of all employee numberswhere the name matches•iteration over all employee names in alphabetical order•iteration over all employee names in the order of the postal code of the employee's addressAll of these operations should be efficiently implemented. For security and consistency reasons, no reference to an individual employee record should be passed out of the 'employees' class. Such a class could be defined as follows1:interface Employees {int new_emp(String name, /* returns the new employee number */ Address address,Date date_of_birth,int salary);void remove_emp(int emp_num);String get_name(int emp_num);Date get_date_of_birth(int emp_num);void new_address(int emp_num, Address address);void new_salary(int emp_num, int salary);Int_List search(String name); /* returns a sorted list of employee numbers */ void start_name_scan();String get_next_name(); /* get next name in alphabetical order */void start_postal_scan();String get_next_by_post_code(); /* get next name in post code order */int number_of_employees();int total_of_all_salaries();...} /* end Employees */class Address {String house_number;String street;String city;int post_code;}interface Int_List {void insert(int i);...void start_scan();int get_next();}1 We use a single Java-like language throughout the paper for consistency.The class 'employees' can be implemented by using four internal data structures. The first two are sets of employee records which provide efficient access via an employee number and via a name. The other two are lists of employee records which maintain an ordering by name and by postal code. For each employee an employee record is created and inserted into each of these four structures. This is depicted in Fig. 1.Fig. 1: An 'employees' object with four internal data structuresThe four data structures can themselves be realised as abstract data types with various implementation possibilities. The sets could, for example, be implemented via hashing or via a search tree. The specifications of the data structures (with only the required operations shown) could look like this:class Emp_Info {int emp_num;String name;Address address;Date date_of_birth;int salary;}interface Emp_Set_With_emp_num_Key {void insert(Emp_Info e);Emp_Info find_one(int emp_num);void remove(Emp_info e);}interface Emp_Set_With_name_Search {void insert(Emp_Info e);Emp_Set_With_name_Search find_all(String name); /* returns a subset of theelements */ void start_scan();Emp_Info get_next(); /* iterator over all elements */ void remove(Emp_Info e);}interface List_Sorted_By_name {void insert(Emp_Info e);void start_scan();Emp_Info get_next(); /* iterator over all elementsin sorted order */ void remove(Emp_Info e);}interface List_Sorted_By_post_code {void insert(Emp_Info e);void start_scan();Emp_Info get_next();void remove(Emp_Info e);}If the structures are declared within an 'employees' implementation as:Emp_Set_With_emp_num_Key num_set;Emp_Set_With_name_Search name_set;List_Sorted_By_name name_list;List_Sorted_By_post_code postal_list;then an example of one the methods of the implementation could look like this: void new_address(int emp_num, Address address){Emp_Info e=num_set.find_one(emp_num);postal_list.remove(e);e.address=address;postal_list.insert(e);}It can be seen that the four data structures have much in common and that implementations for the set and list types would contain much duplicated code. A good mechanism for genericity will enable us to avoid as much of the duplication as possible and to define collection types and implementations which are suitable not only for this example but for general use as library classes with arbitrary element types2.The generic set and list classes must be able to perform some operations on objects of their element type. The sets must be able to check whether a particular element satisfies the search criterion. The lists must be able to compare two elements to maintain the prescribed order. These operations must be guaranteed as available for the generic code to use. The usual way of guaranteeing this is by constrained genericity. We therefore now examine various alternatives discussed in the literature for providing constrained genericity.3 Constrained Genericity3.1 The AimIn unconstrained genericity any type may be provided as an actual parameter to any type parameter of a generic class so that nothing can be assumed about the methods of the type except what is valid for all types. Depending on the language this may include methods for assignment, copying and equality. In many cases, including our example, these operations are not sufficient. The usual way of providing constrained genericity is via the inheritance mechanism. In Eiffel, for example, a formal generic type parameter can be declared in such a way that only subtypes of some specified type are allowed as actual parameters. For example, with the definitions:interface Orderable {boolean before(Orderable other);...}2 We could also avoid the duplication in the interfaces by extracting the common properties of sets and lists into a supertype 'Collection' but that need not be discussed here.generic class Ordered_List[Orderable ELEM] {...}the generic 'Ordered_List' class can use the method 'before' on objects of the type 'ELEM'. If 'Emp_Info' is defined as:class Emp_Info implements Orderable {...}then the type:Ordered_List[Emp_Info]is valid.3.2 Some ProblemsThere are two problems with this approach. Firstly, it is possible that the type 'Emp_Info' was defined before anyone thought of using it in a list and even before the type 'Orderable' was defined. It may even be a library class which can no longer be changed. Potentially, for each generic class to which it may be provided as a type parameter, a class would need to be a subtype of some special abstract type defined for that generic class.The second problem is that the type of the parameter 'other' in the 'before' method of 'Emp_Info' should really be 'Emp_Info' and not 'Orderable'. This can be accomplished by using a special type 'Mytype' (or 'like current' in Eiffel) which adapts to the class by which it is inherited. Since 'Mytype' is then used as a parameter type, however, it is a covariant type and can therefore lead to run-time type errors (or the necessity for link-time checks) in connection with inclusion polymorphism [Bru95].3.3 The SolutionsSupertyping and structural subtypingThe first problem can be solved by a mechanism which allows supertypes to be defined after their subtypes without the subtype definition being changed [Ped89]. For example, the definitions:class Emp_Info {boolean before(Emp_Info other);...}interface Orderable generalises Emp_Info, ... {boolean before(Orderable other);...}generic class Ordered_List[Orderable ELEM] {...}could be used to indicate that 'Emp_Info' is an acceptable parameter for 'Ordered_List'. Alternatively, instead of being explicit, the subtype relationship can be deduced from the method specifications offered by a class [AbC96]. This similarly allows the definition of a supertype after the subtype. The second problem is not solved by these mechanisms.Concept typesConcept types [Eve97] are a proposal for allowing explicit inheritance of method specifications without implying inclusion polymorphism. They are intended primarily for modelling the 'is a' relationship and for interface inheritance and allow so-called 'decremental specialisation' which includes covariant parameter types such as 'Mytype'. If 'Orderable' is defined as a concept type then the second problem is clearly solved since polymorphism is excluded. The first problem is not solved by this approach.F-bounded polymorphismF-bounded polymorphism [CCH89] can also be used to solve the second problem. In this approach, the type 'Orderable' is itself defined as a generic type:interface Orderable[OTHERTYPE] {boolean before(OTHERTYPE other);...}class Emp_Info implements Orderable[Emp_Info] {...}generic class Ordered_List[Orderable[ELEM] ELEM] {...}This also effectively prevents inclusion polymorphism. The approach is theoretically interesting since it shows that the problem of polymorphic use can be solved without additional language mechanisms but it appears unsuitable for practical use since the definitions become more complex and less intuitive. As with concept types, the first problem is not solved.MatchingMatching [BSG95] has been defined as a new relationship between object types which is weaker than the subtype relationship. Like concept types it allows for covariant parameter types and does not imply inclusion polymorphism. Unlike concept types, the matching relationship is defined structurally rather than explicitly, i.e. the compiler determines whether one type matches another on the basis of their method definitions. For example, given:interface Orderable {boolean before(Orderable other);...}class Emp_Info {public boolean before(Emp_Info other);...}the type 'Emp_Info' matches the type 'Orderable'. By defining constrained genericity in terms of matching rather than subtyping both of the problems described above are solved. This was in fact one of the main purposes in introducing matching. The approach has, however, been criticised [GM96] as being too complex since the programmer must deal with this additional implicit relationship as well as the usual subtyping relationship.33 A newer proposal [BPF97] has been made in which subtyping is completely replaced by matching (together with 'hash types'). There remain, however, both an implicit matching hierarchy and a mechanism for polymorphic use.Where clausesA second suggestion which solves both problems is the use of 'where clauses' [MBL97]. Here neither subtyping nor matching is used to constrain the type parameters. Instead each formal type parameter can have a 'where clause' associated with it which lists directly the operations a type must have in order to be a valid actual parameter for this formal parameter. For example the definition:generic class Ordered_List[ELEM]where ELEM { boolean before(ELEM other); } {...}could be used to indicate that the element class for an 'Ordered_List' must have a method 'before' with a parameter of its own type and a result of type boolean.It is not clear whether the mechanism in [MBL97] allows a 'where clause' of one type parameter to refer to another type parameter but this could in principle be allowed. The type 'Set' which allows efficient access via some 'key' could then be defined as: generic class Set[ELEM, ACCESS_TYPE]where ELEM { ACCESS_TYPE key(); },ACCESS_TYPE { boolean EQUAL(ACCESS_TYPE other); } {...}where 'key' is an operation for obtaining the key value of an element and 'equal' is an operation for comparing two keys.This is more difficult with matching. In order to express the constraint that 'ELEM' must match some type 'Element' containing a 'key' method with parameters of the type given as 'ACCESS_TYPE', the type 'Element' must itself be made generic.3.4 The Real ProblemGiven the 'where clause' versions of 'Set' and 'Ordered_List' and the 'Emp_Info' definition:class Emp_Info {int emp_num;String name;Address address;Date date_of_birth;int salary;boolean before(Emp_Info other); /* Compares objects alphabetically by 'name' */ int key(); /* Returns the employee number */}we can use:Set[Emp_Info, int]as a set type providing access via the employee number and:Ordered_List[Emp_Info]as a list type ordered by name. This is, however, only half of what we wanted. What about the set providing access by name and the list sorted by postal code? We cannot use the same generic 'Set' and 'List' classes for these since we would need new 'before' and 'key' methods and these are already defined on the element type 'Emp_Info' for our first two collections.Our example demonstrates that constrained genericity restricts the generic type 'List' to only one ordering for a particular element type (and similarly for 'Set'). In fact we mayhave defined 'Emp_num' without any 'key' or 'before' method at all and may not be able to change its definition. In that case we could not use it in any 'Set' or 'Ordered_List'.4 Unconstraining Genericity4.1 Type Parameters and Generic InstantiationThe problem with constrained genericity is that the operations required by a generic class are assumed to be methods of the types provided as parameters and this is often not what we really want. In many cases, including our example, we would prefer the operations to be a property of a particular collection type rather than a property of the element type. One way of achieving this would be to use unconstrained genericity for the element type and then pass the required operations as parameters to the constructor of the collection at run-time. This is possible in the language Pizza. The approach has a number of disadvantages however:•first class procedures must be supported by the language making it more complex to use and more difficult to implement.• a run-time cost is incurred.•the operations to be passed as parameters must be explicitly defined (and it is not clear where they belong).•contrary to expectations, two list types with the same element type would be considered to be the same type even if their ordering is different. (A similar problem is mentioned in this connection in [MBL97]).The first disadvantage can be avoided by embedding the operations in a new class and passing an object of this class to the constructor rather than the operations themselves. While this allows the language to be simpler, the amount of writing increases and the program clarity suffers.Our proposal is that the problem be solved by allowing the required operations to be provided directly as generic parameters at the time of generic instantiation. That is, in addition to types as generic parameters we also allow generic procedure parameters. The definitions for our example can then look like this:generic interface Set[ELEM, ACCESS_TYPE,ACCESS_TYPE ACCESS(ELEM e),boolean EQUAL(ACCESS_TYPE a1, ACCESS_TYPE a2) ] {void insert(ELEM e);void remove(ELEM e);void start_scan();ELEM get_next();ELEM find_one(ACCESS_TYPE a);Set find_all(ACCESS_TYPE a);}generic interface Ordered_List[ELEM,boolean BEFORE(ELEM e1, ELEM e2) ] {void insert(ELEM e);void remove(ELEM e);void start_scan();ELEM get_next();}Set[Emp_Info,int, /* key type */e.emp_num, /* key */a1=a2 /* key equality */] num_set;Set[Emp_Info,String, /* key type */, /* key */a1.equals(a2) /* key equality */] name_set;Ordered_List[Emp_Info,English_Alphabetical.before(,) /* ordering */] name_list;Ordered_List[Emp_Info,e1.address.post_code<e2.address.post_code /* ordering */] postal_list;Ordered_List[int, e1<e2] /* list for the result of the method 'search' */ Given these definitions, the generic procedure parameters can then be used in the algorithms of the generic class. For example:ELEM find_one(ACCESS_TYPE a) {ELEM e;......if EQUAL(a, ACCESS(e)) then ......}As can be seen in this example, the actual parameters to the generic procedure parameters need not be restricted to declared procedures but can also be expressions (assuming the formal generic procedure parameter has a result). In most cases, this obviates the need for declaring a new procedure.4.2 Checking Generic Procedure ParametersGeneric procedure parameters are declared with full type information for their parameters and results so that a generic instantiation can immediately be checked to see whether the actual parameters are appropriate. The actual parameter is essentially substituted for occurrences of the formal procedure parameter within the generic class. This does not, however, mean that any expression which would be valid within the generic class is a valid parameter. In order to maintain clarity and avoid curious side-effects, parameters are only allowed which would be valid (and have the same meaning) in the context of the generic instantiation and in the context of the generic class.In general, we can say that an expression <expr> is valid as the actual parameter for 'OP_NAME' in:generic class G[T1, T2,result_type OP_NAME(par_type1 p1, par_type2 p2) ]...}exactly when the definition:class T1 {}class T2 {}class some_new_name {result_type OP_NAME(par_type1 p1, par_type2 p2) {return <expr>}}would also be valid. Note that this allows the actual procedure parameter to be a subtype of the formal generic procedure parameter as defined according to co-/contravariance rules in [AbC96].The rule for checking generic procedure parameters without a result is essentially the same but with the passed procedure being used as a statement within 'some_new_name' instead of the 'return' statement.4.3 Simulation with Existing MechanismsHow far can we go in approaching this goal with existing mechanisms for genericity? One way we might try to solve the problem is to use constrained genericity together with inheritance. For example, we could define two subtypes of 'Emp_Info' with different 'before' methods and then use these types as the element types for our lists. Unfortunately, this does not work for our example. We want the same objects to be in both lists and the rules of inclusion polymorphism will forbid this.Another approach is to use unconstrained genericity for the type parameters and to pack the required operations into a new class and pass this as an additional generic parameter. This is the standard approach with the 'function classes' of C++ and it is used extensively in the C++ Standard Template Library[MS96]. Apart from the extra definitions and the cost of an extra method call for each use of the required operations, there is also a difficulty with parameter types in this approach. The parameters of the 'before' operation, for example, should be guaranteed to have the type of the elements in the list but this requirement cannot be expressed in C++. Matching can be used to express the requirement as a constraint on the additional generic parameter but only by defining the type to be matched as itself a generic type. 'Where clauses' can also be used to express the constraint if the 'where clause' of the additional generic parameter can refer to the generic parameter 'ELEM'.In any case, however, the solution remains clumsy and we think that the importance of clearly separating the requirements for a particular collection from the properties of the element type more than justifies the inclusion of our mechanism in a programming language.4.4 ImplementationOdersky and Wadler [OW97] have coined the terms 'homogeneous' and 'heterogeneous' translation as two ways of implementing generic classes. In heterogeneous translation the code is essentially recompiled for each instantiation of the generic class. This has the advantage that any type (including simple predefined types such as integer) can be allowed as actual generic parameters. It also has the advantage of incurring no run-time cost. The disadvantages of heterogeneous translation are that compilation is slower, that the object code may contain many duplications of essentially the same code and that the source code of the generic class must be available at the time of instantiation.In homogeneous translation the same precompiled object code is used by all instantiations. In order to achieve this the type parameters are generally restricted to reference types. For constrained genericity it must be possible to link the compiled generic code in some way to the operations which are to be called for a particular instantiation.Generic procedure parameters can be implemented in both ways and ideally a compiler would choose the form most suitable for each use of genericity. Heterogeneous translation can be realised by textual substitution and recompilation. In this case the invocation of the operations is as efficient as a macro mechanism. Unlike macros, however, the type information in the definition of the generic parameters can be used to ensure that the recompilation will be successful.Homogeneous translation can be achieved essentially by using the mechanism described at the beginning of section 4, but with the compiler doing the work. The operations given in the instantiation can be packed into a compiler-generated class. An object of this class is then automatically created and passed as an additional hidden parameter to the constructor of a generic class at run-time. This is similar to one of the implementation schemes described in [MBL97] for 'where clauses'.4.5 Defaults (and Constrained Genericity!)It can sometimes be convenient to specify defaults for generic procedure parameters so that they can be omitted in the instantiation. A simple extension to our mechanism allows this4:generic interface Ordered_List[ELEM,boolean BEFORE(ELEM e1, ELEM e2) else (e1<e2) ] { ...}Ordered_List[int] intlist; /* equivalent to: Ordered_List[int,e1<e2] intlist; */ If the last generic parameters have defaults they can simply be omitted. If a parameter in the middle of the generic parameter list is omitted, commas must be used to maintain the correct position of the following parameters. In effect the default is used to textually complete the instantiation before it is checked.As can be seen in this example, if the actual parameter for 'BEFORE' is missing then it is assumed (and then checked) that the element type has the operation '<'. In fact, this is a way of expressing constrained genericity similar to 'where clauses' but with the important difference that it is only a default. If the element type does not have a '<' operation or if some other operation is to be used for the ordering then this can be specified in the instantiation. Constrained genericity becomes simply a special case of default generic procedure parameters.Defaults are inherently more powerful than 'where clauses'. The latter can only refer to methods which are contained in one of the type parameters. The former can refer to a method in a completely different class as with:English_Alphabetical.before(,)in our employees example.5 SummaryGenericity is an important mechanism for supporting reusability, and reusability is an important aspect of efficient software production. The most common use of genericity in object-oriented class libraries is for the definition of reusable collection classes since these play such an important role in commercial software.Collection classes must often use operations on their elements which are not available for all types in the programming language. For reasons of clarity, efficient compilation and good error messages, the generic class should be able to specify explicitly what operations it requires in manipulating objects of its type parameters. This is usually accomplished via some form of constrained genericity.We have demonstrated that for such common practical situations as ordering a single element type in two different ways, constrained genericity does not express what we really want to achieve. Recent refinements of constrained genericity such as matching and 4 This example is only appropriate in a language with operator overloading.。