F# and Fuzzy Logic

前端 未结 2 1773
傲寒
傲寒 2021-02-14 14:44

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 g

2条回答
  •  故里飘歌
    2021-02-14 15:12

    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#:

    • Fuzzy Logic in F#, Example 1
    • FuzzyAdvisor - A Simple Fuzzy Logic Expert System 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.

提交回复
热议问题