1 Introduction

Automated reasoning is an important branch of artificial intelligence, which can determine the logical attributes of problems in a rigorous and automatic deduction method [1, 2]. The first-order logic automated theorem prover (in short, FOL-ATP) is an important research content in the field of automated reasoning, which mainly including clause set preprocessing methods, heuristic strategies and inference methods, and equality processing methods [3].

The current research on FOL-ATP mainly focuses on heuristic strategies [4,5,6], but the core of the prover is still inference methods [7]. In the development process of inference methods [8, 9], Robinson proposed the milestone resolution principal method [10], which is reflected in the binary resolution method. That is, two literals from each parent clause exist one complementary pair after substitution. After eliminating the unified complementary literals, the disjunction of the remaining literals of the two parent clauses generates a new clause [11, 12]. Once the generated clause is an empty clause, the problem is solved. Significant advancements have been made in the field of automated reasoning in first-order logic during the development of theorem provers, such as Vampire [13], Eprover [14, 15], and iProver [16], with various research findings providing new perspectives and methodologies for its growth. Several improved resolution methods [17,18,19] based on binary resolution have provided solid theoretical support for automated theorem provers, including facilitating algorithm optimization. Moreover, the introduction and the application of techniques such as clause set preprocessing [20], unification processing [21, 22], and deep learning technology [23, 24] have effectively enhanced the capabilities of automated theorem-proving, enabling the systems to handle problems with complex logical structures more efficiently.

With the continuous advancement of technology, the importance of improving the core resolution methods in automated reasoning has been highlighted as the effectiveness of these methods directly impacts the overall performance of the systems. In this context, recent advancements have introduced the concept of unit propagation and learned clauses based on propositional logic solving into FOL-ATP, which is called conflict resolution [25]. Based on conflict resolution method, the prover Scavenger [26] was designed and implemented. This method employs unit propagation to analyze deduction conflicts, ultimately generating a learned clause as a new clause resulting in the corresponding strategy. Since each deduction step in binary resolution involves only two clauses and eliminates a single complementary pair of literals, researchers have attempted to explore more flexible and efficient inference mechanisms to enhance theorem-proving capabilities. A multi-clause dynamic deduction method, known as the standard contradiction separation rule, was proposed in Refs. [27, 28]. This deduction rule allows multiple (two or more) clauses to be involved in each deduction step, eliminating a set of literals in the form of a standard contradiction. The disjunction of the remaining literals from the input clauses is then used to generate a new clause [29,30,31].

Conflict resolution only handles two clauses in each deduction step, the resolvent usually contains many literals, and the efficiency of unit propagation needs to be improved when long clause participates in the deduction, which affects its deduction efficiency. Based on the multi-clause and synergized deduction characteristics of the contradiction separation rule, this paper proposes a contradiction separation conflict deduction method, which allows two or more clauses to participate in each deduction step and can utilize the dynamic and synergized deduction capability between multiple clauses [32,33,34], potentially improving the deduction efficiency of long clauses participating in conflict deduction, and providing a new scientific inference method for first-order logic automated theorem-proving.

The remainder of this paper is organized as follows: in Sect. 2, we briefly review the conflict resolution and standard contradiction separation rule through definitions and illustrations, while analyzing the potential advantages of the contradiction separation rule. Section 3 presents the novel contradiction separation conflict deduction (CSCD) method, including its definitions, illustrations, and potential deduction advantages. In Sect. 4, we discuss the challenges of implementing the CSCD algorithm and the possible ways to address these challenges. Section 5 introduces a novel contradiction separation conflict deduction algorithm. Section 6 proposes a multi-clause contradiction separation conflict deduction framework for proof search, and in Sect. 7, we provide the experimental analysis to evaluate the effectiveness of the CSCD algorithm and the performance of its combined prover using the CSCD algorithm. Finally, Sect. 8 concludes the paper and outlines plans for future research.

2 Preliminaries

The theory and the method of plain conflict resolution calculus were introduced in Ref. [25], and the first-order multi-clause dynamic deduction theory based on the standard contradiction separation rule (referred to as S-CS deduction) was proposed in Ref. [27]. This section describes the process of plain conflict resolution deduction and analyzes its deduction characteristics through example demonstration, then reviews the definition of contradiction separation deduction rule, and illustrates and analyzes its deduction characteristics through example demonstration, and finally provides a potential combination analysis of two deduction methods.

Example 1

Let \(S=\left\{ C_1,C_2,C_3,C_4\right\} \) be a clause set in first-order logic, where \(C_1=Q_1\left( x_{11}\right) \vee {\sim Q_2}\left( a\right) \), \(C_2=Q_1\left( x_{21}\right) \vee Q_2\left( a\right) \), \(C_3= {\sim Q_1}\left( a\right) \vee Q_2\left( a\right) \), \(C_4= {\sim Q_1}\left( b\right) \vee {\sim Q_2}\left( a\right) \). Here a and b are constants, \(x_{11}\) and \(x_{21}\) are variables. Figure 1 shows the process of conflict resolution for Example 1.

Fig. 1
figure 1

The process of conflict resolution

In Example 1, the conflict resolution calculus first selects some decision literals that have been assumed, for example, the decision literals \(Q_1\left( x_{11}\right) \), \({\sim Q_1}\left( a\right) \), and \({\sim Q_1}\left( b\right) \), then utilizes unit-propagating resolution rule, which is a sequence of applications of the binary resolution rule. The resolvent must be a unit clause and the final generation of empty clauses serves as the termination condition for deduction. The conclusion clause of this rule is the learned clause, which is a disjunction of duals of instances of the discharged decision literals.

