布尔无限循环可能吗?

发布于 2024-09-02 18:19:56 字数 42 浏览 5 评论 0原文

是否有可能通过创建布尔查询(例如图书馆目录或谷歌搜索)来引发无限循环?

Is it possible to incur a infinite loop through the creation of a Boolean query (e.g. Library catalog or google search)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

孤独岁月 2024-09-09 18:19:57

我能想到的唯一不可能出现无限循环的常见情况是,您的语言包含一系列指令,并且一旦执行了一条指令,就不可能转到上一条指令。指令(或重复当前指令)。 SQL 可能会在每行的基础上执行此类操作,因此无限循环是不可能的。

The only common situation I can think of where infinite looping is not possible is where you have a language with a series of instructions, and it is impossible, once you have executed an instruction, to go to a previous instruction (or to repeat the current one). It might be that SQL does this sort of thing on a per-row basis, so infinite looping is impossible.

浪荡不羁 2024-09-09 18:19:56

我不确定“布尔查询”(这是一个相当广泛的术语)的确切含义,但如果您只是指任何语言中计算结果为 true 或 false 的任何表达式,那么我不得不说是的。

我的意思是,像这样的伪代码怎么样:

bool x = this() OR that()

function this()
    return that()

function that()
    return this()

也就是说,如果涉及方法调用,则无限递归总是可能的,假设无限递归方法在所讨论的编程语言中具有潜力。

或者这不是你的意思?

I'm not sure exactly what you mean by "Boolean query" (that is a pretty broad term), but if you simply mean, any expression in any language that evaluates to true or false, then I'd have to say yes.

I mean, what about something like this pseudo-code:

bool x = this() OR that()

function this()
    return that()

function that()
    return this()

That is to say, infinite recursion will always be possible if method calls are involved, assuming an infinitely recursive method is a potentiality in the programming language in question.

Or is that not what you meant?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文