善存片适合什么人吃| 什么蛋不能吃| 胸口痛什么原因| 宫颈肥大伴纳氏囊肿是什么意思| 牙疼吃什么食物好得快| 什么属于轻微糖尿病| 鹦鹉能吃什么水果| 沙门氏菌用什么药| 肛门痒用什么药| 甲状腺在什么位置| 鬼什么虎| 晚上八点到九点是什么时辰| 查血挂什么科| 阿普唑仑是什么药| 纯是什么意思| 吃什么对心脏好| 胆汁酸高吃什么降得快| 小辣椒是什么意思| 为什么医者不自医| 梦见放鞭炮是什么意思| 白介素2是治疗什么病的| 弯脚杆是什么意思| 南极有什么| 机遇什么意思| 怀孕有什么现象| 扁平疣吃什么药| 排卵期会有什么症状| kay是什么意思| 大同古代叫什么| 吃什么中药能降血压| lady是什么意思啊| 做腋臭手术挂什么科室| 感染性腹泻吃什么药| 家族是什么意思| 国药准字是什么意思| 江浙沪是什么意思| 长疖子用什么药| 惺惺相惜什么意思| 减肥可以吃什么| 栀子花黄叶是什么原因| bart是什么意思| 嘴唇发白是什么原因引起的| 广西古代叫什么| 头部神经痛吃什么药好| 吴亦凡为什么叫牛| 润色是什么意思| 始于初见止于终老是什么意思| 芥末黄是什么颜色| 血糖高适合吃什么零食| 子宫肌瘤有什么症状| 就加鸟念什么| 星星是什么的眼睛| 自欺欺人是什么意思| 夏季喝什么汤好| 大便水状是什么原因| 八婆是什么意思| 养肝要吃什么| 脚崴了挂什么科| 梦见蛇吃人代表什么预兆| 酸菜鱼用什么鱼做好吃| 半套是什么意思| 女人性冷淡用什么药| 前列腺液是什么样子| 孕妇喝什么茶对胎儿好| 脚趾头抽筋是什么原因引起的| 些几 是什么意思| 什么不什么身| 为什么吃了避孕药还是怀孕了| 急性肠胃炎是什么引起的| 脾阳虚吃什么药| 喝茶拉肚子是什么原因| 活性酶是什么| 蜱虫长什么样子图片| 马拉车是什么牌子的包| 十月份生日是什么星座| 什么酒不能喝脑筋急转弯| 屈服是什么意思| hbc是什么意思| b2b是什么| 拉拉是什么意思| 白练是什么意思| 惊恐症是什么病| 干咳喝什么止咳糖浆好| 碧螺春属于什么茶| 电视开不了机是什么原因| 白色的猫是什么品种| 爸爸是什么意思| 大男子主义是什么意思| 双鱼座跟什么星座最配| 02年是什么年| 本科和专科是什么意思| 小孩子发烧吃什么药| 吃猪皮有什么好处和坏处| 慢性胃炎吃什么药效果好| 梦见自己生了个女孩是什么意思| honor是什么牌子| 心五行属什么| 山药与什么食物相克| 长歌怀采薇是什么意思| 什么叫意识| 二进宫是什么意思| 高血压变成低血压是什么原因| 梦见穿袜子是什么意思| 血管瘤是什么东西| 怀孕初期需要注意什么| 还俗是什么意思| 跌跌撞撞什么意思| 远山含黛是什么意思| 但愿人长久的下一句是什么| 咖位是什么意思| 双顶径和头围有什么区别| 石榴石什么颜色的最好| 逆商是什么| 四个木字念什么| 什么是清淡饮食| 紫癜有什么危害| d2聚体高是什么原因| 嘴唇上起泡是什么原因| 叶韵是什么意思| 氏是什么意思| 捞人什么意思| 置换是什么意思| 男人吃什么对性功能好| 产妇适合吃什么水果| 促狭一笑是什么意思| w是什么单位| 东北易帜是什么意思| 过度换气是什么意思| 马卡龙为什么这么贵| c反应蛋白高是什么意思| 菩提子是什么树的种子| 幽门螺旋杆菌感染是什么意思| 道地是什么意思| 5月24日是什么星座| 什么东西越洗越脏脑筋急转弯| 丝状疣长什么样| 梦见入室抢劫意味什么| 绿色是什么意思| 牙龈发炎吃什么药| 宫腔灌注是治疗什么的| 孕囊形态欠规则是什么意思| 芡实不能和什么一起吃| 口腔溃疡什么药最管用| 肛门坠胀吃什么药最好| 星字属于五行属什么| 肠胃感冒什么症状| asmr是什么| 左侧肋骨下面是什么器官| 豆瓣酱可以做什么菜| 老虎头是什么牌子衣服| 不可亵玩焉的亵是什么意思| 做手术后吃什么对伤口恢复快| 回声欠均匀是什么意思| 酉时右眼跳是什么预兆| 女人吃藕有什么好处| 黑户是什么意思| 女用避孕套是什么样的| 白手起家是什么生肖| 度是什么意思| 什么运动瘦肚子| 囊实性结节是什么意思| 丧尸是什么意思| 早上出虚汗是什么原因| 沙拉酱可以做什么美食| 助理研究员是什么职称| 为什么胸部会胀痛| 输血前常规检查是什么| 骨头是什么垃圾| 什么鸡没有翅膀| 父母都是a型血孩子是什么血型| t1w1高信号代表什么| 清明节在什么时候| 大张伟的真名叫什么| 教师节送什么礼物好| 枸杞和红枣泡水喝有什么好处| 耳朵聋是什么原因| 气胸有什么症状| 月经提前是什么原因| 稀奶油是什么| 渣渣辉什么意思| 眼科pd是什么意思| aosc医学是什么意思| 脚臭用什么药| 断崖式是什么意思| gp是什么| 什么是肌张力| 牙齿痛用什么药| 什么是甲状腺| 鳞状上皮细胞是什么| 乙肝病毒表面抗体弱阳性什么意思| 梦见小白兔是什么意思| 楚楚欲动是什么意思| 喝酒吃头孢有什么反应| 12月10日什么星座| 心脏早博吃什么药好| 经常吃红枣有什么好处和坏处| 天经地义的意思是什么| 血hcg是什么意思| 无聊的反义词是什么| 不射精是什么原因| 直肠癌是什么原因引起的| bp是什么意思医学上面| 西班牙用的是什么货币| 违和是什么意思| 冰箱双变频是什么意思| 肝腹水是什么症状| pvd是什么意思| 胰腺炎可以吃什么| 人为什么会做梦科学解释| 身体起水泡是什么病症| 双眼屈光不正是什么意思| 叼是什么意思| 牛肉含有什么营养成分| 5岁属什么| 什么叫渣男| 预后是什么意思| 硬结灶是什么意思| 皮炎吃什么药| 银屑病吃什么药| 什么是真心| u是什么意思| 雪菊有什么功效| 头出汗是什么原因| 丑时属什么| 压疮是什么| 胎儿缺氧孕妇会有什么反应| 炸东西用什么淀粉| 台湾以前叫什么名字| 606是什么意思| 格林是什么意思| mj是什么单位| 甲功七项挂什么科| 什么是什么的摇篮| 质变是什么意思| 苹果为什么叫苹果| 体内火气大吃什么降火| 吃什么鱼最健康| 荷尔蒙是什么东西起什么作用| 经常头痛什么原因| art是什么| pcr医学上是什么意思| 勃起不坚硬吃什么药| 胰腺炎吃什么水果| 甘草长什么样| 开会是什么意思| 紫癜是什么原因引起的| 口吐白沫是什么病| 心脏房颤吃什么药| 醋酸是什么东西| 什么逼人| 铜绿假单胞菌用什么抗生素| 暗物质是什么东西| 痉挛是什么症状| 画眉鸟吃什么| 为什么胸会痛| 白细胞数目偏高是什么意思| carnival手表什么牌子| 冠脉壁钙化是什么意思| 蛇为什么有毒| 唐僧叫什么| 平均红细胞体积偏高说明什么| ifashion是什么意思| 肠道紊乱的症状是什么| 喝枸杞子泡水有什么好处和坏处| 百度Jump to content