From the deduction process of conflict resolution calculus, it can be seen that each deduction step involves only 2 clauses, eliminating one complementary pair of literals, which is essentially still binary resolution. Therefore, when long clauses participate in unit-propagating resolution rule, it needs to go through multiple propagation steps in the best case. Its performance efficiency also needs to be improved.

Definition 1

[27] Suppose a set of first-order logic clauses \(S=\{C_1,C_2,\ldots ,C_n\}\) (where n stands for the number of clauses), \(C_1,C_2,\ldots ,C_n\) each of the clauses needs to be a variable rename if there exist the same variants among them. For each \(C_i (i=1,2,\ldots ,n)\), there exists a substitution \(\sigma _i\) such that \(C_i^{\sigma _i}\) is partitioned into two parts \(C_i^{\sigma _i+}\) and \(C_i^{\sigma _i-}\) that do not share the same literal, \(C_i^{\sigma _i+}\) might be empty, \(C_i^{\sigma _i-}\) is not empty and satisfies the existence of at least one complementary pairs for any \((x_1,\ldots ,\ x_n)\in \prod _{i=1}^{n}C_i^{\sigma _i-}\). The \(\bigwedge _{i=1}^{n}C_i^{\sigma _i-}\) is called a Separated Standard Contradiction (S-SC), \(\vee _{i=1}^nC_i^{\sigma _i+}=\textrm{C}_n^{s\sigma }(C_1,C_2,\ldots ,C_n)\) is called to be a Standard Contradiction Separation Clause (S-CSC) as the resulting clause, where \(\sigma =\bigcup _{i=1}^n\sigma _i\) (\(\sigma _i\) could be an empty substitution), the deduction procedure is called the Standard Contradiction Separation rule in first-order logic, in short, an S-CS rule.

Example 2

Let \(S=\{C_1,C_2,C_3,C_4,C_5,C_6,C_7\}\) be a clause set in first-order logic, where \(C_1=~Q_1\left( b,a\right) \), \(C_2= {\sim Q_2}\left( b,f_1\left( b\right) ,f_1\left( a\right) \right) \), \(C_3={\sim Q_3}\left( b\right) \), \(C_4={\sim Q_2}\left( x_2,x_2,f_1\left( x_2\right) \right) \), \(C_5=Q_2\left( x_1,x_3,f_1\left( x_2\right) \right) \vee {\sim Q_1}\left( x_1,x_4\right) \), \(C_6=Q_1\left( x_1,x_2\right) \vee Q_3\left( x_1\right) \vee Q_2\left( x_2,x_2,x_4\right) \vee Q_1\left( x_1,x_4\right) \), \(C_7=Q_3\left( b\right) \vee Q_2\left( b,b,f_1\left( b\right) \right) \vee Q_2\left( a,a,f_1\left( a\right) \right) \). Here a and b are constants, \(x_{i\ }\left( i=1,2,3,4\right) \) is variables, \(f_1\) is function symbol.

Using the S-CS rule for the six clauses numbered from \(C_1\) to \(C_6\), we obtain an S-CSC involving all 6 clauses: \(C_8=\textrm{C}_6^{s\sigma }\left( C_1,C_2,C_3,C_4,C_5,C_6\right) =\emptyset \). The corresponding S-SC is \(C_1^{\sigma _1-}\wedge C_2^{\sigma _2-}\wedge C_3^{\sigma _3-}\wedge C_4^{\sigma _4-}\wedge C_5^{\sigma _5-}\wedge C_6^{\sigma _6-}\), as shown in Table 1, which presents the result of clause separation.

Table 1 Partition the \(C_i^{\sigma _i}\) for Example 2

In the process of contradiction separation deduction, decision literals from the involved clauses are used to construct standard contradictions, and it is crucial for the efficiency of the contradiction separation deduction. Table 2 shows the corresponding substitutions and decision literal of the input clause. The S-CS rule, a milestone multi-clause deduction method, presents the following strengths:

  1. 1.

    Synergized deduction. During the deduction process in S-CS, each deduction step involves multiple clauses, leading to the constructed standard contradiction having the capability of synergized deduction. Unlike traditional binary resolution methods, S-CS rule achieves the elimination of multiple complementary pairs of literals in the form of standard contradictions. Consequently, it enables the execution of a greater number of literal elimination operations in each deduction step. Therefore, it can reduce the number of deduction steps, and the newly generated clauses usually have fewer literals. Generally speaking, these are helpful for generating empty clause in subsequent deduction.

  2. 2.

    Guided deduction. During the deduction process in S-CS, the constructed standard contradiction can guide the selection of clauses for subsequent participation in deduction, reducing the dependence of deduction on heuristic strategies (How to effectively select clauses and literals). For instance, in Example 2, \(C_1\), \(C_2\), and \(C_3\) participate in deduction, it can guide the variable substitution and select clauses \(C_4\), \(C_5\), and \(C_6\) in turn, which needs to comply with the contradiction separation rule, thus directing the deduction search path.

  3. 3.

    Reusing clauses. In an S-CS deduction process, an input clause can be reused, allowing the clause to enable efficient deduction path search. For instance, in Example 2, if the variable in clause \(C_4\) is substituted with \(\{b/x_2\}\), the generated contradiction separation clause will be \(C_{10}=\textrm{C}_4^{s\sigma }\left( C_3,C_4,C_7\right) =Q_2\left( a,a,f_1\left( a\right) \right) \). If the clause \(C_4\) is reused and reset its variable to \(\{a/x_2\}\), the resulting contradiction separation clause will be \(C_{11}=\textrm{C}_2^{s\sigma }\left( C_{10},C_4\right) =\emptyset \).

Theorem 1

