Skip to Content
深入理解運算原理|從簡單的機器到無所不能的程式
book

深入理解運算原理|從簡單的機器到無所不能的程式

by Tom Stuart
November 2017
Beginner to intermediate
344 pages
7h 2m
Chinese
GoTop Information, Inc.
Content preview from 深入理解運算原理|從簡單的機器到無所不能的程式
四處皆通用
|
239
而且可以運作的很好。而且因為我們替任何 lambda 演算運算式執行這項轉譯,因此 Iota
依然是另一種通用語言。
標籤系統
標籤系統
tag system
)是一種運算模型,它的運作就像簡化的圖靈機:標籤系統運算
字串的方式是反覆將新字元加到字串結尾,並且在開頭之處移除它們,而非在磁帶來回
的移動磁帶頭。就某些方面,標籤系統的字串就像圖靈機的磁帶,但是有所限制的是標
籤系統只能運算字串的邊緣,並且它只能以單一方向『移動』(從開頭往結尾)。
標籤系統的描述有兩個部分:首先是規則的集合,其中每條規則在特定字元出現在開頭
時,指定某些字元要附加到字串(例如『字元
a
位在字串開頭,就附加字元
bcd
』);
次是稱為
刪除數
deletion number
)的數值,它指定了遵循規則之後從字串開頭刪掉的
字元數量。
以下是標籤系統的例子:
當字串的開頭是
a
,附加字元
bc
當字串的開頭是
b
,附加字元
caad
當字串的開頭是
c
,附加字元
ccd
遵循上述任何規則之後,從字串開頭刪掉 3 個字元(也就是說刪除數是 3)。
反覆遵循規則並刪除字元,直到字串的第 1 個字元沒有適用的規則,或直到字串長度小
於刪除數,我們可以執行標籤系統運算
6
。讓我們試著以初始字串
'aaaaaa'
來執行範例
的標籤系統:
目前字串 適用的規則
aaaaaa 當字串的開頭是 a,附加字元 bc
aaa
bc
當字串的開頭是 a,附加字元 bc
bc
bc
當字串的開頭是 b,附加字元 caad
c
caad ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

JSON實務手冊

JSON實務手冊

Tom Marrs

Publisher Resources

ISBN: 9789864766000