The Unix command \texttt{find} is among the first commands taught to beginners, yet remains indispensable for experienced engineers. In this paper, we demonstrate that \texttt{find} possesses unexpected computational power, establishing three Turing completeness results using the GNU implementation (a standard in Linux distributions). (1) \texttt{find} + \texttt{mkdir} (a system that has only \texttt{find} and \texttt{mkdir}) is Turing complete: by encoding computational states as directory paths and using regex back-references to copy substrings, we simulate 2-tag systems. (2) GNU \texttt{find} 4.9.0+ alone is Turing complete: by reading and writing to files during traversal, we simulate a two-counter machine without \texttt{mkdir}. (3) \texttt{find} + \texttt{mkdir} without regex back-references is still Turing complete: by a trick of encoding regex patterns directly into directory names, we achieve the same power. These results place \texttt{find} among the ``surprisingly Turing-complete'' systems, highlighting the hidden complexity within seemingly simple standard utilities.


翻译:Unix 命令 \texttt{find} 是初学者最先学习的命令之一,但对经验丰富的工程师而言仍不可或缺。本文中,我们证明了 \texttt{find} 具有意想不到的计算能力,并利用 GNU 实现(Linux 发行版中的标准版本)建立了三个图灵完备性结果。(1)\texttt{find} + \texttt{mkdir}(一个仅包含 \texttt{find} 和 \texttt{mkdir} 的系统)是图灵完备的:通过将计算状态编码为目录路径,并利用正则表达式反向引用来复制子字符串,我们模拟了 2-标记系统。(2)单独的 GNU \texttt{find} 4.9.0+ 是图灵完备的:通过在遍历过程中读写文件,我们模拟了一个无需 \texttt{mkdir} 的双计数器机。(3)不带正则表达式反向引用的 \texttt{find} + \texttt{mkdir} 仍然是图灵完备的:通过将正则表达式模式直接编码到目录名的技巧,我们实现了相同的计算能力。这些结果将 \texttt{find} 置于“令人惊讶的图灵完备”系统之列,突显了看似简单的标准工具中隐藏的复杂性。

0
下载
关闭预览

相关内容

GNU 是 “GNU's Not Unix” 的递归缩写, 是由理查德·斯托曼在1983年9月27日公开发起的。它的目标是创建一套完全自由的操作系统。
【硬核书】Linux核心编程|Linux Kernel Programming,741页pdf
专知会员服务
80+阅读 · 2021年3月26日
【经典书】Linux UNIX系统编程手册,1554页pdf
专知会员服务
48+阅读 · 2021年2月20日
【经典书】精通Linux,394页pdf
专知会员服务
98+阅读 · 2021年2月19日
【干货书】Linux命令行与shell脚本编程大全,第3版818页pdf
专知会员服务
63+阅读 · 2020年12月30日
【泡泡图灵智库】基于草图的图像检索的零元学习
泡泡机器人SLAM
12+阅读 · 2019年9月16日
重磅:git checkout 未来将消失
Python程序员
15+阅读 · 2019年8月22日
如何从零开始搭建知识图谱?
AI前线
23+阅读 · 2018年7月2日
深度文本匹配开源工具(MatchZoo)
机器学习研究会
10+阅读 · 2017年12月5日
OCR开源库(文本区域定位和文本识别):github
数据挖掘入门与实战
28+阅读 · 2017年11月26日
并行算法演进,从MapReduce到MPI
凡人机器学习
10+阅读 · 2017年11月5日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2016年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
最新内容
澳大利亚发布《国防战略(2026年)》
专知会员服务
0+阅读 · 25分钟前
【CMU博士论文】迈向基于基础先验的 4D 感知研究
专知会员服务
0+阅读 · 21分钟前
全球高超音速武器最新发展趋势
专知会员服务
0+阅读 · 50分钟前
人工智能在战场行动中的演进及伊朗案例
专知会员服务
7+阅读 · 4月18日
美AI公司Anthropic推出网络安全模型“Mythos”
专知会员服务
4+阅读 · 4月18日
【博士论文】面向城市环境的可解释计算机视觉
相关资讯
【泡泡图灵智库】基于草图的图像检索的零元学习
泡泡机器人SLAM
12+阅读 · 2019年9月16日
重磅:git checkout 未来将消失
Python程序员
15+阅读 · 2019年8月22日
如何从零开始搭建知识图谱?
AI前线
23+阅读 · 2018年7月2日
深度文本匹配开源工具(MatchZoo)
机器学习研究会
10+阅读 · 2017年12月5日
OCR开源库(文本区域定位和文本识别):github
数据挖掘入门与实战
28+阅读 · 2017年11月26日
并行算法演进,从MapReduce到MPI
凡人机器学习
10+阅读 · 2017年11月5日
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2016年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员