(Soundness Theorem of the S-CS Rule) [27, 29] Suppose a clause set \(S= \{C_1,C_2,\ldots ,C_n\}\) in first-order logic. An S-CS based dynamic deduction from S to a clause \(\mathrm {\Phi }_t\) is denoted by \(\mathrm {\Phi }_1,\mathrm {\Phi }_2,\ldots ,\mathrm {\Phi }_t\). If \(\mathrm {\Phi }_t\) is an empty clause, then S is unsatisfiable.

Due to the advantages mentioned above, a single S-CS deduction can generate clauses with fewer literals by effectively separating the standard contradiction in the input clauses compared to plain binary resolution. Simultaneously, it can also limit the number of literals in S-CSC within a specified range. In contrast, standard contradictions typically contain more literals, while the number of literals in S-CSC is fewer. The goal of automated theorem-proving in first-order logic is to generate empty clauses through the inference methods. Therefore, the fewer literals in generated clauses, the more helpful it is to achieve this goal.

Table 2 Corresponding substitution \(\sigma _i\) and decision literal of clause \(C_i\) for Table 1

The conflict resolution method is a variation of binary resolution, and binary resolution is a special case of the standard contradiction separation rule which the involved clauses are only two clauses. Therefore, expanding the features of conflict resolution into contradiction separation deduction holds significant feasibility and potential. Conflict resolution optimizes the process of automated reasoning in first-order logic through techniques such as unit propagation, learned clause analysis, conflict-driven deduction algorithms, and decision literal selection strategies, making it highly applicable in automated theorem-proving for first-order logic. Given the good deduction characteristics of the standard contradiction separation rule, the strategies and conflict resolution algorithm can be further integrated into contradiction separation deduction to enhance its overall theorem-proving capability. Specifically reflected in the following aspects:

  1. 1.

    The synergized deduction capability of the standard contradiction separation rule can help conflict resolution better handle the long clause and more easily generate conflicts.

  2. 2.

    The guided deduction capability of the standard contradiction separation rule can help conflict resolution better select decision literals and the input clauses, which is very important for the deduction efficiency of conflict resolution.

3 Conflict Deduction Method Based on Standard Contradiction Separation Rule

3.1 Contradiction Separation Conflict Deduction

Definition 2

The literal from the non-unit clause is reconstructed into a new assumed unit clause, then the new clause is called a virtual clause, and the literal is called a virtual literal.

For example, there is a non-unit clause \(C_1=Q_1\left( x\right) \vee Q_2\left( y\right) \), the literals \(Q_1(x)\) and \(Q_2(y)\) are reconstructed as new assumed unit clauses \(C_2=Q_1(x)\) and \(C_3=Q_2(y)\). \(C_2\) and \(C_3\) are called as virtual clauses, \(Q_1(x)\) and \(Q_2(y)\) are called as virtual literals.

Definition 3

In the process of contradiction separation deduction, if the deduction steps meet the following requirements:

  1. 1.

    A virtual clause is selected to participate in contradiction separation deduction.

  2. 2.

    The virtual clause and the other input clauses are allowed to repeatedly participate in contradiction separation deduction.

  3. 3.

    Except for the virtual clause, all other clauses participating in contradiction separation deduction come from the real clause set.

  4. 4.

    The Resulting Standard Contradiction Separation Clause is an empty clause.

The process of the above contradiction separation deduction is called the contradiction separation conflict deduction (in short, CSCD).

Definition 4

A new clause is obtained from the disjunction of the negative form of the unified literal of the virtual clause (The same literals need to be merged), and then the new clause is called a learned clause. This learned clause is called as Contradiction Separation Conflict Deduction Clause (in short, CS-CDC).

Example 3

Let \(S=\{C_1,C_2,C_3,C_4\}\) be a clause set, where \(C_1=Q_1\left( a\right) \vee Q_2\left( x\right) \), \(C_2=~Q_1\left( a\right) \vee Q_2\left( y\right) \), \(C_3=~Q_2\left( f\left( c\right) \right) \vee Q_3\left( b\right) \), \(C_4=~Q_2\left( f\left( c\right) \right) \), in which a, b, and c are constants, x and y are variables, and f is a function symbol. If the CSCD is used for deduction, the steps are as follows:

Step 1. Select the literal \({\sim Q_2}\left( f\left( c\right) \right) \) from \(C_3\) to be reconstructed as the virtual clause \(C_3^\prime ={\sim Q_2}\left( f\left( c\right) \right) \);

Step 2. Prioritize the participation of the virtual clause \(C_3^\prime \) in contradiction separation deduction;

Step 3. Applying the rule of contradiction separation has \(\textrm{C}_3^{s\sigma }\left( C_3^\prime ,C_1,C_2\right) =\emptyset \), where \(\sigma =\left( f\left( c\right) /x,f\left( c\right) /y\right) \);

Step 4. Take the negative form of the literal in the virtual clause \(C_3^\prime \) to obtain the literal \(Q_2\left( f\left( c\right) \right) \);

Step 5. The two literals after substitution in the deduction process are disjunction to generate the learned clause, in this case, the negative form of both literals after substitution is \(Q_2\left( f\left( c\right) \right) \), and the generated learned clause \(C_5=Q_2\left( f\left( c\right) \right) \);

Step 6. Select clauses \(C_4\) and \(C_5\) for deduction, \(\textrm{C}_2^{s\sigma } \left( C_4,C_5\right) =\emptyset \), end of CSCD step.

Theorem 2

(Soundness) Suppose a clause set \(S=\{C_1,C_2,\ldots , C_n\}\) in first-order logic. \(\mathrm {\Phi }_1,\ \mathrm {\Phi }_2,\ \ldots \,\ \mathrm {\Phi }_t\) is a Contradiction Separation Conflict Deduction Clause sequence based on contradiction separation conflict deduction from S to the clause \(\mathrm {\Phi }_t\). If \(\mathrm {\Phi }_t\) is an empty clause, then S is unsatisfiable.