From Wikipedia, the free encyclopedia
百度 主持人:民主党派年度大调研备受社会关注,请您介绍台盟中央的调研情况。

In computer science, an abstract machine is a theoretical model that allows for a detailed and precise analysis of how a computer system functions.[1] It is similar to a mathematical function in that it receives inputs and produces outputs based on predefined rules. Abstract machines vary from literal machines in that they are expected to perform correctly and independently of hardware.[2] Abstract machines are "machines" because they allow step-by-step execution of programs; they are "abstract" because they ignore many aspects of actual (hardware) machines.[3] A typical abstract machine consists of a definition in terms of input, output, and the set of allowable operations used to turn the former into the latter. They can be used for purely theoretical reasons as well as models for real-world computer systems.[2] In the theory of computation, abstract machines are often used in thought experiments regarding computability or to analyse the complexity of algorithms.[3] This use of abstract machines is fundamental to the field of computational complexity theory, such as with finite state machines, Mealy machines, push-down automata, and Turing machines.[4]

Classification

[edit]

Abstract machines are typically categorized into two types based on the quantity of operations they can execute simultaneously at any given moment: deterministic abstract machines and non-deterministic abstract machines.[2] A deterministic abstract machine is a system in which a particular beginning state or condition always yields the same outputs. There is no randomness or variation in how inputs are transformed into outputs.[5] In contrast, a non-deterministic abstract machine can provide various outputs for the same input on different executions.[2] Unlike a deterministic algorithm, which gives the same result for the same input regardless of the number of iterations, a non-deterministic algorithm takes various paths to arrive to different outputs.[6] Non-deterministic algorithms are helpful for obtaining approximate answers when deriving a precise solution using a deterministic approach is difficult or costly.[7]

