关于闭包的一些问题,不是特定于语言的! >:|

发布于 2024-10-14 09:16:38 字数 442 浏览 4 评论 0原文

我正在做一些家庭作业,并且很难理解闭包。这主要与布尔代数有关,而不是与任何特定的编程语言有关。

这是一个例子: 以下集合在下列运算下是否闭合? 连接下的语言 {a,b}。

现在,从此: http://en.wikipedia.org/wiki/Closure_%28mathematics% 29,似乎因为语言 {a,b} 的串联可以产生不属于原始集合 {a,b} 的成员的结果,如 ab、aa、bb 等,所以该集合为在串联操作下不关闭。

我对这个的看法正确吗?我觉得这个定义很容易被误解。我觉得这可能意味着,如果该操作产生可以由给定语言创建的结果,那么该集合在该操作下是封闭的。

有人想尝试一下并帮助我吗? :)

谢谢!

I'm doing some homework, and having a hard time understanding closures. This is in relation to boolean algebra mostly, not any specific programming language.

Here's an example:
Are the following sets closed under the following operations?
The language {a,b} under concatenation.

Now, from this: http://en.wikipedia.org/wiki/Closure_%28mathematics%29, it would seem that because the concatenation of the language {a,b} can produce results that are not members of the original set {a,b}, like ab, aa, bb, etc, the set is NOT closed under the concatenation operation.

Am I looking at this correctly? I feel its easy to misinterpret that definition. I feel like it might mean that if the operation produces results that CAN be created by the given language, then the set is closed under that operation.

Anyone want to take a stab at this and help me out? :)

Thanks!

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

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

发布评论

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

评论(1

格子衫的從容 2024-10-21 09:16:38

在计算理论中,通常区分符号集(字符、字母等)和单词集。讨论字符集在某个操作下是否是封闭的从来没有真正意义,而是询问某些单词集在某个操作下是否是封闭的。

在您给出的示例中,{a,b} 是符号集;该符号集上所有单词的集合 S 在串联下是闭合的,因为连接 S 中的两个单词会导致 S 中仍然存在一个单词。

In computational theory, you usually distinguish betweeen the set of symbols (characters, letters, etc.) and the set of words. It never really makes sense to discuss whether the set of characters is closed under an operation, instead you ask if some set of words is closed under an operation.

In the example you give, {a,b} is the symbol set; the set S of all words over that symbol set is closed under concatenation, since concatenating two words from S results in a word still in S.

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