Proof

Suppose a clause set \(S=\{C_1,C_2,\ldots ,C_n\}\) in first-order logic, according to the Definition 1 and Definition 3: \(\vee _{i=1}^nC_i^{\sigma _i+}=\textrm{C}_n^{s\sigma }\left( C_{k_1},\cdots ,C_{k_i},C_{k_i+1}\ldots ,C_n\right) \) is an empty clause, and \(C_{k_1},\cdots ,C_{k_i},\ C_{k_i+1},\ldots \),\(C_n\) has n clauses, \(C_{k_1},\cdots ,C_{k_i}\) are virtual clauses, \(\sigma =\bigcup _{i=1}^{n}\sigma _i\), then separates the deduction involved the virtual clauses, so there is \(\textrm{C}_{n-k_i}^{s\sigma }\left( C_{k_i+1},\ldots ,C_n\right) =\vee _{j=k_i+1}^nC_j^{\sigma _j+}\), and the separated standard contradiction is \(\wedge _{j=k_i+1}^nC_j^{\sigma _j-}, \sigma =\bigcup _{k_i+1}^{n}\sigma _i\), that is this deduction conforms to the S-CS rule and \(\vee _{j=k_i+1}^nC_j^{\sigma _j+}\) is also a S-CSC, so CS-CDC is a type of S-CSC. Because the S-CS rule has Soundness, so the contradiction separation conflict deduction also has Soundness. \(\square \)

This concludes the proof.

For example 1, if the contradiction separation conflict deduction is used, the deduction process is shown in Tables 3, 4, 5, and 6. We can get different deduction processes on how to find conflicts compared to the plain conflict resolution.

(1) The use of virtual clause for \(C_3^\prime =Q_1\left( x_{11}\right) \) contradiction separation conflict deduction is shown in Table 3:

Table 3 Contradiction separation conflict deduction of virtual clause \(C_3^\prime =Q_1\left( x_{11}\right) \)

According to Table 3, the CS-CDC is \(C_5={\sim Q_1}\left( b\right) \vee {\sim Q_2}\left( b\right) \).

(2) The use of virtual clause \(C_3^\prime ={\sim Q_1}\left( a\right) \) for contradiction separation conflict deduction is shown in Table 4:

Table 4 Contradiction separation conflict deduction of virtual clause \(C_3^\prime ={\sim Q_1}\left( a\right) \)

According to Table 4, the CS-CDC is \(C_6= Q_1\left( a\right) \).

(3) The use of virtual clause \(C_3^\prime ={\sim Q_1}\left( b\right) \) for contradiction separation conflict deduction is shown in Table 5:

Table 5 Contradiction separation conflict deduction of virtual clause \(C_3^\prime ={\sim Q_1}\left( a\right) \)

According to Table 5, the CS-CDC is \(C_7= Q_1\left( b\right) \).

(4) Select the learned clauses \(C_7\),\(C_6\),\(C_5\) for contradiction separation conflict deduction which is shown in Table 6, and generates an empty clause. Since there are no virtual clauses involved in deduction, the refutation is found.

Table 6 Contradiction separation conflict deduction without virtual clause participation

According to Table 6, the CS-CDC is \(C_8= \emptyset \), the refutation is found.

For the contradiction separation conflict deduction, multi-clause clauses are allowed to participate in deduction at each deduction step, including unit clauses and non-unit clauses in the clause set, and clauses without unified complementary literals are allowed to participate in deduction. Therefore, the contradiction separation conflict deduction can be directly used for theorem proof. When the virtual clause is not actually used in deduction (the virtual literal does not appear in standard contradiction) and deduction generates empty clauses, then the theorem is solved. Thus, it can improve the efficiency of conflict deduction.

3.2 Deduction Analysis of Contradiction Separation Conflict Deduction

