布尔无限循环可能吗?
是否有可能通过创建布尔查询(例如图书馆目录或谷歌搜索)来引发无限循环?
Is it possible to incur a infinite loop through the creation of a Boolean query (e.g. Library catalog or google search)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我能想到的唯一不可能出现无限循环的常见情况是,您的语言包含一系列指令,并且一旦执行了一条指令,就不可能转到上一条指令。指令(或重复当前指令)。 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.
我不确定“布尔查询”(这是一个相当广泛的术语)的确切含义,但如果您只是指任何语言中计算结果为 true 或 false 的任何表达式,那么我不得不说是的。
我的意思是,像这样的伪代码怎么样:
也就是说,如果涉及方法调用,则无限递归总是可能的,假设无限递归方法在所讨论的编程语言中具有潜力。
或者这不是你的意思?
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:
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?