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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Non-deterministic execution of Python functions

55 点作者 cha42超过 1 年前

5 条评论

Bjartr超过 1 年前
&gt; Magical computer that guess for you some data of course doesn&#x27;t exists.<p>Prolog does sunshine like this, no? You give it rules and then make a statement with a blank in it and it&#x27;ll fill in the blank given the rules you&#x27;ve described.
评论 #39212736 未加载
phoe-krk超过 1 年前
The idea seems so similar to the classical AMB ambiguous operator introduced by John McCarthy [0]. The implementation seems similar to what I&#x27;ve done a while ago, too, just in Lisp and using Lisp primitives rather than function decorators.<p>[0] <a href="http:&#x2F;&#x2F;www.randomhacks.net&#x2F;2005&#x2F;10&#x2F;11&#x2F;amb-operator&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.randomhacks.net&#x2F;2005&#x2F;10&#x2F;11&#x2F;amb-operator&#x2F;</a><p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;phoe&#x2F;amb&#x2F;">https:&#x2F;&#x2F;github.com&#x2F;phoe&#x2F;amb&#x2F;</a>
评论 #39213193 未加载
评论 #39211233 未加载
评论 #39212010 未加载
PheonixPharts超过 1 年前
Makes me think about how non-deterministic computing is basically how you view lists as a context (as opposed to a container) when thinking in terms of Monads in Haskell. Application functors basically form a minimal framework for applying functions to values in a non-deterministic context when working with lists.<p>Making this further relevant is that perhaps the most well known example of monadic programming of lists is: Python&#x27;s list comprehensions. Which makes a bit surprised to see that not more explored&#x2F;exploited in this library.<p>Interesting nonetheless!
nyrikki超过 1 年前
Note of clarification.<p>This authors use of &#x27;non-determinsistic&#x27; doesn&#x27;t match the meaning of a Nondeterministic Turing machine used to define the complexity class NP.<p>There are many types of non-deterministic Turing machines, like a probabilistic Turing machine which flips a coin at each step.<p>But the &#x27;maximally lucky guesser&#x27; or &#x27;run all possibilities in one step&#x27; version of NTM&#x27;s that defines NP is physically unrealizable.
评论 #39213238 未加载
评论 #39212791 未加载
__lm__超过 1 年前
Useful to explain non-determinism to students. I saw a similar idea before at <a href="https:&#x2F;&#x2F;github.com&#x2F;aeporreca&#x2F;nondeterminism">https:&#x2F;&#x2F;github.com&#x2F;aeporreca&#x2F;nondeterminism</a> which uses fork() to (inefficiently) explore all possible guesses concurrently
评论 #39212192 未加载