By leveraging the advantages of both the S-CS rule and conflict resolution, CSCD enables multiple clauses to participate in each deduction step, thus it promotes the generation of unit propagation, and its dynamic deduction characteristics make the clauses involved in deduction more flexible. This section will offer an in-depth exploration of the characteristics and advantages of CSCD.

  1. 1.

    Multi-clause deduction. One notable characteristic of CSCD is its capability of involving multiple clauses in a single deduction step. The plain conflict resolution allows only two clauses to participate in a deduction in each deduction step. This limitation often leads to the resolvent containing a large number of literals, increasing the difficulty of unit propagation resolution. In Example 1, as illustrated in Fig. 1, when generating the learned clauses \(C_5\), \(C_6\), and \(C_7\), each requires three binary resolution steps, resulting in a total of nine binary resolution steps to generate these three learned clauses. In contrast, CSCD allows multiple clauses to participate in a single deduction step, this reduces the number of resolution steps, where the learned clauses \(C_5\), \(C_6\), and \(C_7\) are obtained in just one deduction step, thereby improving the efficiency of unit propagation. In summary, CSCD effectively utilizes the synergized deduction relationships among multiple clauses, significantly reducing the number of deduction iterations required to the learned clauses generation.

  2. 2.

    Deduction path planning. By selecting different virtual clauses to participate in deduction and thus generating different learned clauses, CSCD can effectively plan the deduction path and can find refutation by determining whether virtual clause actually participate in deduction. During deduction, the different substitutions of variables will lead to different deduction paths. In Tables 3 to 5, because the constructed standard contradiction can be used to guide the selection of subsequent clauses, different virtual clauses (e.g., \(C_1^,\), \(C_2^,\), \(C_3^,\)) can guide distinct deduction paths, resulting in different learned clauses. Because the learned clause retains the information of the substitutions during the deduction process of virtual clauses, it can plan the deduction path according to different virtual clauses by generating the learned clauses and adding them to the clause set, and avoid searching for repeated deduction paths. More importantly, it can reduce the complexity of deduction.

  3. 3.

    Stronger literal elimination ability. CSCD can take the advantages of both contradiction separation deduction and conflict resolution so that the literals in non-unit clauses can participate in deduction to generate learned clauses. Through the synergized effect of virtual clauses, original clauses and learned clauses, multiple literals in each clause involved in CSCD can be eliminated (e.g., in Table 4, \(Q_1\left( a\right) \), \(Q_2\left( a\right) \), \(\sim Q_2\left( a\right) \)), thereby better handling long clauses during the deduction process and further improving the deduction efficiency.

  4. 4.

    Theorem proving ability. Different from the plain binary resolution, a clause needs to contain complementary literal to participate in the resolution, CSCD allows virtual clause participating in deduction but does not use it to construct the standard contradiction. In this case, when CSCD generates conflicts, the refutation is found. For instance, the deduction process of \(C_5\), \(C_6\), and \(C_7\) in Table 6.

  5. 5.

    Controllable deduction. In CSCD, the number of clauses involved in deduction and the number of literals in the S-CSC can be controllable. More importantly, when the deduction does not meet user set requirements, a backtracking mechanism can be used to reselect a new clause and participate in the deduction again. Since the condition for unit propagation is to generate empty clause, it is very helpful to select or replace clause reasonably participating in deduction according to the deduction process. For example, when CSCD setting S-CSC contains at most one literal, the deduction is an improved version of the unit propagation method.

4 Contradiction Separation Conflict Deduction Algorithm: Challenges and Solutions

Theoretical analysis demonstrates that CSCD has better deduction characteristics in the domain of first-order logic theorem-proving. However, in the implementation of the CSCD algorithm, several key challenges may be encountered: the effective selection of virtual clauses, the effective evaluation of learned clause, and the control of the CSCD deduction process. Appropriate solutions are required to address these challenges to successfully implement the CSCD algorithm.

Challenge 1: How to effectively select virtual clauses to participate in deduction?

The selection of appropriate virtual clauses is a critical challenge in implementing the CSCD algorithm. Virtual clauses play an important role in two aspects: generating learned clauses and reducing repeated path search. The selection of virtual clauses must consider the current deduction path planning while avoiding overly complex strategies, which may unnecessarily increase computational complexity.

Possible solutions: (1) Priority will be given to virtual literals (or according to its predicates) in the non-unit clauses that contain a greater number of unified complementary pairs of literals in the clause set. This approach can construct larger standard contradictions and better generate conflicts, and thus generate learned clauses. Selecting corresponding virtual clauses can also help plan deduction paths. (2) It is preferred to use literals containing variables in original clauses as virtual clauses. The more variables there are in a virtual clause, the stronger its deduction flexibility and the more likely it is to generate conflicts. (3) It is preferred to use literals in the learned clauses as virtual clauses. This will be beneficial in eliminating literal in learned clauses, thereby aiding in finding refutation.

For instance, there are three clauses \(C_1=P_1\left( a\right) \vee {\sim Q}\left( a\right) \), \(C_2={\sim P_1}\left( x\right) \vee Q\left( a\right) \), and \(C_3=P_1\left( b\right) \vee {\sim Q}\left( a\right) \). The predicates \(P_1\) and \({\sim Q}\) appear twice. By applying the above rule (1) to calculate the priority of literals as virtual clauses, we can prioritize \({\sim P_1}\left( x\right) \) as a virtual clause. Reusing \({\sim P_1}\left( x\right) \) in CSCD allows us to obtain a learned clause \(P_1\left( a\right) \vee P_1\left( b\right) \). If Q(a) is prioritized as the virtual clause, no learned clause will be generated.

Challenge 2: How to effectively evaluate the learned clause during the CSCD process? Learned clauses retain the variables substitution information generated during the deduction of virtual clauses. The learned clause may be a unit clause, a binary clause, or contains more literals. Since the goal of deduction is to generate empty clause, clauses with fewer literals should be given higher priority. If the learned clause is a unit clause, it can directly participate in deduction. When the learned clause is a non-unit clause, priority should be given to selecting its literals as the virtual literals, following the selection method for virtual clauses mentioned above. In addition, it is necessary to effectively plan the learned clauses to participate in the contradiction separation conflict deduction.

Possible solution: For the sorting of learned clauses, the following rules can be used:

  1. (1)

    The number of literals: The fewer literals a learned clause contains, the more priority it is to participate in deduction. This is beneficial for generating empty clauses.

  2. (2)

    Term structure complexity: It can be measured by terms counting, where different types of terms are assigned different initial weights. The fewer terms contained in a learned clause, the simpler its deduction process, thus reducing the deduction complexity.

Applying the above rules will help to optimize the process of selecting learned clauses to participate in deduction in the CSCD, thus improving the efficiency of deduction path search.

Challenge 3: How to control the deduction process in CSCD?

The process of CSCD involves the participation of virtual clauses, original clauses and learned clauses. The core issue of CSCD is how to generate conflicts and thus generate learned clauses. Therefore, when it is difficult to generate conflicts in deduction, the backtracking mechanism should be used to reselect clauses to participate in deduction or restart the deduction of new virtual clauses, in order to improve deduction efficiency. Since virtual clauses are assumed clauses, their actual participation in deduction does not immediately lead to a conclusion. But when virtual clauses do not actually participate in deduction, it is actually a real process of s contradiction separation deduction, and the deduction results in the generation of new clauses, or empty clauses, thus drawing conclusions. Therefore, there is a need for discernment methods to analyze whether the CSCD algorithm includes a process of contradiction separation deduction. This is very helpful for improving the deduction ability of CSCD algorithm.