A run of a Turing machine

Turing machines, for example, are some of the most fundamental abstract machines in computer science.[2] These machines conduct operations on a tape (a string of symbols) of any length. Their instructions provide for both modifying the symbols and changing the symbol that the machine’s pointer is currently at. For example, a rudimentary Turing machine could have a single command, "convert symbol to 1 then move right", and this machine would only produce a string of 1s.[8] This basic Turing machine is deterministic; however, nondeterministic Turing machines that can execute several actions given the same input may also be built.[2]

Implementation

[edit]

Any implementation of an abstract machine in the case of physical implementation (in hardware) uses some kind of physical device (mechanical or electronic) to execute the instructions of a programming language. An abstract machine, however, can also be implemented in software or firmware at levels between the abstract machine and underlying physical device.[9]

Programming language implementation

[edit]

An abstract machine is, intuitively, just an abstraction of the idea of a physical computer.[13] For actual execution, algorithms must be properly formalised using the constructs offered by a programming language. This implies that the algorithms to be executed must be expressed using programming language instructions.[3] The syntax of a programming language enables the construction of programs using a finite set of constructs known as instructions. Most abstract machines share a program store and a state, which often includes a stack and registers.[9][14] In digital computers, the stack is simply a memory unit with an address register that can count only positive integers (after an initial value is loaded into it). The address register for the stack is known as a stack pointer because its value always refers to the top item on the stack.[15] The program consists of a series of instructions, with a stack pointer indicating the next instruction to be performed. When the instruction is completed, a stack pointer is advanced. This fundamental control mechanism of an abstract machine is also known as its execution loop.[3] Thus, an abstract machine for a programming language is any collection of data structures and algorithms capable of storing and running programs written in the programming language. It bridges the gap between the high level of a programming language and the low level of an actual machine by providing an intermediate language step for compilation. An abstract machine's instructions are adapted to the unique operations necessary to implement operations of a certain source language or set of source languages.[9]

Imperative languages

[edit]

In the late 1950s, the Association for Computing Machinery (ACM) and other allied organisations developed many proposals for Universal Computer Oriented Language (UNCOL), such as Conway's machine. The UNCOL concept is good, but it has not been widely used due to the poor performance of the generated code. In many areas of computing, its performance will continue to be an issue despite the development of the Java Virtual Machine in the late 1990s. Algol Object Code (1964), P4-machine (1976), UCSD P-machine (1977), and Forth (1970) are some successful abstract machines of this kind.[3]

