TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

How Many C Programs Are There?

34 点作者 primodemus超过 13 年前

5 条评论

dexen超过 13 年前
There'd be a whole lot of programs.<p>There's a good reading that approaches a related subject, but isn't specific to <i>C</i> programs: <a href="http://www.scottaaronson.com/writings/bignumbers.html" rel="nofollow">http://www.scottaaronson.com/writings/bignumbers.html</a><p>In short, `busy beaver number' -- number of steps that a halting Turing machine with dictionary of size N can have -- grows pretty fast with N; faster than Ackermann function anyway.<p>Also, supposedly <i>a katamari is the only thing which outgrows the busy beaver sequence ;)</i> <a href="http://www.xamuel.com/katamari-damacy-growth/" rel="nofollow">http://www.xamuel.com/katamari-damacy-growth/</a>
评论 #3617976 未加载
bnegreve超过 13 年前
&#62; <i>Anyway, I’d be interested to hear people’s thoughts on this</i><p>I would rather try to evaluate the size of the abstract syntax tree. I think this is more relevant since int main(){int a;} is obviously similar to int main(){int b;}
评论 #3617579 未加载
评论 #3617566 未加载
fragsworth超过 13 年前
I think it would make more sense to start by looking at research done on grammars. For instance:<p><a href="http://www.cs.toronto.edu/~yuvalf/CFG-LB.pdf" rel="nofollow">http://www.cs.toronto.edu/~yuvalf/CFG-LB.pdf</a>
DaveInTucson超过 13 年前
<i>How many functionally inequivalent C programs are there?</i><p>Surely this is undecidable?
评论 #3618455 未加载
评论 #3617689 未加载
评论 #3617743 未加载
sold超过 13 年前
If you have printf, then "printf("long string")" where the string might be modified should give a good bound, say Omega(200^S). If you don't have it, what is the program allowed to do? Only return from main, without checking arguments? Then you have as many extensionally distinct programs as integers.