Possible solutions: The advantage of multi-clause deduction algorithm is that it can evaluate newly generated clauses in real time, and when they are invalid, it can use the backtracking mechanism to select new clauses to participate in the deduction. The backtracking algorithm requires real-time storage of the current deduction information. A feasible solution is to analyze whether the standard contradictions contains virtual literal. When the virtual clause participates in the deduction, the CSCD algorithm generates a learned clause, and when the virtual clause does not participate in the deduction, if an empty clause is generated, the refutation is found, or generates the contradiction separation clauses.

The above scheme not only maintains the uniformity of CSCD algorithm, but also provides a clear strategy for managing the switching between virtual clause participation in deduction and the real S-CS deduction. By marking whether virtual clauses participate in deduction, this algorithm can adaptively switch, ensuring the entire deduction process is efficient and orderly.

5 Contradiction Separation Conflict Deduction Algorithm

The corresponding implementation of contradiction separation conflict deduction is described in detail as follows:

Step 1: Virtual clause selection. Suppose a set of first-order logic clauses \(S=\{C_1,C_2,\ldots ,C_n\}\), selects literals from non-unit clauses in clause set S based on the literal attributes and deduction weight, generates these literals as new unit clauses, marks them as virtual clauses, and uses these virtual clauses as the starting clauses for contradiction separation deduction.

Step 2: Deduction clause selection. Select the unit clause set V in clause set S, and select candidate clause set Q (whether there is a unified complementary literal) in clause set S based on the virtual clause and the unit clauses in V. Sort the two clause sets V and Q based on clause attributes and deduction weight (including virtual clause selection strategy and learned clause weight evaluation). The deduction clauses consist of virtual clause, unit clause set V, and candidate clause set Q.

Step 3: Select the clauses in the unit clause set V to participate in the deduction in sequence, which prepares for the construction of standard contradictions.

Step 4: Select clause to participate in contradiction separation conflict deduction. Traverse the clause C in candidate clause set Q.

Step 5: Traverse the literal P in clause C, traverse virtual clause and unit clause set V, and check for the existence of complementary literal through variable substitution. If it can be unified, record the variables that have substitutions through the list L and continue to construct a standard contradiction using the other literals in C.

Next, the contradiction separation conflict deduction unification rules are checked: (1) the unified candidate clause C is a tautology. (2) The unified candidate clause C contains positive equality which has two equal terms. (3) The total number of literals in candidate clause C not used to construct standard contradictions is greater than 1.

If either of the above rules (1) (2) (3) is met, the deduction is invalid, then clear the variable substitutions and literals from candidate clause C in standard contradiction, the invalid weight of the candidate clause C is increased by 1, and the invalid weight of literal P in the candidate clause C is increased by 1, go back to step 5, and continue using the other literals in candidate clause C to construct the standard contradiction. If all literals in candidate clause C participating in the deduction are invalid deductions, go to step 4 and select a new candidate clause C. If the candidate clause set Q has already been traversed, clear all the substitutions during the deduction and exit this contradiction separation conflict deduction algorithm.

Step 6: Effective deduction processing. At the current deduction step, calculate the number of literals in candidate clause C not used to construct standard contradictions, record it as N, and generate new clauses Q from these remaining literals. Clause Q is divided into the following situations:

(1) Q is an empty clause. According to the unified complementary literals with the virtual literal from virtual clause in the standard contradiction (these literals are denoted as \(P_1,P_2,\ldots ,P_k\), where k is the number of complementary literals), and the learned clause R is a disjunction of the complementary instances literals (the same literals have been merged) with the virtual literal in the standard contradiction. If R is an empty clause, it indicates that the virtual clause does not participate in the deduction, that is, this is a process of contradiction separating deduction to generating an empty clause and obtaining an unsatisfiable conclusion. Otherwise, R is not an empty clause, that is, R is a learned clause. The valid weight of candidate clause C is increased by 1, the valid weight of literal P in candidate clause C is increased by 1, and the deduction weight of involved virtual literal is increased by 1. Clear all the substitutions during the deduction and exit this contradiction separation conflict deduction algorithm.

(2)Q is a unit clause. Check each virtual clause that has already participated in the deduction in sequence, if there are variable substitutions in the virtual clause, regenerate the virtual clause based on the original virtual literal and add it to the virtual clause set. Go to step 4 and select a new candidate clause C.

Algorithm 1 is the pseudo-code for the CSCD algorithm.

figure a

The functions in Algorithm 1 are being explained as follows:

In step 2, the algorithm generates learned clauses to be added to the set Q if the virtual clause participates in the deduction and finds conflicts, and if the virtual clause does not participate in the deduction then go to step 18 for contradiction separation deduction.

In step 5, a virtual clause selection strategy is applied to select a literal from clause \(C_i\) to be added to set V as a virtual clause.

In step 13, the learned clause is generated by taking each virtual clause P in the set V that participates in the deduction and forming the disjunction of the negated forms of their unified literals (with identical literals being merged). The resulting literals disjunction is referred to as the learned clause.

In step 17, learned clauses in the candidate clause set Q are sorted by evaluating their weights.

In step 29, the termination condition for deduction is that R is empty, exceeds the defined threshold, or the algorithm runs for more than the set time.

The essence of the CSCD algorithm lies in iteratively selecting clauses from the first-order logic clause set to construct standard contradictions. Its time complexity primarily depends on the number of clauses n and the number of literals m in each clause.

