unification
Requires MonadPlus (ST a) Instance
I\'m reading the paper Typed Logical Variables in Haskell, but I\'m failing to understand the details of the ultimate implementation. In particular, the backtracking state transformer introduced in se[详细]
2023-04-11 20:58 分类:问答":=" and "=>" in Mercury
I recently came across this code example in Mercury: append开发者_运维知识库(X,Y,Z) :- X == [],[详细]
2023-03-25 11:32 分类:问答Given a substitution S and list Xs, how to apply S to Xs
Suppose I have a substitution S and list Xs, where each variable occurring in Xs also occurs in S. How would I find the list S(Xs), i.e., the list obtained by applying the substitution S to the list X[详细]
2023-03-10 09:14 分类:问答behaviour of unification in prolog in presence of arithmetic operators
12 ?- 3+4*5 = X+Y. X = 3, Y = 4开发者_如何学编程*5. 13 ?- 3+4*5 = X*Y. false. 16 ?- 3*4+5 = X*Y. false.[详细]
2023-02-17 01:26 分类:问答Instantiate type variable in Haskell
EDIT: Solved. I was unware that enabling a language extension in the source file did not enable the language extension in GHCi. The solution was to :set FlexibleContexts in GHCi.[详细]
2023-01-31 18:45 分类:问答What is a unification algorithm?
Well I know it might sound a bit strange but yes my question is: \"What is a unification algorithm\".[详细]
2023-01-31 01:03 分类:问答Prolog Code Example: Unification
From an old final for my class: Here is some prolog code: mystery(1, 1). mystery(N, F) :- N1 is N-1, mystery(N1,F1),[详细]
2023-01-29 07:56 分类:问答Unification - Infinity of results
I\'m developing (in Java), for fun, an applic开发者_如何学Cation which uses an unification algorithm.[详细]
2023-01-24 19:45 分类:问答Why does SWI-Prolog unify a quoted and unquoted string (without spaces) to the same rule?
Assume I have the following rules: unify(\'test\', \'this is a test\'). run :- write(\'Enter something: \'),[详细]
2023-01-23 19:24 分类:问答Pattern matching equivalent variables in Haskell, like in Prolog
In prolog, we can do something like the following: myFunction a (a:xs) = ... This is, when the 1st argument of myFunction is the same as the first item of the list that\'s in the 2nd argument, this[详细]
2023-01-23 15:41 分类:问答