F#和模糊逻辑 [英] F# and Fuzzy Logic

查看:98
本文介绍了F#和模糊逻辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这听起来可能很奇怪,但是我想知道在Microsoft Visual F#进入的这个新世界中发生的一件事. 我将学习这种语言的许多应用,包括解析,函数式编程,结构化编程...但是人工智能呢?

模糊逻辑是否有任何应用程序? F#是用于模糊逻辑应用程序的好语言吗?

在大学里,我们正在学习Prolog和类似语言. Prolog能够以非常简单和简短的方式创建复杂的查询(通过利用谓词和事实). F#能够做到这一点吗?

谢谢.

解决方案

模糊逻辑. F#并没有提供用于实现模糊逻辑计算的任何类型,但是肯定可以在此域中使用F#. F#的简洁性和定义自定义重载运算符的能力应使基于模糊逻辑的代码相当不错.我进行了快速搜索,发现了几篇在F#中实现模糊逻辑的文章:

序言是一个有点不同的问题. Prolog的强大功能(也包括弱项)来自以下事实:它直接在该语言中建立了回溯.这对于实现基于回溯的搜索算法非常有用,但也有局限性.

F#没有直接支持回溯的功能,但是使用 recursion (这是F#和Prolog中的主要控制流机制)基于回溯的算法编写起来非常容易./p>

此外,有可能在F#中为逻辑编程实现特定于域的语言.这意味着您将在F#中实现Prolog之类的东西,然后使用F#中的这种迷你语言(可能需要使用其他F#功能)编写搜索算法.您可以在此问题中找到有关类似问题的更多信息.

I know it might sound strange but I would like to know one thing in this new world where Microsoft Visual F# is getting into. There are many application of this language, I am going to learn, regarding parsing, functional programming, structured programming... But what about artificial intelligence?

Are there any applications for Fuzzy Logic? Is F# a good language to be used for Fuzzy Logic applications?

At university we are studying Prolog and similar languages. Prolog is able to create complex query in a very plain and short expresisons (by taking advantage of predicates and facts). Is F# able to do this?

Thank you in advance.

解决方案

Fuzzy Logic. F# doesn't provide any types for implementing fuzzy logic calculations out of the box, but it is certainly possible to use F# in this domain. The succinctness of F# and the ability to define custom overloaded operators should make code based on fuzzy logic quite nice. I did a quick search and discovered a few articles implementing fuzzy logic in F#:

Prolog is a bit different question. The power (and also the weakness) of Prolog come from the fact that it has backtracking built directly in the language. This makes it very nice for implementing search algorithms based on backtracking, but it also a limitation.

F# doesn't have any direct support for backtracking, but it is quite easy to write algorithms based on backtracking using recursion (which is the main control flow mechanism in both F# and Prolog).

Also, it is possible to implement domain specific language for logical programming in F#. This means that you'd implement something like Prolog within F# and then write your search algorithms using this mini-language in F# (possibly using other F# features as needed). You can find more information about similar problems in this question.

这篇关于F#和模糊逻辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