Object-oriented languages

[edit]

Abstract machines for object-oriented programming languages are often stack-based and have special access instructions for object fields and methods. In these machines, memory management is often implicit performed by a garbage collector (memory recovery feature built into programming languages).[16] Smalltalk-80 (1980), Self (1989), and Java (1994) are examples of this implementation.[3]

String processing languages

[edit]

A string processing language is a computer language that focuses on processing strings rather than numbers. There have been string processing languages in the form of command shells, programming tools, macro processors, and scripting languages for decades.[17] Using a suitable abstract machine has two benefits: increased execution speed and enhanced portability. Snobol4 and ML/I are two notable instances of early string processing languages that use an abstract machine to gain machine independence.[3]

Functional programming languages

[edit]
Pictorial representation of a Krivine machine

The early abstract machines for functional languages, including the SECD machine (1964) and Cardelli's Functional Abstract Machine (1983), defined strict evaluation, also known as eager or call-by-value evaluation,[3] in which function arguments are evaluated before the call and precisely once. Recently, the majority of research has been on lazy (or call-by-need) evaluation,[18] such as the G-machine (1984), Krivine machine (1985), and Three Instruction Machine (1986), in which function arguments are evaluated only if necessary and at most once. One reason is because effective implementation of strict evaluation is now well-understood, therefore the necessity for an abstract machine has diminished.[3]

Logical languages

[edit]

Predicate calculus (first order logic) is the foundation of logic programming languages. The most well-known logic programming language is Prolog. The rules in Prolog are written in a uniform format known as universally quantified 'Horn clauses', which means to begin the calculation that attempts to discover a proof of the objective. The Warren Abstract Machine WAM (1983),[3] which has become the de facto standard in Prolog program compilation, has been the focus of most study. It provides special purpose instructions such as data unification instructions and control flow instructions to support backtracking (searching algorithm).[19]

Structure

[edit]

A generic abstract machine is made up of a memory and an interpreter. The memory is used to store data and programs, while the interpreter is the component that executes the instructions included in programs.[9]

The structure of an abstract machine

The interpreter must carry out the operations that are unique to the language it is interpreting. However, given the variety of languages, it is conceivable to identify categories of operations and an "execution mechanism" shared by all interpreters. The interpreter's operations and accompanying data structures are divided into the following categories:[9][20]

  1. Operations for processing primitive data:
  2. Operations and data structures for controlling the sequence of execution of operations;
  3. Operations and data structures for controlling data transfers;
  4. Operations and data structures for memory management.

Processing primitive data

[edit]

An abstract machine must contain operations for manipulating primitive data types such as strings and integers.[9] For example, integers are nearly universally considered a basic data type for both physical abstract machines and the abstract machines used by many programming languages. The machine carries out the arithmetic operations necessary, such as addition and multiplication, within a single time step.[21]

Sequence control

[edit]

Operations and structures for "sequence control" allow controlling the execution flow of program instructions. When certain conditions are met, it is necessary to change the typical sequential execution of a program.[9] Therefore, the interpreter employs data structures (such as those used to store the address of the next instruction to execute) that are modified by operations distinct from those used for data manipulation (for example, operations to update the address of the next instruction to execute).[22]

Controlling data transfers

[edit]

Data transfer operations are used to control how operands and data are transported from memory to the interpreter and vice versa. These operations deal with the store and the retrieval order of operands from the store.[9]

Memory management

[edit]

Memory management is concerned with the operations performed in memory to allocate data and applications. In the abstract machine, data and programmes can be held indefinitely, or in the case of programming languages, memory can be allocated or deallocated using a more complex mechanism.[9]

Hierarchies

[edit]
A hierarchy of abstract machines

