English 中文(简体)
Haskell诉Prolog 比较[封闭]
原标题:Haskell vs. Prolog comparison [closed]

Closed. This question is opinion-based. It is not currently accepting answers.


在Prolog,与Haskell相比,哪些问题得到了更好的解决? 这两种语文之间的主要差别是什么?


<><>Edit>/strong>

是否有一个能够发挥 mi的作用的Haskell图书馆(一种合乎逻辑的电压器)。

最佳回答

道歉主要是针对逻辑问题的语言,特别是来自大赦国际和语言领域的语言。 Haskell更是通用语言。

道歉是宣示性的(逻辑的)语言,因此更容易说明其中的逻辑问题。 Haskell是一种实用的语言,因此更适合计算问题。

宣示方案拟定工作:

In computer science, declarative programming is a programming paradigm that expresses the logic of a computation without describing its control flow. It attempts to minimize or eliminate side effects by describing what the program should accomplish, rather than describing how to go about accomplishing it. This is in contrast from imperative programming, which requires a detailed description of the algorithm to be run.

Declarative programming consider programs as theories of a formal logic, and computations as deductions in that logic space. Declarative programming has become of particular interest recently, as it may greatly simplify writing parallel programs.

• 职能方案拟定工作:

In computer science, functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data. It emphasizes the application of functions, in contrast to the imperative programming style, which emphasizes changes in state. Functional programming has its roots in the lambda calculus, a formal system developed in the 1930s to investigate function definition, function application, and recursion. Many functional programming languages can be viewed as embellishments to the lambda calculus.

简言之,宣言性语言宣布了一套关于哪些产出应当产生、哪些投入和利用这些规则来从投入中提取产出的规则,而功能性语言则宣布了一套数学或逻辑功能,界定投入如何转化为产出。


关于ADDED问题:我不知道,但你也无法做到:rel=“noreferer” 。 Haskell to Prolog, or implement Prolog in Haskell :

问题回答

Prolog是logic program Language,而Haskell是 语。 功能语言以功能的概念为基础,这一概念有多种论点和价值。

另一方面,意见书没有职能。 相反,predicates被用于证明“theorem”。 预测值不计算价值,可回答“假设”或“否”,并可选择性地将投入变量与数值挂钩:

职能和逻辑方案拟订的效用往往重叠。 功能性方案拟订工作近来取得了相当大的进展,尽管Prolog仍是一个独特的语言,但在很大程度上是由于它与主流组织的职能和工作方法的共同概念相比,它远比功能性方案拟订更为不同,而且往往被认为(非常)难以学习。

某些问题在Prolog执行中几乎变得微不足道,尤其是与constraintwerrs相结合。

http://en.wikipedia.org/wiki/logic_programming” rel=“noretinger”>Wikipedia





相关问题
Euler Problem in Haskell -- Can Someone Spot My Error

I m trying my hand at Euler Problem 4 in Haskell. It asks for that largest palindrome formed by multiplying two three-digit numbers. The problem was simple enough, and I thought my Haskell-fu was up ...

How does foldr work?

Can anybody explain how does foldr work? Take these examples: Prelude> foldr (-) 54 [10, 11] 53 Prelude> foldr (x y -> (x+y)/2) 54 [12, 4, 10, 6] 12.0 I am confused about these executions....

Efficient queue in Haskell

How can I efficiently implement a list data structure where I can have 2 views to the head and end of the list, that always point to a head a tail of a list without expensive calls to reverse. i.e: ...

Problem detecting cyclic numbers in Haskell

I am doing problem 61 at project Euler and came up with the following code (to test the case they give): p3 n = n*(n+1) `div` 2 p4 n = n*n p5 n = n*(3*n -1) `div` 2 p6 n = n*(2*n -1) p7 n = n*(5*n -3)...

Ways to get the middle of a list in Haskell?

I ve just started learning about Functional Programming, using Haskel. I m slowly getting through Erik Meijer s lectures on Channel 9 (I ve watched the first 4 so far) and in the 4th video Erik ...

haskell grouping problem

group :: Ord a => [(a, [b])] -> [(a, [b])] I want to look up all pairs that have the same fst, and merge them, by appending all the list of bs together where they have the same a and discarding ...

Closest equivalent to subprocess.communicate in Haskell

I want to do a popen() / python s subprocess.communicate from Haskell - start a program, give it stdin, and get its stdout/stderr. What s the most direct / Haskellish way to do this?

热门标签