In the best-case scenario, when no virtual clauses are involved in the deduction, the time required to traverse each clause for deduction is O(n). Thus, the best-case time complexity is O(n), and the best-case space complexity is O(1).

In the worst-case scenario, when all literals in each clause need to be reconstructed as virtual clauses for deduction, the time required for reconstructing virtual clauses is \(O(n\cdot m)\). Consequently, the total time complexity becomes \(O(n^2\cdot m)\), which simplifies to \(O(n^2\cdot m)\). The worst-case space complexity is O(n).

6 Construction of the Contradiction Separation Conflict Deduction Framework

Clauses are the core elements of deduction and the key for finding efficient deduction paths in automated theorem-proving. Theorem proving itself is a relatively complex process, typically comprising several essential steps and modules. The first is the formula preprocessing module, which, at the initial stage of deduction, converts the input formulas into conjunctive normal form (in short, CNF) to ensure the smooth execution of subsequent deduction steps. The clause selection module comes as the next step, where heuristic strategies and clause ordering methods are employed to select clauses effectively, aiding in optimizing the efficiency of the proof search. Finally, the core component is the deduction module. In this module, the CSCD algorithm will attempt to solve the problem using the previously described approach.

To apply the CSCD method to first-order logic automated theorem-proving, this paper constructs an efficient CSCD framework, which integrates the aforementioned modules. Figure 2 is the model structure of the deduction framework, where the deduction process begins on the left side and gets conclusion on the right (The time has come or the refutation has found).

Fig. 2
figure 2

Contradiction separation conflict deduction framework

On the left side of Fig. 2 is the clause set preprocessing module, which includes format conversion, parsing, storage, and preprocessing algorithms for the clause set. This module is responsible for converting input formulas into a corresponding data structure for computer processing, laying the foundation for the subsequent deduction process. The clause selection module, located in the middle, is a crucial part of the framework. After the preprocessing module processes the clauses, heuristic strategies and clause ordering algorithms are applied to optimize clause selection and improve the efficiency of deduction path search.

The right side of Fig. 2 features the deduction module, which is the core component of the framework, applying the contradiction separation conflict rule to deduce from the input clauses. This includes the contradiction separation conflict deduction algorithm and results in the output function. The arrows in the figure depict the flow of clauses through each deduction module. The CSCD framework is a crucial technique in theorem-proving based on multi-clause contradiction separation conflict deduction, which optimizes the deduction process by reconstructing virtual clauses and generating newly learned clauses through the contradiction separation.

A complete CSCD deduction process begins with clause set preprocessing and ends with either the output of the deduction result or terminates due to timeout. The specific steps in this process are as follows:

  1. 1.

    The standard first-order logic problem (in FOF format) is read, converted into CNF format, and finally transformed into TPTP format.

  2. 2.

    Parsing the TPTP format problems, attributes of clause sets, clauses, literals, and terms (including predicates, constants, variables, and function symbols) are recorded. A binary tree structure is applied to store terms and clause sets to improve storage and retrieval efficiency, with constants in the clauses and identical variables within each clause stored in a shared space.

  3. 3.

    Clause set preprocessing. The clause set undergoes preprocessing according to appropriate methods to effectively reduce its size, thereby enhancing the capability and efficiency of theorem-proving.

  4. 4.

    Heuristic strategy configuration. Based on the heuristic strategies, relevant parameters can be set globally or by batch loading pre-configured strategy files.

  5. 5.

    Ordering. The deduction clauses are weighted according to the heuristic strategies, and the clause set is sorted in descending order of priority based on clauses weights. Clauses with higher priority participate in the deduction process first.

  6. 6.

    CSCD calculus. The problem is iteratively derived according to the set heuristic strategy based on the CSCD rules, and the learned clauses and the contradiction separation clauses are generated. The iteration exits when empty clauses are generated, or when the running time reaches a set threshold.

  7. 7.

    Results output. When the proof path is found, the clause set is determined to be unsatisfiable, and the proof path is output and stored in a file. If the proof path cannot be found within the set running time, the timeout conclusion will be given.

The CSCD framework supports the input clauses in FOF, CNF, and TPTP formats, and outputting deduction results of proof path in TPTP format. This framework features multi-clause synergized dynamic deduction, effectively leveraging the capability of multi-clause synergized deduction to minimize the number of literals in generated clauses and optimize the deduction search paths.

7 Experimental Results and Performance Analysis

To evaluate the effectiveness of the contradiction separation conflict deduction algorithm, this paper conducts experimental comparisons between CSCD and the prover Scavenger based on binary resolution conflict resolution. Then, the CSCD algorithm is applied to the international advanced prover—Eprover 3.1, which is called CSCD_E, in order to further evaluate its effectiveness. CSCD_E initially attempts to resolve the given problem using Eprover; if this attempt fails, it then switches to CSCD. Once both attempts are unsuccessful, the clauses derived by CSCD are merged with the original set and returned to Eprover for further proof searching. The above provers are evaluated on the CASC-26 problems (FOF division), and CSCD_E is also used to try to solve the hard problems with a rating of 1 from the benchmark database TPTP (version 7.5.0) [35, 36].

All experiments, except for the involving Scavenger, were conducted on a PC with a 3.60GHz Xeon(R) W-2123 processor and 32 GB of memory, running Ubuntu 18.04 64-bit, with a standard 300-second CPU time limit. The experimental data of Scavenger for the FOF division problems from CASC-26 were directly obtained from the competition results, which were executed on a 2.4 GHz Intel Xeon E5-2609 CPU with 128 GB of memory, using Red Hat Enterprise Linux Server 7.2 (Maipo) and a 300-second CPU time limit. While the hardware platforms vary slightly, the results remain comparable [37].