Abstract machine hierarchies are often employed, in which each machine uses the functionality of the level immediately below and adds additional functionality of its own to meet the level immediately above. A hardware computer, constructed with physical electronic devices, can be added at the most basic level. Above this level, the abstract microprogrammed machine level may be introduced. The abstract machine supplied by the operating system, which is implemented by a program written in machine language, is located immediately above (or directly above the hardware if the firmware level is not there). On the one hand, the operating system extends the capability of the physical machine by providing higher-level primitives that are not available on the physical machine (for example, primitives that act on files). The host machine is formed by the abstract machine given by the operating system, on which a high-level programming language is implemented using an intermediary machine, such as the Java Virtual machine and its byte code language. The level given by the abstract machine for the high-level language (for example, Java) is not usually the final level of hierarchy. At this point, one or more applications that deliver additional services together may be introduced. A "web machine" level, for example, can be added to implement the functionalities necessary to handle Web communications (communications protocols or HTML code presentation). The "Web Service" level is located above this, and it provides the functionalities necessary to make web services communicate, both in terms of interaction protocols and the behaviour of the processes involved. At this level, entirely new languages that specify the behaviour of so-called "business processes" based on Web services may be developed (an example is the Business Process Execution Language). Finally, a specialised application can be found at the highest level (for example, E-commerce) which has very specific and limited functionality.[9]

See also

[edit]

References

[edit]
  1. ^ Weisstein, Eric W. "Abstract Machine". mathworld.wolfram.com. Retrieved 2025-08-05.
  2. ^ a b c d e f "What is an Abstract Machine?". EasyTechJunkie. Retrieved 2025-08-05.
  3. ^ a b c d e f g h i j Diehl, Stephan; Hartel, Pieter; Sestoft, Peter (May 2000). "Abstract machines for programming language implementation". Future Generation Computer Systems. 16 (7): 739–751. doi:10.1016/S0167-739X(99)00088-6.
  4. ^ "9.1.1: Finite-State Machine Overview". Engineering LibreTexts. 2025-08-05. Retrieved 2025-08-05.
  5. ^ "What is Deterministic System? - Definition from Techopedia". Techopedia.com. 29 August 2019. Retrieved 2025-08-05.
  6. ^ Stearns, Richard E. (January 2003). "Deterministic versus nondeterministic time and lower bound problems". Journal of the ACM. 50 (1): 91–95. doi:10.1145/602382.602409. ISSN 0004-5411. S2CID 2194820.
  7. ^ Armoni, Michal; Gal-Ezer, Judith (December 2007). "Non-determinism: An abstract concept in computer science studies". Computer Science Education. 17 (4): 243–262. Bibcode:2007CSEd...17..243A. doi:10.1080/08993400701442885. ISSN 0899-3408. S2CID 41928460.
  8. ^ Gill, John (December 1977). "Computational Complexity of Probabilistic Turing Machines". SIAM Journal on Computing. 6 (4): 675–695. doi:10.1137/0206049. ISSN 0097-5397.
  9. ^ a b c d e f g h i j k l m Gabbrielli, Maurizio; Martini, Simone (2010), "Abstract Machines", Programming Languages: Principles and Paradigms, London: Springer London, pp. 1–25, doi:10.1007/978-1-84882-914-5_1, ISBN 978-1-84882-913-8, retrieved 2025-08-05
  10. ^ Bair, Ray; Chien, Andrew; Cook, Jeanine; Donofrio, Dave; Grider, Gary; Kuehn, Jeff; Moore, Shirley; Shalf, John; Vetter, Jeff (2025-08-05). Hardware Evaluation: Abstract Machine Models and Proxy Architectures for Exascale Computing (Technical report). U.S. Department of Energy Office of Scientific and Technical Information. doi:10.2172/1733300. OSTI 1733300.
  11. ^ "abstract machine from FOLDOC". foldoc.org. Retrieved 2025-08-05.
  12. ^ Gee, J.; Melvin, S. W.; Patt, Y. N. (1986). "The implementation of Prolog via VAX 8600 microcode". Proceedings of the 19th annual workshop on Microprogramming. New York, New York, USA: ACM Press. pp. 68–74. doi:10.1145/19551.19538. ISBN 081860736X. S2CID 3846072.
  13. ^ "abstract machine". Oxford Reference. Retrieved 2025-08-05.
  14. ^ García-Martín, Julio Manuel; Sutil-Martin, Miguel (August 15, 1999). "The Abstract Machine: A Pattern for Designing Abstract Machines" (PDF). Proceedings of Pattern Languages of Programs '99.
  15. ^ upscfever.com (2025-08-05). "Computer Organization and Architecture (Stack Organization) - UPSC FEVER". upscfever.com. Retrieved 2025-08-05.
  16. ^ "What is Object-Oriented Programming (OOP)?". SearchAppArchitecture. Retrieved 2025-08-05.
  17. ^ "Design considerations for string processing languages", A Study in String Processing Languages, Lecture Notes in Computer Science, vol. 205, Berlin, Heidelberg: Springer Berlin Heidelberg, pp. 17–37, 1985, doi:10.1007/3-540-16041-8_2, ISBN 978-3-540-16041-0, retrieved 2025-08-05
  18. ^ Hackett, Jennifer; Hutton, Graham (2025-08-05). "Call-by-need is clairvoyant call-by-value". Proceedings of the ACM on Programming Languages. 3 (ICFP): 1–23. doi:10.1145/3341718. ISSN 2475-1421. S2CID 195782686.
  19. ^ "Prolog | An Introduction". GeeksforGeeks. 2025-08-05. Retrieved 2025-08-05.
  20. ^ Accattoli, Beniamino; Barenbaum, Pablo; Mazza, Damiano (2025-08-05). "Distilling abstract machines". ACM SIGPLAN Notices. 49 (9): 363–376. doi:10.1145/2692915.2628154. ISSN 0362-1340. S2CID 234775413.
  21. ^ baeldung (2025-08-05). "Introduction to Java Primitives | Baeldung". www.baeldung.com. Retrieved 2025-08-05.
  22. ^ Kuchana, Partha (2004), "Interpreter", Software Architecture Design Patterns in Java, Auerbach Publications, doi:10.1201/9780203496213, ISBN 978-0-8493-2142-9

