8皇后kanren.core success, fail, goaleval, condeseq, eq, var
时间: 2023-05-27 15:07:56 浏览: 94
As an AI language model, I can provide some information about these functions in the context of the Kanren library in Clojure:
1. `success`: This function takes a state and returns true if the state represents a successful solution to a goal. Otherwise, it returns false.
2. `fail`: This function takes a state and returns true if the state represents a failed solution to a goal. Otherwise, it returns false.
3. `goaleval`: This function takes a goal and a state and returns a sequence of zero or more new states that result from applying the goal to the state.
4. `condeseq`: This function takes a sequence of goals and returns a single goal that succeeds if all of the goals in the sequence succeed.
5. `eq`: This function takes two values and returns a goal that succeeds if the values are equal.
6. `var`: This function creates a new logic variable with a unique identifier.
Overall, these functions are used to define and manipulate logic variables, goals, and states in a declarative programming style that allows for efficient and elegant solutions to problems like the 8 queens puzzle.