7.1 Comparison on Solved Problems by CSCD and Scavenger

Compared to Scavenger, which is based on the binary conflict-driven clause learning theory, the CSCD has the characteristic of multi-clause deduction, which can comprehensively utilize virtual clauses to generate learned clauses to improve deduction efficiency. As shown in Table 7, out of a total of 500 problems, CSCD solved 182 of them with 111 problems more than Scavenger. Compared to Scavenger, the average proof time of CSCD is reduced by 33.43 s with the same total number of solved problems, and solved 105 problems under the same average time of Scavenger. Experimental results show that CSCD outperformed Scavenger in terms of capability and solving efficiency.

Table 7 Comparison of CSCD and Scavenger
Table 8 The number of solved problems by CSCD_E and Eprover 3.1

CSCD is capable of handling multiple clauses in a single deduction step, which can greatly improve the efficiency of involving the long clause in deduction, and has a good ability to eliminate literals, thus facilitating the generation of empty clauses in deduction. In the process of contradiction separation conflict deduction, it is possible to dynamically adjust the clauses involved in deduction through the backtracking mechanism, thus increasing deduction efficiency and optimizing the search path for deduction.

7.2 Comparison on Solved Problems by CSCD_E and Eprover 3.1

Table 9 List of 11 problems solved by CSCD_E, but unsolved by Eprover 3.1

Figure 3 illustrates the comparison of problems solved by CSCD_E and Eprover 3.1 for the FOF division problems in CASC-26. In this figure, the vertical axis represents the CPU time spent on the solved problems, while the horizontal axis represents the number of solved problems. From the figure, it is that when aligned on the same timeline (i.e., the same horizontal axis), CSCD_E is generally positioned to the right of Eprover 3.1, or their curves nearly overlap. CSCD_E was able to solve more problems as it approached the set runtime. The experimental results indicate that CSCD_E surpassed Eprover 3.1 in both proving capability and time efficiency.

Fig. 3
figure 3

Comparison on solved problems by CSCD_E and Eprover 3.1

Table 10 The list of 9 problems with rating of 1 solved by CSCD_E

Eprover is a well-known international FOL-ATP based on superposition and rewriting that utilizes binary resolution as its core reasoning method. To further evaluate the effectiveness of the CSCD algorithm in first-order logic automated theorem-proving, an experimental comparison was conducted between CSCD_E and Eprover 3.1. As shown in Table 8, CSCD_E solved 421 problems with 11 problems more than Eprover 3.1, which solved 410 problems. For those 90 problems unsolved by Eprover 3.1, CSCD_E solved 11 problems accounting for 12.2% of the total.

The 11 problems that CSCD_E solved but unsolved by Eprover 3.1 are listed in Table 9. For these 11 problems, the average rating is 0.71, with an average of 1,375 atoms and 1,532 variables. This result indicates that CSCD can help Eprover 3.1 solve some hard problems that it cannot solve.

Due to the application of the CSCD algorithm, CSCD_E can effectively utilize the learned clauses to guide theorem proof search and employ a rapid backtracking mechanism for reselecting clauses for deduction, resulting in efficient theorem-proving. The experimental results demonstrate that the CSCD algorithm can be used to solve theorems of first-order logic.

7.3 Performance Analysis of CSCD_E for Hard Problems with Rating of 1

Through the comparative analysis of the above two sets of experiments, it has been shown that CSCD can be effectively applied to the automated theorem-proving of first-order logic. In order to further verify the effectiveness of the CSCD algorithm in solving the more challenging and difficult problems, experiments were conducted using CSCD_E on the most difficult problems with a rating of 1 in the TPTP problem library. Based on the performance evaluation of the latest generation of provers, each problem in TPTP is assigned a rating within the range of [0, 1], where a rating of 1 indicates that the problem has the highest difficulty in the current version of TPTP. Testing these problems can provide a more comprehensive evaluation of the capabilities of CSCD algorithms.

Table 10 lists the 9 problems with a rating of 1 solved by CSCD_E. The average spent time was 209.61 s. These 9 problems had an average of 16,397 atoms and 6,602 variables, indicating a large number of both. It is worth mentioning that the solved problem SEU410+3 contains 138,191 atoms and 50,536 variables.

Compared with plain conflict resolution, the CSCD algorithm demonstrates the ability of synergized deduction of multi-clauses. Unlike the unit propagation method, the contradiction separation conflict deduction allows multiple non-unit clauses to participate in deduction in one deduction step, making the participating clauses more flexible and effectively utilizing the characteristics of virtual clauses to generate learned clauses. Therefore, it can improve the efficiency of conflict resolution. The experimental results show that some hard first-order logic problems can be solved effectively by the advanced prover using the CSCD algorithm.

8 Conclusions and Future Work

Multi-clause contradiction separation deduction and conflict resolution are significant deduction theories and methods in the field of automated theorem-proving for first-order logic. The current focus of the work is on how to combine the deduction advantages of the two deduction methods, to develop specific and effective methods and algorithms to improve the deduction efficiency of conflict resolution, then further improve the performance of the theorem prover and solve challenging problems. In order to achieve this goal, this paper proposes contradiction separation conflict deduction theory, method, and feasible algorithm. The experiments show that this proposed method and algorithm can be effectively applied to the automated theorem-proving of first-order logic.

In the CSCD algorithm, the selection of virtual clauses significantly influences the generation of learned clauses. Therefore, the next phase of research will focus on optimizing the strategy for selecting virtual clauses. In addition, the participation of different learned clauses in deduction during the deduction step is crucial for deduction efficiency. Therefore, the development of optimal learned clause selection strategies is another key area of future research.