Further reading

[edit]
  • Peter van Emde Boas, Machine Models and Simulations pp. 3–66, appearing in:
Jan van Leeuwen, ed. "Handbook of Theoretical Computer Science. Volume A: Algorithms and Complexity, The MIT PRESS/Elsevier, 1990. ISBN 0-444-88071-2 (volume A). QA 76.H279 1990
一月三日是什么星座 搞破鞋什么意思 13层楼房有什么说法吗 今年天热的原因是什么 羊排炖什么好吃
kksk是什么意思 2023年五行属什么 多喝酸奶有什么好处 结婚55周年是什么婚 双肺纤维灶是什么意思
一个火一个丙念什么 性转是什么意思 五月十三号是什么日子 狮子座是什么象 丙氨酸氨基转移酶是什么
爱居兔女装是什么档次 月柱桃花是什么意思 什么也别说 手癣用什么药膏效果好 今年是什么年号
宫颈多发纳氏囊肿是什么意思hcv7jop5ns1r.cn 高胆固醇吃什么药hcv7jop7ns0r.cn csf是什么意思hcv7jop7ns4r.cn 病毒感染吃什么消炎药hcv8jop5ns8r.cn 嘴巴里长水泡是什么原因hcv9jop0ns8r.cn
甲状腺不均质改变是什么意思hcv8jop0ns7r.cn 什么叫混合斑块hcv9jop3ns3r.cn 胳膊肘疼痛是什么原因hcv8jop7ns2r.cn b是什么hcv8jop4ns8r.cn 金银花什么时候采摘最好hcv8jop2ns4r.cn
眩晕去医院挂什么科室jinxinzhichuang.com 结婚一年是什么婚hcv9jop4ns7r.cn 舌苔厚白吃什么药最好hcv9jop2ns6r.cn 意欲何为是什么意思hcv8jop1ns7r.cn 病魔是什么意思hcv8jop2ns4r.cn
湿疹是因为什么原因引起的hcv9jop4ns4r.cn 傲慢什么意思hcv9jop6ns7r.cn 中暑喝什么水hcv8jop7ns6r.cn 喜欢黑色的人是什么性格hcv8jop6ns7r.cn 梦见别人搬家预示什么hcv8jop4ns8r.cn
百度