Optimal answer generation by equivalent transformation incorporating multi-objective genetic algorithm

This paper proposes a framework for time-efficiently finding multiple answers that meet multiple logical constraints and are Pareto-optimal for multiple objective functions. The proposed framework determines a set of optimal answers by iteratively replacing a set of definite clauses. Clause replacement is performed using a SAT solver consisting of equivalent transformation rules (ETRs). An ETR replaces a definite clause with one or more clauses while preserving the declarative meaning of the union of the original clause and problem clauses. To efficiently find optimal answers, in this paper, we define a new class of ETRs that are generated based on the evaluation results of a multi-objective genetic algorithm (MOGA) and propose a method for generating ETRs that belong to the new class. ETRs belonging to the new class help to replace definite clauses according to user objectives such as cost–benefit performance, reliability, and financial constraints. Thus, a SAT solver that uses the new ETR class in addition to extant ETR classes can preferentially replace definite clauses that produce the optimal answer for user objectives. Experimental results indicate that the proposed framework can significantly reduce the computation time and memory usage necessary to determine a set of optimal answers for user objectives.


Introduction
Various practical problems in numerous fields, including business and research, use a satisfiability problem (SAT) solver (Barrett and Tinelli 2018;Eén and Sörensson 2004;Hutter et al. 2017;Järvisalo et al. 2012) to determine answers that completely satisfy multiple logical constraints.The equivalent transformation (ET) framework (Akama and configuration of cloud services according to the specified system requirements.
In the ET framework, a set of answers with respect to a problem is obtained by iteratively replacing a set of definite clauses using ETRs.The initial state is a singleton consisting of a definite clause representing a query, whereas the final state is a set of unit clauses, each representing an answer.Unit clauses obtained using ETRs represent the correct answer with respect to a problem.If there is no answer, the final state is an empty set.The state under computation to determine the answer consists of both definite clauses and unit clauses.The ET solver can output any unit clause from the current state, even when the computation to find the answer is still running.Therefore, if not all answers for a given problem are needed and the unit clause representing the optimal answer is found, the clause replacement can be terminated at a point determined by the user.Moreover, the ET solver can use the saved clause set to restart the computation and generate the remaining answers.However, the ET framework does not have a mechanism to evaluate the optimality of the answer, so clause replacement is performed until all answers have been generated.
If multiple answers are generated for a given problem, the optimal answer with respect to user objectives such as costbenefit performance, reliability, and financial constraints should be selected from all the generated answers.In other words, the answer that the user needs should be selected from all answers that meet constraint satisfiability and optimality conditions for user objectives and requirements.However, solver programs built solely with ET cannot determine optimal answers based on the maximization and/or minimization of values with respect to objective functions, and therefore cannot evaluate the optimality of answers.A multi-objective genetic algorithm (MOGA) Konak et al. (2006) can identify answers with the best trade-off values (Pareto-optimal answers) for multiple objective functions from answers generated via non-dominated sorting.However, solver programs built solely with MOGA cannot guarantee the correctness of answers with respect to logical constraints.We assert that users can find satisfactory answers effectively by using a set of definite clauses that reflect the MOGA evaluation result when performing clause replacement using ETRs.
Consequently, this paper proposes a problem-solving framework that combines two different techniques, ET and MOGA, to time-efficiently find multiple answers that meet multiple logical constraints and are Pareto-optimal for multiple objective functions.In this paper, this framework is called the ET with embedded multi-objective optimization (ETMO) framework.ETMO uses ET to guarantee the satisfiability of each answer for logical constraints and MOGA to evaluate the optimality of each answer for user objectives.In ETMO, a set of definite clauses that reflect the MOGA evaluation result is generated from the definite clause that appears in the state under computation.A set of reflected clauses is also generated from the definite clause while preserving the declarative meaning of the original clause.To generate the reflected clause, this paper defines a new class of ETRs that are generated based on the MOGA evaluation result and proposes a method for generating ETRs that belong to the new class.By preferentially replacing the reflected clause, a unit clause that represents the optimal answer is efficiently determined.ETMO works efficiently when solving problems in which there are more than hundreds of answers and each answer has a trade-off relationship with other answers with respect to user objectives.Compared to Basic ET, ETMO reduces the computation time and memory usage necessary to determine a set of optimal answers because clause replacement can end when the optimal answers are found during the calculation.
The remainder of this paper is organized as follows.Section 2 gives an overview of relevant frameworks that generate a correct and efficient SAT solver for a given problem and extant methods that generate ETRs from a definite clause.Section 3 explains the framework for solving problems using ETRs.Section 4 defines the new class of ETRs needed to efficiently find optimal answers and outlines clause replacement according to ETMO.Section 5 demonstrates the generation of optimal answers using ETMO.Section 6 shows the effectiveness of problem solving using ETMO as compared with Basic ET and explains future possibilities of ETMO.Section 7 presents concluding remarks.

Relevant studies
In addition to ET, there are other frameworks for generating correct and efficient solver programs for given problems.Constraint handling rules (CHR) (Frühwirth 1998(Frühwirth , 2015(Frühwirth , 2017;;Holzbaur and Frühwirth 1999) is an extended logic programming (LP) (Lloyd 1993;Sterling and Shapiro 1994) framework that generates solver programs by describing procedural knowledge using logical formulas that specify the equivalence between constraints.However, because the CHR solver uses logical formulas to describe procedures, the procedures are described using ground instances only.In contrast, the ET solver describes procedures using non-ground instances.Furthermore, previous studies (Miura et al. 2009a(Miura et al. , 2013) ) have shown that the solver program generated by CHR is a subset of ET.
Conflict-driven clause learning (CDCL) (Davis et al. 1962;Marques-Silva and Sakallah 1999) is another framework for generating correct and efficient solver programs.The CDCL solver determines the satisfiability of propositional logic formulas described in conjunctive normal form and uses special clauses, called learnt clauses, to efficiently generate answers that satisfy constraint conditions.Efficient calculation using the CDCL solver results in short computation times.However, the CDCL solver solely uses unfolding and folding rules, which belong to one of the ETR classes, whereas the ET solver can use a variety of other ETR classes.Furthermore, previous studies (Akama and Ekawit 2013a, b) have shown that the solver program generated by CDCL is a subset of ET.Consequently, this paper proposes an extension framework for ET-based problem solving.
ETRs help develop correct and efficient solver programs for various practical problems.Consequently, several methods (Akama and Nantajeewarawat 2022;Koike et al. 2000;Miura et al. 2013) for generating ETRs have been proposed.The methods proposed in Akama and Nantajeewarawat (2022), Koike et al. (2000) use meta-computation to generate ETRs.Meta-computation employs special definite clauses with constant domain/type information such as numbers, strings, and lists to generate procedural knowledge for generating ETRs.Another method for generating ETRs with a different approach has also been proposed, called the LEbased method Miura et al. (2013).The LE-based method generates ETRs via logical equivalences (LEs), each of which describes the equivalence of the declarative meaning between two sets of logical constraints.These methods help automate the generation of various ETRs that belong to different classes from a given definite clause.However, the ETRs generated by these methods cannot replace definite clauses according to user objectives to efficiently find the optimal answer for a given problem.Thus, this paper differs substantially from extant methods because the new class of ETRs provided in this paper focuses on clause replacement to efficiently find the optimal answer.

Problem description
In the ET framework, a problem is a pair D, {q} , where D is a set of definite clauses representing the definition of predicates, called background knowledge, and {q} is a singleton consisting of a definite clause representing a query.Any d ∈ D and q are defined according to first-order predicate logic (Lloyd 1993;Sterling and Shapiro 1994).The aim is to generate a program that solves multiple problems, so a specification is a set of problems.The head part of a definite clause consists of one atomic formula (atom), and the body part consists of one or more atoms.An atom is composed of one predicate p and zero or more terms t.A term t is a given variable or constant.For example, an atom with two terms is written as p(t 1 , t 2 ).A variable is a symbol that begins with an asterisk.We assume that any predicate appearing in the head part of q exists neither in D nor in the body part of q.
Various predicates can be defined in D, and various queries can be made by combining multiple predicates on D. For example, in the realm of predicate logic, the predicate for the concatenation of lists is generally described as follows: Following the definition of the Append predicate, we can define the following query q 1 representing the concatenation of two lists.
This query means that for [A, B] produced by concatenating the ground instances of * x and * y, find the satisfiable ground instances of * x and * y with respect to D.

Answers
In the ET framework, a set of multiple answers is generated with respect to a problem.Each answer is described by a unit clause, and the number of answers is the same as the number of unit clauses.The head part of a unit clause consists of one atom, and the body part has no atoms.For example, for the problem D, {q 1 } , the following three unit clauses are obtained, where There is no answer other than the three answers above because the use of the ET solver ensures that all the answers with respect to a problem are obtained.If no unit clause is obtained, there is no answer with respect to a given problem.

Computation
In the ET framework, computation iteratively replaces a clause set based on the equivalence of the declarative meaning, so that computation is a sequence seq where G 1 = {q}.Given a clause set G, the declarative meaning of G, denoted by M(G), represents all ground atoms determined from G. (The definition of the declarative meaning is explained in Akama and Ekawit (2014), Miura et al. (2013).)Given two clause sets G i and G j and background knowledge holds, the declarative meaning of G i is equivalent to that of G j with respect to D. The first element of seq, that is G 1 , is a singleton consisting of a definite clause, whereas the last element is a unit clause set or an empty set.The other elements of seq consist of both definite clauses and unit clauses.For example, in the computation for solving the problem D, {q 1 } shown in Sect.3.1, the first element of seq of the problem is {q 1 }, whereas the last element is {a 1 , a 2 , a 3 }.

Programs
In the ET framework, a program to solve a given problem is a set of ETRs.Given a clause set G i and background knowledge D, an ETR replaces a definite clause cl(∈ G i ) with a set of one or more clauses cls, while preserving the declarative meaning of {cl} and G with respect to The partial correctness of a program, composed of ETRs, with respect to D is always guaranteed because each ETR is completely independent and individually correct.
When an ETR (B, C ⇒ D.) is applied to a definite clause (Answer ← A, B, C), a clause set {(Answer ← A, D)} is obtained.In addition, when two or more arrows appear in an ETR, such as (B, C ⇒ D; ⇒ E, F.), the same number of clauses as the number of arrows is obtained, such as {(Answer ← A, D), (Answer ← A, E, F)}.An ETR applied to a definite clause is generated based on D. (Detailed explanation on the definition of ETRs is given in Akama and Ekawit (2014), Miura et al. (2013).)The following rule r 1 is one of the ETRs that can be applied to definite clause q 1 shown in Sect.3.1.Two clauses are obtained by applying r 1 because two arrows appear in r 1 .By applying r 1 to q 1 , q 1 is replaced with the two clauses q 2 and q 3 .
The definite clause q 3 can be replaced using r 1 , whereas a new rule is required to replace the definite clause q 2 .
4 Clause replacement framework using ETMO As shown in Fig. 1, OpETRs are used in conjunction with normal ETRs when using ETMO to replace clause sets.When using Basic ET to replace clause sets, normal ETRs only are used.A normal ETR is simply called an ETR in the rest of this paper.An OpETR can be applied to a definite clause at the timing specified by the user.In this paper, we use an OpETR to replace definite clause q as an element of the initial state of a clause set.All unit clauses obtained from an initial state {q} using ETMO completely meet constraint satisfiability with respect to background knowledge D. Furthermore, the final state of a clause set determined using ETMO is the same as using Basic ET.

Clause replacement workflow using ETMO
ETMO is primarily utilized to generate a clause set comprising unit clauses that represent the answer evaluated as optimal using MOGA in the middle of the calculation.With ETMO, optimal answers are obtained from the current clause set even if the computation to generate the answer has not been completed.Clause replacement using ETMO proceeds as follows: Phase 1: Generate Pareto-optimal answers using MOGA In MOGA Konak et al. (2006), a search is performed to find individuals with the best trade-off values for multiple objective functions.The output of the objective function represents the fitness value of an individual with respect to evaluation metrics such as cost-benefit performance, reliability, and financial constraints.In this paper, we use non-dominated sorting genetic algorithm II (NSGA-II) Deb et al. (2002), in which individuals with the best trade-off values are determined via non-dominated sorting and crowding distance.The operations performed in this phase are as follows: (1) Generate individuals based on the problem D, {q} ; (2) Determine an initial population composed of the individuals; (3) Generate Pareto-optimal answers from the population.
In ETMO, each individual can be represented by a unit clause, because individuals represent ground instances of an Answer atom.However, the constraint satisfiability of the unit clauses obtained by MOGA computation is not guaranteed.This is because MOGA finds all optimal answers, but cannot determine their satisfiability with respect to D.
Step (1) generates various ground substitutions for the variables appearing in an Answer atom based on the problem D, {q} .This step uses the problem D, {q} to refer to constant domains and constant types, such as numbers, strings, and lists, which apply to variables.Therefore, an individual that represents an unsatisfiable atom with respect to D could be generated.
The individuals i 1 , i 3 , and i 6 are the satisfiable atoms, whereas the individuals i 2 , i 4 , and i 5 are the unsatisfiable atoms.In ETMO, Step (2) determines an initial population for MOGA computation with a size of one hundred individuals.If more than one hundred individuals are generated in Step (1), one hundred individuals are randomly selected in Step (2).In Step (3), the optimal population is generated from the initial population over multiple generations.The objective functions used in MOGA computation are defined according to user objectives such as cost-benefit performance, reliability, and financial constraints.Therefore, the objective function changes depending on the given problem and the user objective.

Phase 2: Replace clause sets using ETRs and OpETRs
In ETMO, a definite clause is replaced with a set of one or more clauses by a one-time application of an ETR or an OpETR.If a unit clause set or an empty set is obtained, the clause replacement is terminated, as it would mean there is no clause applicable to ETRs or OpETRs.In addition, if a unit clause representing the optimal answer is obtained, the clause replacement can be terminated in the timing specified by the user.Various methods for generating ETRs have been proposed (Akama et al. 2001;Koike et al. 2000;Miura et al. 2009b), and it is assumed that the ETRs used in ETMO are generated according to these methods.Thus, only the OpETR generation method is explained in this paper, as it has not been discussed previously.Given a problem D, {q} , the initial state of a clause set in this phase is {q}, which is named Q.The operations performed in this phase are as follows: (1) Select one definite clause cl(∈ Q) to apply the rule; (2) Replace definite clause cl using ETR or OpETR; (3) Generate the next state of clause set Q; (4) Evaluate the optimality of the unit clauses obtained in (3).
ETMO ranks each definite clause to efficiently generate unit clauses representing the optimal answers.In Step (1), the high-priority definite clauses are preferentially selected from clause set Q.If all the definite clauses have the same rank, definite clause cl is randomly selected.In Step (2), definite clause cl is replaced using an ETR, but an OpETR is used if control is needed for the specialization of variables that appear in the head atom of cl.In addition, in this paper, definite clause cl selected from clause set Q of the initial state is replaced using an OpETR.An ETR is applicable to a definite clause cl, whereas an OpETR is applicable to a definite clause cl automatically generated by a simple transformation of the formula from cl.Given a definite clause cl = (H ← B 1 , • • • B k ), a definite clause cl generated from cl is as follows: where H and B k are atoms, v i is a variable that appears in H , and the Optimi ze atom consists of all variables that appear in H .The definite clause cl is generated from definite clause cl while preserving the declarative meaning of cl with respect to background knowledge D; i. Step (4) evaluates the optimality of the unit clause(s) obtained by the processing of Step (2).In addition, Step (4) uses the Pareto-optimal answer generated in Phase 1 to specify the optimality of the unit clause.If there is no optimal answer for the unit clauses obtained in Step (2), the clause replacement is restarted from Step (1).Conversely, if there is an optimal answer, it is possible to abort the clause replacement.The clause replacement can be resumed using the current state of clause set Q even if the clause replacement is aborted during the computation.

OpETRs generation workflow
As shown in Sect.4.1, an OpETR replaces an Optimi ze atom in the body part of definite clause cl with multiple Op Pattern or N ot Op Pattern atoms.An OpETR is generated according to the following steps: (1) Classify individuals in the Pareto-optimal answer according to the features of the answer; (2) Select the class that has the most elements; (3) Make a general instance that applies to variables of the As this OpETR consists of two body parts, the definite clause cl is replaced with two definite clauses.A definite clause with an Op Pattern atom has a higher rank than a definite clause with a N ot Op Pattern atom.

Problem settings
This section uses the optimal allocation problem of cloud services treated in Miura et al. (2018).The objective is to determine the optimal number of virtual machines (VMs) and the computational performance required to deploy a genome analysis workflow Trapnell et al. (2012).In many cases, a genome analysis workflow is a sequential processing of multiple analysis tools.Details on how to determine the appropriate cloud services for deploying a genome analysis workflow is given in Miura et al. (2018).The method gives five predicates for specifying user requirements and two objective functions to determine the optimal answer.The Equal atom is a built-in atom of the ET solver.A query in the problem is generated from a logical formula composed of atoms generated by the five predicates.As there are numerous cloud providers, instance types, and legal/policy requirements, we can determine many different allocation patterns of cloud services for a given query.Figure 2 depicts one hundred and four allocation patterns of cloud services to deploy a genome analysis workflow composed of three analysis tools.The optimal answer is determined with the best trade-off between analysis time and infrastructure usage fees where these values are estimates.The method proposed in Miura et al. (2018) aims to determine optimal computation infrastructures displayed in the dashed ellipse section shown in Fig. 2.This experiment demonstrates that ETMO can preferentially find the optimal computation infrastructure shown in Fig. 2. For the problem that produces the answers shown in Fig. 2, the query is as follows: In the genome analysis workflow of this problem, tool T1 is executed first, then tool T2, and finally tool T3.The variable * structure is given a computation infrastructure that satisfies nine constraints that appear in the body part of dcl 1 .(Detailed explanation of the atoms appearing in this definite clause is omitted in this paper.)In this experiment, MOGA evaluation results are used to control the specialization of * structure according to the appropriate number of VMs.
The initial state of clause set Q in Phase 2 shown in Sect.4.2 is a singleton consisting of the above definite clause.Moreover, in this experiment, we terminate the clause replacement when a unit clause representing the optimal answer is generated.

Experimental results
In Phase 1, the Pareto-optimal answer set is generated from the initial population composed of one hundred individuals over ten generations, and consists of seventy eight individuals.The answers that satisfy the constraints described by the definite clause dcl 1 do not appear in the Pareto-optimal answer set.However, the satisfiable answers could be generated depending on the number and combination of constraint conditions.Now, we focus on the number of VMs used to deploy the genome analysis workflow shown in each answer.
Given the definite clause dcl 1 , the maximum number of VMs is three.The VM deployment pattern shown in the Paretooptimal answers is as follows: (P1) All tools are executed on one VM; i.e., one VM is used.(There are three answers.)(P2) The workflow is divided into first half and second half; i.e., two VMs are used.(There are thirty nine answers.)(P3) VMs are deployed per analysis tool; i.e., three VMs are used.(There are thirty six answers.) In the above (P2), there are cases where "analysis tools T1 and T2 are executed on the same VM" and "analysis tools T2 and T3 are executed on the same VM."In this experiment, we will treat these cases as one deployment pattern.
In Phase 2, as the initial clause set Q is {dcl 1 }, the definite clause cl selected in Step (1) is the definite clause dcl 1 .In addition, the definite clause dcl 1 is replaced using an OpETR generated based on the VM deployment pattern determined by MOGA computation.The Optimi ze atom that appears in the definite clause cl generated from the definite clause dcl 1 is Optimi ze( * structure).Therefore, we generate an OpETR that controls the specialization of * structure.
From the MOGA results above, it is recommended to substitute * structure with the deployment pattern (P2) or (P3) because the number of individuals belonging to (P2) is almost equal to the number of individuals belonging to (P3).When the deployment pattern (P2) is selected, the Op Pattern and N ot Op Pattern atoms will be generated as follows: Therefore, the OpETR generated using these atoms is written as follows: The definite clause cl is replaced with two definite clauses by applying the rule opr 1 .One of the clauses is a definite clause with an Op Pattern atom.Let dcl 2 be this clause.
The other clause is a definite clause with a N ot Op Pattern atom.Let dcl 3 be this clause.The definite clause dcl 2 has a higher rank than the definite clause dcl 3 because dcl 2 includes an Op Pattern atom.As a result of applying the rule, the next state of clause set Q is {dcl 2 , dcl 3 }.The clause replacement will be restarted from Step (1) because there is no optimal answer in clause set Q.In this experiment, ETRs are used to preferentially replace dcl 2 and definite clauses obtained from dcl 2 .After replacing clause set Q a total of 8,568 times using ETRs, the following unit clause is generated: Unit clause ucl 1 represents the optimal answer and is plotted in the dashed ellipse section shown in Fig. 2. Unit clauses other than the definite clause ucl 1 are not obtained before generating ucl 1 .The clause replacement ends because a unit clause representing the optimal answer is generated.However, if the user needs a different answer, clause set Q can be replaced to find other unit clauses.
If the deployment pattern (P3) is selected to generate an OpETR, the Op Pattern and N ot Op Pattern atoms will be generated as follows: The definite clause cl is replaced with two definite clauses, similar to the replacement of the definite clause cl using an OpETR opr 1 .Let dcl 4 be a definite clause with an Op Pattern atom and dcl 5 be a definite clause with a N ot Op Pattern atom.Therefore, the state of clause set Q changes from {dcl 1 } to {dcl 4 , dcl 5 }.After replacing clause set Q a total of 19,104 times using ETRs, the following unit clause is generated: [aws, c5.9xlarge, ap-northeast-1, [T1]], [aws, c5.9xlarge, ap-northeast-2, [T2]], [aws, m5.xlarge, ap-northeast-2, [T3]] ]) ← The definite clause dcl 4 and definite clauses obtained from dcl 4 are preferentially selected here, because dcl 4 has a higher rank than dcl 5 .The unit clause ucl 2 represents the optimal answer and is plotted in the dashed ellipse section in Fig. 2. The clause replacement ends because a unit clause representing the optimal answer is generated.
Three unit clauses other than the definite clause ucl 2 are obtained before generating ucl 2 .However, the three unit clauses are not optimal answers.For example, one of the three definite clauses is as follows: ucl 3 : answer ([ [aws, c5.9xlarge, ap-northeast-1, [T1]], [aws, m5.12xlarge, ap-northeast-2, [T2]], [aws, m5.large, ap-northeast-2, The definite clause ucl 3 is not an optimal answer, and is plotted outside the dashed ellipse section in Fig. 2. In Phase 2, the clause replacement continues automatically if the optimal answer is not available.Therefore, the clause replacement continues after generating ucl 3 .As the optimality of the answers is determined by the objective functions, the definite clause ucl 3 could be an optimal answer when using different objective functions in MOGA computations.
This experiment showed that ETMO can efficiently find an optimal answer using an OpETR and ETRs.However, we need to generate an OpETR that is not misleading to find a satisfiable answer because MOGA does not guarantee the satisfiability of answers with respect to background knowledge D. As a future challenge, we will propose a method to effectively utilize the results of MOGA computation.

Comparison of ETMO with Basic ET
The advantage of ETMO over Basic ET is that the results of MOGA computations can be used to generate optimal answers.This advantage allows ETMO to use the OpETR to preferentially generate optimal answers and terminate the clause replacement when an optimal answer is generated.Many methods (Akama et al. 2001;Koike et al. 2000;Miura andAkama 2014, 2021;Miura et al. 2013Miura et al. , 2009b) ) for generating ETRs have been proposed for use in Basic ET.These are methods for generating normal ETRs, not OpETRs.A normal ETR specializes in variables in order to efficiently generate all answers, and replaces each atom with another atom to simplify the constraint conditions.For example, the method proposed in Miura et al. (2009b)  Functionality-based rules unify two variables included in two atoms owing to the constraint of a predicate between the two atoms that satisfy the specified conditions.Functionalitybased rules are used to facilitate the specialization of variables appearing in a definite clause and prevent infinite clause replacement loops.Meanwhile, the method proposed in Miura et al. (2013) produces the following ETR, called a false rule: False rules remove any definite clause that contains atoms that do not satisfy the constraints of predicates.False rules are used to reduce the fruitless replacement of definite clauses that do not generate unit clauses.That is, a normal ETR cannot control the clause replacement in order to efficiently generate the unit clause representing the optimal answer, as in OpETRs.Moreover, Basic ET cannot evaluate the optimality of the unit clause for user objectives because Basic ET cannot search for answers by maximizing or minimizing the values of user objectives.Because Basic ET always needs to generate all the answers, the clause replacement cannot end in the middle of the calculation even if the optimal answers are generated.ETMO evaluates the optimality of each answer in the middle of clause replacement.
We will now use the example shown in Sect. 5 to demonstrate that the calculation cost of ETMO is lower than that of Basic ET.The efficiency of calculations in the ET solver depends on the number of clause replacements and the maximum size of clause set Q until the user finds the answer that satisfies the constraint conditions.The values in the Time column shown in Table 1 are the average times when calculating the optimal answer generation ten times; plus/minus values are standard variations.As shown in Table 1, when the deployment pattern P2 is selected, the number of ETMObased clause replacements is 8,569.In addition, when the deployment pattern P3 is selected, the number of ETMObased clause replacements is 19,105.In contrast, the number of Basic ET-based clause replacements is 863,116.That is, the number of ETMO-based clause replacements is significantly less than that of Basic ET-based clause replacements by a factor of forty five.Moreover, when the deployment pattern P2 is selected, the maximum size of clause set Q in ETMO is 33.In addition, when the deployment pattern P3 is selected, the maximum size of clause set Q in ETMO is 51.
In contrast, the maximum size of clause set Q in Basic ET is 136.That is, the maximum size of clause set Q of ETMO is smaller than that of Basic ET by a factor of three.The maximum size of clause set Q increases with the number of satisfiable answers and ground substitutions with respect to background knowledge D. As shown in Fig. 3, Basic ET increases memory usage because the clause replacement cannot end in the middle of the calculation, even if the optimal answer for user objectives is found.In contrast, ETMO will end the clause replacement at the timing specified by the user when a satisfactory answer is found.The time complexity of ETMO is determined by the number of clause replacements using ETRs, which depends on the constraints specified in the query.For example, if Location( * structure, [L1], [Tokyo]) appearing in dcl 1 shown in Section 5.1 is changed to Location( * structure, [L1], [Tokyo, Seoul]), the number of atoms appearing in dcl 1 does not change, but it is expected that the number of clause replacements will increase.This is because we need to determine whether there is an answer that meets the added location, that is, Seoul.Therefore, the time complexity is highly dependent on the number of atoms and the described content of each atom.Furthermore, it is not possible to pre-dict whether the number of clause replacements will increase or decrease.

Application to ETR generation method
In developing ETMO, we collected the data used for the example application within the CREST project.To apply ETMO to another actual problem, we would need to collect problem and domain-specific data to tune it.However, as another application example, we believe that ETMO can be used to propose new ETR generation methods.For example, given the following query cl a , the answer cl b to the query is obtained using ETRs.The Palindrome predicate specifies that a given list is a palindrome.Therefore, the query cl a means that for [ * x, 2, 3, * y, 1] that is a palindrome, find satisfiable ground instances of the variables * x and * y with respect to background knowledge D. The program that solves the problem D, {cl a } consists of five ETRs; the two ETRs, r a and r b , presented below are components of the program.In this section, the three other  The ET solver will generate cl b from cl a by applying ETR 168 times.On the other hand, the following ETR, r c , can be generated by combining r a and r b : If the program uses r c instead of r a and r b , the ET solver will generate cl b from cl a by applying ETR fourteen times.Combining current ETRs in this way can facilitate the generation of new ETRs that help to reduce the number of clause replacements.However, finding the appropriate combination requires high-level experience in ET programming.We believe that ETMO can be used to find the appropriate pattern from various combinations of atoms that appear in current ETRs.

Conclusions
In this paper, we proposed a problem-solving framework that combines two different techniques, ET and MOGA, to time-efficiently find multiple answers that meet multiple logical constraints and are Pareto-optimal for multiple objective functions.Because optimal answers are generated by replacing the set of definite clauses that reflect the results of MOGA computation, based on ET, any optimal answer satisfies the constraint satisfiability.The advantage of ETMO is that it uses a special ETR called an OpETR that controls the variable specialization for efficiently generating satisfactory answers by the user.As the OpETR concept does not appear in Basic ET, this paper extends the ET-based problem solving framework.Furthermore, this paper explained the effectiveness of ETMO based on a comparison with Basic ET.
However, we consider that there is a need for an advanced mechanism for utilizing the results of MOGA computation when generating an OpETR.Therefore, as future work, we are developing a method to effectively utilize the results of MOGA computation.

Fig. 1
Fig. 1 Differences in clause replacement between ETMO and Basic ET For example, when generating an individual based on the problem D = {d 1 , d 2 , d 3 , d 4 }, {q 1 } shown in Sect.3.1, an individual representing atoms such as the following is obtained. i e., M(D∪{cl}) = M(D∪{cl }) holds.Step (3) combines clause set Q and the clause set obtained in (2) to generate the next state of clause set Q, where Q = Q − {cl}.If the clause replacement continues, Step (1) selects a definite clause cl from the new clause set Q generated in Step (2).
Optimi ze atom according to the features of the class; (4) Generate Op Pattern and N ot Op Pattern atoms using the general instance and variables of the Optimi ze atom; (5) Generate an OpETR using the Optimi ze, Op Pattern, and N ot Op Pattern atoms.The usefulness of an OpETR depends on a general instance applied to the second term of Op Pattern and N ot Op Pattern atoms.To determine an effective general instance, it is important to perform appropriate classification of optimal ground instances obtained by MOGA computation.In this paper, the classification of the optimal ground instances is performed manually, because the classification policy changes depending on the given problem.For example, it is assumed that a general instance answer ([ * a | * b], [ * c | * d]) is given for the problem D = {d 1 , d 2 , d 3 , d 4 }, {q 1 } , shown in Sect.3.1, and an OpETR is applied to the following definite clause cl : cl : Answer ( * x, * y) ← Optimi ze( * x, * y), Append( * x, * y, [A, B]) From answer ([ * a | * b], [ * c | * d]), two Op Pattern atoms and two N ot Op Pattern atoms are generated, because * x is substituted with [ * a | * b] and * y is substituted with [ * c | * d].Op Pattern( * x, [ * a | * b]) Op Pattern( * y, [ * c | * d]) N ot Op Pattern( * x, [ * a | * b]) N ot Op Pattern( * y, [ * c | * d]) As a result, an OpETR composed of these atoms is generated as follows: Optimi ze( * x, * y) ⇒ Op Pattern( * x, [ * a | * b]), Op Pattern( * y, [ * c | * d]); ⇒ N ot Op Pattern( * x, [ * a | * b]), N ot Op Pattern( * y, [ * c | * d]).

Fig. 2
Fig. 2 Universal set of answers obtained for a given problem