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

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

by Tom Stuart
November 2017
Beginner to intermediate
344 pages
7h 2m
Chinese
GoTop Information, Inc.
Content preview from 深入理解運算原理|從簡單的機器到無所不能的程式
298
|
9
另一個問題(已在第 271 頁『通用系統可以永遠循環』探討過),是以十分強大
1
的語
言所編寫的程式,不需要產生結果而完全能夠永遠執行。這使得執行它們也無法可靠的
研究調查任意程式,因為有時候不可能提前告知程式是不是即將永遠執行(請見第 283
頁的『停機問題』),因此,任何試著執行候選程式的自動化核對器,都將面臨擁有答案
卻永遠一去不回的風險。
最後,即使程式確實提前擁有其可用的所有輸入資料,但無論什麼原因,它最終一定都
會終止,而非永遠循環,執行該程式觀察其結果可能所費不貲或並不方便。這可能需
要花費長時間才能完成,或者擁有不可逆的副作用(發送電子郵件、金融轉帳、發射導
彈),對於測試的目的來說,都是不適合或不需要。
這所有的原因使得不需實際執行程式就能發現程式的資訊非常有用。這麼做的方式之
一,是使用
抽象解譯
abstract interpretation
),這種分析技術會藉著執行程式的簡化版
本,再以執行結果來推論原本的特性。
抽象解譯
抽象解譯為我們提供了困難問題的處理方式,例如太大、太複雜的問題,或者是有太多
未知而無法直接處理的問題。抽象解譯的主要概念是使用
抽象
abstract
)模型,也就
是丟掉足夠的細節,使其容易控制管理的實際問題的模型(也許讓它更小、更簡單,或
者排除未知),但也保留足夠的細節,讓它的解決方案能與原本的問題有關。
為了讓這個模糊的想法更為具體,讓我們來看一個抽象解譯的簡單應用。
路線規劃
假設你正在某個不熟悉的國家旅遊,並且計劃開車到另一個城市。你打算走哪條路?直 ...
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