Instruction: Write an abstract for the following acadamic paper.

Input:
Paper: we have recorded the flight of a fly during take off and landing using digital high speed photography . it is shown that the dynamics of flexible wings are different for these procedures . during this observation fly flew freely in a big box and it was not tethered .
Abstract: in this fluid dynamics video , we demonstrated take off and landing of a fly . the deformation of wings is in focus in this video .

Paper: modal logics have proven to be a valuable tool in mathematics and computer science . the traditional uni - modal logic enriches the propositional language with the operator @xmath2 where @xmath3 is interpreted as _ @xmath4 possibly holds_. the usual semantics interpret modal formulas over graphs , where @xmath3 means `` there is a successor world where @xmath4 is true . '' in addition to their mathematical interest , modal logics are widely used in practical applications : in artificial intelligence , modal logic is used to model the knowledge and beliefs of an agent , see e.g.  @xcite . modal logics also can be applied in cryptographic and other protocols @xcite . for many specific applications , there exist tailor - made variants of modal logics @xcite .    due to the vast number of applications , complexity issues for modal logics are very relevant , and have been examined since ladner s seminal work  @xcite . depending on the application , modal logics with different properties are studied . for example , one might want the formula @xmath5 to be an axiom  if something is true , then it should be considered possible . or @xmath6if it is possible that @xmath4 is possible , then @xmath4 itself should be possible . classical results  @xcite show that there is a close correspondence between modal logics defined by axioms and logics obtained by restricting the class of considered graphs . requiring the axioms mentioned above corresponds to restricting the classes of graphs to those which are reflexive or transitive , respectively . determining the complexity of a given modal logic , defined either by the class of considered graphs or via a modal axiom system , has been an active line of research since ladner s results . in particular , the complexity classes @xmath0  and @xmath1  have been at the center of attention . most complexity results have been on a case - by - case basis , proving results for individual logics both for standard modal logics and variations like temporal or hybrid logics  @xcite . examples of more general results include halpern and rgo s proof that logics including the _ negative introspection _ axiom , which corresponds to the euclidean graph property , have an @xmath0-complete satisfiability problem  @xcite . in  @xcite , schrder and pattinson show a way to prove @xmath1  upper bounds for modal logics defined by modal axioms of modal depth 1 . in  @xcite , ladner proved @xmath1-hardness for all logics for which reflexive and transitive graphs are admissible models . in  @xcite , hemaspaandra showed that all normal logics extending s4.3 have an @xmath0-complete satisfiability problem , and work on the _ guarded fragment _ has shown that some classes of modal logics can be seen as a decidable fragment of first - order logic  @xcite . while these results give hardness or upper bounds for classes of logics , they do not provide a full case distinction identifying _ all _ `` easy '' or `` hard '' cases in the considered class . we achieve such a result : for a large class of modal logics containing many important representatives , we identify _ all _ cases which have an @xmath0-complete satisfiability problem , and show that the satisfiability problem for _ all _ other non - trivial logics in that class is @xmath1-hard . hence these problems avoid the infinitely many complexity classes between @xmath0  and @xmath1 , many of which have natural complete problems arising from logical questions . to our knowledge , such a general result has not been achieved before .    to describe the considered class of modal logics , note that many relevant properties of modal models can be expressed by first - order formulas : a graph is transitive if its edge - relation @xmath7 satisfies the clause @xmath8 and symmetric if it satisfies @xmath9 . many other graph properties can be defined using similar formulas , where the presence of a certain pattern of edges in the graph forces the existence of another . analogously to propositional logic , we call conjunctions of such clauses _ universal horn formulas_. many relevant logics can be defined in this way : all examples form  @xcite fall into this category , as well as logics over euclidean graphs . we study the following problem : given a universal horn formula @xmath10 what is the complexity of the modal satisfiability problem over the class of graphs defined by @xmath11 ? the main results of this paper are the following : first , we identify all cases which give a satisfiability problem solvable in @xmath0  ( which then for every nontrivial logic is @xmath0-complete ) , and show that all other cases are @xmath1-hard . second , we prove a generalization of a `` tree - like model property , '' and use it to obtain @xmath1  upper bounds for a large class of logics . as a corollary , we prove that ladner s classic hardness result is `` optimal '' in the class of logics defined by universal horn formulas . a further corollary is that in the universal horn class , all logics whose satisfiability problem is not @xmath1-hard already have the `` polynomial - size model property , '' which is only one of several known ways to prove @xmath0  upper bounds for modal logics . various work was done on restricting the syntax of the modal formulas by restricting the propositional operators  @xcite , the nesting degree and number of variables  @xcite or considering modal formulas in horn form  @xcite . while these results are about restricting the _ syntax _ of the modal formulas , the current work studies different _ semantics _ of modal logics , where the semantics are specified by horn formulas . the organization of the paper is as follows : in section  [ sect : preliminaries ] , we introduce terminology and generalize classic complexity results . section  [ sect : modal models ] then establishes techniques to restrict the size of models for modal formulas , which are important tools for the @xmath0-membership later . section  [ sect : universal horn clauses ] contains the main results of the paper about universal horn formulas . after introducing them in section  [ sect : horn definitions ] and proving their relationship to homomorphisms in section  [ sect : horn homomorphism ] , we prove @xmath0-results for special cases of horn formulas in sections  [ section : varphi k to l section ] and  [ section : np results ] . using these results , section  [ sect : main dichotomy result ] then proves our main dichotomy result , which is corollary  [ corollary : horn cunjunction without algorithm ] . the remainder of the paper establishes @xmath1  upper bounds for many of the @xmath1-hard logics . an important tool for these proofs is introduced in section  [ sect : trees for horn ] , where we show a tree - like model property for all @xmath1-hard logics defined by universal horn formulas . section  [ sect : pspace for non - transitive ] contains our @xmath1-algorithm , which generalizes many previously known algorithms for modal logics . finally , section  [ sect : applications ] obtains a series of corollaries , proving the above - mentioned optimality result for ladner s hardness condition , and exhibiting a number of cases to which our @xmath1-algorithm can be applied . the paper closes with a summary and open questions in section  [ sect : conclusion ] . modal logic is an extension of propositional logic . a modal formula is a propositional formula using variables , the usual logical symbols @xmath12 and a unary operator @xmath13 . ( a dual operator @xmath14 is often considered as well , this can be regarded as abbreviation for @xmath15 . ) a model for a modal formula is a set of connected `` worlds '' with individual propositional assignments . to be precise , a _ frame _ is a directed graph @xmath16 where the vertices in @xmath17 are called `` worlds , '' and an edge @xmath18 is interpreted as @xmath19 is `` considered possible '' from @xmath20 . a _ model _ @xmath21 consists of a frame @xmath16 a set @xmath22 of propositional variables and a function @xmath23 assigning each variable @xmath24 a subset of @xmath25 the set of worlds in which @xmath26 is true . we say the model @xmath27 is _ based _ on the frame @xmath28 . if @xmath29 is a class of frames , then a model is an @xmath29-model if it is based on a frame in @xmath29 . with @xmath30 we denote the number of worlds in the model @xmath27 .    for a world @xmath31 we define when a formula @xmath32 is _ satisfied _ at @xmath33 in @xmath27 ( written @xmath34 . ) if @xmath32 is a variable @xmath35 then @xmath34 if and only if @xmath36 . as usual , @xmath37 if and only if @xmath38 and @xmath39 , and @xmath40 iff @xmath41 . for the modal operator , @xmath42 if and only if there is a world @xmath43 such that @xmath44 and @xmath45 . .common modal logics [ cols="<,^,<,<,<",options="header " , ]     the construction works as follows : with formula @xmath46 we give the start of the model and define the world @xmath33 in which @xmath4 is satisfied to have the level @xmath47 . formula @xmath48 requires each node which is reachable in at most @xmath49 steps from @xmath33 to have a well - defined level ( or none ) . formulas @xmath50 and @xmath51 require each level @xmath52 to be followed by level @xmath53 and in the case that the @xmath52th quantifier is @xmath54 formula @xmath51 requires the corresponding branching of the quantifier tree . formula @xmath55 then forces the truth values of the @xmath56 to be `` sent down '' the tree , as described earlier . formula @xmath57 finally requires that the propositional formula @xmath58 is true for all possible truth assignments to @xmath59 generated by the quantifier tree . ladner s construction for the @xmath1  upper bound for the logic @xmath60 also reveals the following . the main idea behind this corollary is that any model for some modal formula can be transformed into a strict tree by `` unrolling . '' a much more general version of this result will be proven later as theorem  [ theorem : tree - like models for horn logics ] . [ corollary : every k - satisfiable formula satisfiable in strict tree ] a modal formula is @xmath61-satisfiable if and only if it can be satisfied in a strict tree . corollary  [ corollary : every k - satisfiable formula satisfiable in strict tree ] shows that we only need to apply our formulas to trees  as long as our first order formula does not `` say anything '' about trees , the generated logic is the same as @xmath61 , although these logics do not necessarily have the same set of models .    [ corollary : formulas satisfiable in trees give pspace complete logics ] let @xmath62 be a first - order formula over the frame language such that @xmath62 is satisfied in every strict tree . then the satisfiability problem for @xmath63 is @xmath1-complete . this follows immediately from corollary  [ corollary : every k - satisfiable formula satisfiable in strict tree ] and theorem  [ theorem : ladner ] , since every modal formula is @xmath60-satisfiable if and only it is @xmath63-satisfiable .    for our complete classification in theorem  [ theorem : horn conjunction classification ] , we need a hardness result which is a slight variation of ladner s hardness result for all logics between @xmath60 and @xmath64 . however , the proof is merely a closer inspection of ladner s construction . in addition to the already mentioned graph properties , we define a generalization of transitivity . for a natural number @xmath65 we say that a graph @xmath66 is @xmath67-transitive , if every pair of vertices @xmath68 in @xmath66 such that there is a @xmath67-step path from @xmath20 to @xmath19 in @xmath66 is connected with an edge . it is easy to see that a graph is transitive if and only if it is @xmath69-transitive , and a transitive graph is also @xmath67-transitive for every @xmath70 . for a set @xmath71 we say that a graph is @xmath72-transitive if it is @xmath67-transitive for every @xmath73 .    [ theorem : ladner hardness cases for k - transitivity ] let @xmath11 be a first - order formula over the frame language such that one of the following cases applies :    * @xmath11 is satisfied in every strict tree , * @xmath11 is satisfied in every reflexive tree , * there is a set @xmath74 such that @xmath11 is satisfied in every @xmath72-transitive tree , * @xmath11 is satisfied in every symmetric tree , * @xmath11 is satisfied in every tree which is both reflexive and symmetric , * there is a set @xmath74 such that @xmath11 is satisfied in every tree which is both reflexive and @xmath72-transitive . then @xmath75 is @xmath76-hard . note that for the cases not including symmetry , the result `` almost '' follows directly from ladner s theorem  [ theorem : ladner ] . it does not follow directly , since we only require that our first - order formulas are satisfied in @xmath72-transitive _ trees _ , but nothing about arbitrary @xmath72-transitive graphs . nevertheless , the result for this case follows directly from ladner s proof . first consider the cases in which symmetry does not occur . now the result follows directly from ladner s proof : ladner proves @xmath1-hardness with a reduction from @xmath77 . from a quantified boolean formula @xmath78 he constructs a modal formula @xmath32 such that the following holds :    1 . if @xmath79 is true , then there is a modal model @xmath27 and a world @xmath80 such that @xmath27 is a strict tree , and @xmath34 . moreover , adding any number of reflexive or transitive edges in @xmath27 preserves the fact that @xmath34 . 2 .   if @xmath79 is false , then @xmath32 is not @xmath60-satisfiable . it is immediate that this reduction also proves the desired hardness result for @xmath81 first assume that @xmath79 is true . then , by the above , the model @xmath82 satisfies @xmath83 and is a tree . if we close this model under the reflexive and/or @xmath72-transitive closures , then by the above this still is a model for @xmath32 . since @xmath11 is satisfied in every reflexive and/or @xmath72-transitive tree , this is a @xmath84-model for @xmath83 and hence @xmath32 is @xmath84-satisfiable . on the other hand , if @xmath79 is false , then @xmath32 is not @xmath60-satisfiable , and therefore not @xmath84-satisfiable . now the cases involving symmetry follow from corollary  [ corollary : ufos satisfied in symmetric tree are pspace hard ] .    as this section indicated , trees are an important subclass of modal models . and in fact , a good intuition to read this paper is to always think of the graphs we deal with as `` near - trees , '' i.e. , trees with additional edges . @xmath0-results in this paper are shown with the explicit construction of small models for a given formula . we therefore introduce some notation on graphs . for a graph @xmath85 the set of vertices of @xmath66 is denoted with @xmath86 and @xmath87 is the set of its edges . as usual , a _ homomorphism _ from a graph @xmath88 to a graph @xmath89 is a function preserving the edge relation . a _ strict tree _ is a tree in the usual sense , i.e. , a directed , acyclic , connected graph which has a root @xmath33 from which all other vertices can be reached . we now define notation to describe paths in graphs . note that we often identify modal models and their frames , when the propositional assignments are clear from the context or not important for our arguments . let @xmath66 be a graph , @xmath90 vertices , and @xmath91 . we write @xmath92 if in @xmath85 there is a path of length @xmath52 from @xmath33 to @xmath19 . additionally , @xmath93 for all @xmath94 . we also say that @xmath33 is a @xmath52-step predecessor of @xmath95 and @xmath19 is a @xmath52-step successor of @xmath33 in @xmath85 if @xmath96 . the _ maximal depth _ of @xmath94 is defined as @xmath97 . similarly , the _ maximal height _ of @xmath94 is @xmath98 . note that the maximal depth and maximal height of nodes can be ( countably ) infinite , even in finite graphs . the next definition is a restriction on graphs which is very natural for modal logics : for deciding whether @xmath34 holds for some modal @xmath99 a world @xmath100 and a modal formula @xmath83 it is obvious that only the worlds which are reachable from @xmath33 are important . let @xmath66 be a graph , and let @xmath94 . the graph @xmath101 is obtained from @xmath66 by restricting @xmath66 to the worlds which can be reached from @xmath33 . proving the polynomial - size model property for some logic is usually done starting with an arbitrary model for a given modal formula and building a smaller model out of it , which still satisfies the modal formula . however , we also need to ensure that the new model still satisfies the conditions of the logic under consideration . therefore , we need results that allow us to perform modifications on our models and leave the modal and the first - order properties invariant . the first result in this way concerns the first - order aspect of the frames for universal formulas :    [ theorem : ufo invariants ] let @xmath66 and @xmath102 be graphs , and let @xmath103 be a natural number . the following conditions are equivalent :    1 .   every universal first - order formula ( with at most @xmath103 variables ) satisfied by @xmath102 is also satisfied by @xmath85 2 .   every existential first - order formula ( with at most @xmath103 variables ) satisfied by @xmath66 is also satisfied by @xmath104 3 .   for each finite @xmath105 ( such that @xmath106 ) , there exists a functions @xmath107 such that for @xmath108 it holds that @xmath109 iff @xmath110 . @xmath111 : :    let    @xmath112    be an existential first - order formula over the frame language which    holds in @xmath85 and assume that it does not hold in    @xmath102 . in this case , the negation of the formula holds in    @xmath104 i.e. ,    @xmath113 . this is equivalent to    @xmath114    which is a universal first - order formula over the frame language . hence by the prerequisites , we know that    @xmath115    which is a contradiction . @xmath116 : :    analogously to the above . @xmath117 : :    we construct a function @xmath107 with the    desired properties . let @xmath118 and let    @xmath119 . we    construct an existential first - order formula    +    @xmath120    +    obviously , @xmath11 has @xmath103 variables , and    @xmath66 obviously is a model for @xmath10 it    follows that @xmath121 . therefore , there are    @xmath122 such that @xmath123    if and only if @xmath124 . define    @xmath125 . this function obviously meets the    criteria : let @xmath123 . then    @xmath126 is a clause in @xmath11 . therefore for the values @xmath127 and @xmath128    chosen by the existential quantifiers , @xmath129    must hold . since @xmath130 and    @xmath131 the claim follows . for the condition    @xmath132 the proof is the same . @xmath133 : :    let such a function @xmath134 exist for every    @xmath105 with    @xmath106 . let    @xmath135    be a first - order existential formula , let @xmath103 be the    number of variables in @xmath11 , and let    @xmath136 . we show that    @xmath121 . since    @xmath137 there are    @xmath138 such that    @xmath139 holds in @xmath66 . this implies that @xmath140    holds in @xmath102 . therefore ,    @xmath121 . note that while the function @xmath134 required to exist in the conditions of the above theorem shares some properties with an isomorphism , it is not required to be injective . the following is an important special case , which immediately follows from this observation and theorem  [ theorem : ufo invariants ] :    [ prop : trivial subgraph property ] let @xmath66 be a graph , @xmath62 a universal first - order formula over the frame language such that @xmath141 . then for every subgraph @xmath102 of @xmath85 it holds that @xmath142 .    for a modal model , a restriction of the model is a restriction of the graph , where the propositional assignment for the remaining worlds is unchanged . we now consider restrictions which are `` compatible '' with the modal properties of the formulas in question . the following lemma describes a standard way to reduce the number `` relevant '' of successors to worlds in models . this is an application of the more general idea of bounded morphisms , which we will encounter in section  [ sect : trees for horn ] . for a modal formula @xmath83 @xmath143 denotes the set of its subformulas . with @xmath144 we denote the modal depth of a formula @xmath83 i.e. , the maximal nesting degree of the modal operator @xmath13 in @xmath32 . [ lemma : modal restriction invariance ] let @xmath32 be a modal formula , and let @xmath34 . let @xmath145 be a restriction of @xmath27 such that the following holds :    1 . @xmath146 2 .   for all @xmath147 and all @xmath148 such that @xmath149 there is some @xmath150 such that @xmath68 is an edge in @xmath99 and @xmath151 .    then @xmath152 . lemma  [ lemma : modal restriction invariance ] immediately follows from the following lemma . the version stated in lemma  [ lemma : modal restriction invariance ] is the one we almost exclusively use , hence we stated this simpler version explicitly . we now prove a slightly more general result , which also takes into account that for a modal formula , worlds which are not reachable on a path with at most the length of the modal depth of the formula , are irrelevant . [ lemma : modal restriction invariance with levels ] let @xmath32 be a modal formula , and let @xmath34 . let @xmath145 be a restriction of @xmath27 such that the following holds :    1 . @xmath146 2 .   for all @xmath147 and all @xmath153 such that @xmath154 and there exists an @xmath91 such that @xmath155 and @xmath156 there is some @xmath150 such that @xmath68 is an edge in @xmath99 and @xmath151 . then @xmath152 . we show the following claim : let @xmath157 and @xmath158 such that @xmath159 and @xmath160 then @xmath161 if and only if @xmath162 . for @xmath163 @xmath164 and @xmath165 this implies the lemma , since @xmath33 is an element of @xmath145 by definition . we show the claim by induction on @xmath79 . if @xmath79 is a variable , then this holds trivially , since @xmath145 is a restriction of @xmath27 and therefore , propositional assignments are not changed . the induction step for propositional operators is trivial . therefore , assume that @xmath166 for some @xmath153 such that the claim holds for @xmath167 . now let @xmath168 meet the prerequisites of the claim , i.e. , let @xmath160 and let @xmath155 . first assume that @xmath161 . since @xmath169 it follows that @xmath170 and hence @xmath171 . since @xmath149 the prerequisites of the lemma therefore imply that there is a world @xmath150 such that @xmath68 is an edge in @xmath99 and @xmath151 . since @xmath159 it follows that @xmath172 . by the induction hypothesis , we know that @xmath173 . since @xmath145 is a restriction of @xmath99 @xmath68 is an edge in @xmath145 as well , and therefore we conclude that @xmath174 i.e. , @xmath162 . for the other direction , assume that @xmath162 . therefore , there is a node @xmath150 such that @xmath175 and @xmath68 is an edge in @xmath145 . since @xmath159 we know that @xmath172 holds as well , and since @xmath176 from the induction hypothesis we conclude that @xmath151 . since @xmath68 is an edge in @xmath27 as well , it therefore follows that @xmath149 i.e. , @xmath177 concluding the proof .    the following easy proposition shows how lemma  [ lemma : modal restriction invariance with levels ] can be applied :    [ prop : rooted models exist ] let @xmath178 be a universal elementary logic , let @xmath32 be a modal formula , and let @xmath179 where @xmath27 is a @xmath180-model . then there is a @xmath180-model @xmath145 which is a restriction of @xmath99 which is rooted at @xmath181 and where every world can be reached from @xmath33 in at most @xmath182 steps , and @xmath152 .    the model @xmath145 is obtained by simply removing all worlds from @xmath27 which can not be reached from @xmath33 in at most @xmath182 steps . due to proposition  [ prop : trivial subgraph property ] , @xmath145 is still a @xmath180-model . we now show that @xmath152 holds , by proving that @xmath145 satisfies the conditions of lemma  [ lemma : modal restriction invariance with levels ] .    by definition , since @xmath33 can be reached from @xmath33 in @xmath47 steps , we know that @xmath183 . hence let @xmath147 and let @xmath153 and let @xmath149 such that @xmath184 for some @xmath52 such that @xmath185 . since @xmath149 we know that there is a world @xmath186 such that @xmath187 and @xmath68 is an edge in @xmath27 . it follows that @xmath188 . since @xmath156 and @xmath189 we know that @xmath190 and hence we know that @xmath19 is an element of @xmath145 . therefore , @xmath145 satisfies the conditions of lemma  [ lemma : modal restriction invariance with levels ] , and therefore the lemma implies that @xmath191 as claimed . as mentioned , our @xmath0-containment results are obtained by proving the polysize model property and applying proposition  [ proposition : elementary plus polysize model property is in np ] . the polynomial models are obtained by restricting arbitrary models to polynomial size . we will now show some restrictions which we can make in any model , showing that we can assume certain parts of the model to be only polynomial in size . [ lemma : few nodes with few predecessors ] let @xmath192 . then for any modal formula @xmath32 and any @xmath179 there is a submodel @xmath145 of @xmath27 such that @xmath152 and the following holds : @xmath193    for each world @xmath20 in @xmath99 let @xmath194 . for each @xmath195 let @xmath196 be a subset of the @xmath197-step successors of @xmath20 in @xmath27 such that for every @xmath198 there is a world @xmath199 such that @xmath68 is an edge in @xmath99 and @xmath187 and @xmath200 . now define @xmath201 and for each @xmath202 let @xmath203 . finally , define @xmath145 to be the restriction of @xmath27 to @xmath204 .    to show that @xmath191 we prove that @xmath145 satisfies the conditions of lemma  [ lemma : modal restriction invariance ] . obviously , @xmath145 is a restriction of @xmath27 and @xmath205 . therefore , let @xmath20 be a world from @xmath206 and let @xmath167 be a subformula of @xmath32 such that @xmath154 . since @xmath147 there is some @xmath52 such that @xmath207 . since @xmath149 we know that @xmath198 and hence there is a world @xmath199 such that @xmath187 and @xmath68 is an edge in @xmath27 . it follows that @xmath208 and hence @xmath145 satisfies the conditions of lemma  [ lemma : modal restriction invariance ] as claimed . now let @xmath209    it remains to show the cardinality bound for @xmath210 . it is obvious that @xmath211 since for every @xmath212 every vertex in @xmath213 has a predecessor in @xmath214 and hence inductively , every vertex in @xmath215 has an @xmath52-step predecessor in @xmath145 . obviously , @xmath216 and @xmath217 . therefore , @xmath218 for all @xmath91 . now , due to the above , @xmath219 . since @xmath220 the claim follows .    by construction , the model @xmath145 given in the proof of the above lemma is countable . hence we obtain the following corollary :    [ corrollary : universal elementary logics have countable model property ] let @xmath178 be a universal elementary logic . then every @xmath180-satisfiable formula @xmath32 is satisfiable in a countable @xmath180-model . moreover , every @xmath180-model satisfying @xmath32 at a node @xmath33 contains a countable @xmath180-submodel satisfying @xmath32 at the node @xmath33 . the following lemma shows that it is sufficient to restrict the number of those vertices in the model which have a minimal height in the graph . in combination with lemma  [ lemma : few nodes with few predecessors ] , this shows that we only need to be concerned about vertices which have both a certain number of predecessors , and a certain number of successors . we already saw in proposition  [ prop : rooted models exist ] that we are only interested in rooted graphs . in such graphs , lemmas  [ lemma : few nodes with few predecessors ] and  [ lemma : few nodes with few successors ] can be seen as limiting the number of vertices near the `` top '' or the `` bottom '' of the model . this is useful , because in graphs satisfying some universal formula , often special cases can occur in these regions of the graph . these lemmas show that we do not need to look too closely at these exceptions . [ lemma : few nodes with few successors ] let @xmath192 be a constant . then for any modal formula @xmath32 and any @xmath179 there is a submodel @xmath145 of @xmath27 such that @xmath191 and for which the following holds :    @xmath221    where @xmath222 . let @xmath223 i.e. , the set of nodes in @xmath27 which have a @xmath224-step successor . we now define a sequence of submodels of @xmath225 let @xmath226 and for @xmath227 let @xmath213 be defined as follows :    * @xmath228 * for every @xmath229 and each @xmath148 such that @xmath149 add one world @xmath19 from @xmath27 to @xmath213 such that @xmath68 is an edge in @xmath27 and @xmath151 . now let @xmath145 be the restriction of @xmath27 to the worlds in @xmath230 . we show that @xmath191 by showing that it satisfies the conditions of lemma  [ lemma : modal restriction invariance ] . by definition , hence let @xmath147 @xmath153 and let @xmath154 . since @xmath147 there exists a minimal @xmath52 such that @xmath207 . first assume that @xmath232 . by construction , for every relevant @xmath233 every node in @xmath234 has a @xmath197-step predecessor in @xmath235 and hence , inductively , the node @xmath236 is a @xmath237-step successor of a node @xmath26 in @xmath238 . since @xmath149 we know that @xmath20 has a successor in @xmath27 . this implies that @xmath26 has a @xmath224-step successor in @xmath99 and hence @xmath239 which is a contradiction , since @xmath240 and @xmath241 . therefore , we know that @xmath242 . by construction , there is a world @xmath19 in @xmath243 such that @xmath68 is an edge in @xmath99 and @xmath244 . therefore , the model @xmath145 satisfies the conditions of lemma  [ lemma : modal restriction invariance ] , and therefore we conclude that @xmath152 .    by definition , it holds that @xmath245 and for @xmath227 @xmath246 . since @xmath247 this implies that @xmath248 as claimed . the main purpose of lemmas  [ lemma : few nodes with few predecessors ] and  [ lemma : few nodes with few successors ] is the following : if for a modal logic @xmath249 there is a constant @xmath250 such that every @xmath180-satisfiable formula has a model in which we can restrict the number of nodes which have both a @xmath224-step predecessor and a @xmath224-step successor , then lemmas  [ lemma : few nodes with few predecessors ] and  [ lemma : few nodes with few successors ] can be used to show the polynomial model property for @xmath180 . this idea plays a crucial role in the proof of our main @xmath0-containment result , theorem  [ theorem : above k to k+1 leads to np ] , and is formalized in the following corollary :    [ corollary : suffices to restrict middle vertices for np ] let @xmath178 be a universal elementary modal logic such that there exists a constant @xmath192 such that there is a polynomial @xmath251 such that for all @xmath180-satisfiable formulas @xmath83 there is a @xmath180-model @xmath27 and a world @xmath80 such that @xmath179 and    @xmath252    then @xmath178 has the polynomial - size model property , and @xmath253 .    note that the function @xmath251 is only required to be polynomial in its argument @xmath254 and not in the value @xmath250 which is a constant depending only on the logic , and not on the formula . let @xmath32 be a @xmath180-satisfiable formula , and let @xmath27 be a @xmath180-model and @xmath80 meeting the prerequisites of the corollary . by lemma  [ lemma : few nodes with few predecessors ] , there is a submodel @xmath145 of @xmath27 such that @xmath191 and    @xmath255    therefore , since the conditions required in the prerequisites of the corollary are invariant under further restrictions of the model , assume without loss of generality that @xmath27 already satisfies this condition . now let @xmath256 where    @xmath257    note that @xmath258 and @xmath259 are not necessarily disjoint ( @xmath258 contains the nodes with only small depth at the `` * * t**op '' of the model , @xmath260 represents the `` * * c**enter '' of the model , and @xmath259 is the `` * * b**ottom . '' ) . by the prerequisites of the corollary , we can assume that @xmath261 and by the above we know that @xmath262 . now let @xmath263 . it follows that @xmath264 and hence @xmath265    by lemma  [ lemma : few nodes with few successors ] , there is a submodel @xmath145 of @xmath27 such that @xmath152 and @xmath266 and hence by the above we have that @xmath267 ( note that the cardinality of the size @xmath210 defined with respect to the submodel @xmath145 is bounded by the cardinality of the original set @xmath210 ) . since @xmath251 is a polynomial and @xmath224 is a constant only depending on the logic @xmath180 , this is a polynomial size bound in @xmath254 and therefore we have proven the polynomial - size model property . by proposition  [ prop : trivial subgraph property ] , @xmath145 is a @xmath180-model . the complexity result now follows from proposition  [ proposition : elementary plus polysize model property is in np ] . we now consider a syntactically restricted case of universal first order formulas , namely horn formulas . many well - known logics can be expressed in this way . usually , a horn clause is defined as a disjunction of literals of which at most one is positive . if a positive literal occurs , then the clause can be written as an implication , since @xmath268 is equivalent to @xmath269 . if no positive literal occurs , then the clause @xmath270 can be written as @xmath271 . since in the context of the frame language , an atomic proposition is of the form @xmath272 the following is the natural version of horn clauses for our purposes :    a _ universal horn clause _ is a formula of the form @xmath273 or of the form @xmath274 where all ( not necessarily distinct ) variables are implicitly universally quantified . a _ universal horn formula _ is a conjunction of universal horn clauses . with universal horn formulas , many of the usually considered graph properties can be expressed , like transitivity , symmetry , euclidicity , etc . in the following definition , we show how universal horn clauses can be represented as graphs . let @xmath62 be a universal horn clause . * the _ prerequisite graph of @xmath62 _ , denoted with @xmath275 , consists of the variables appearing on the left - hand side of the implication @xmath276 where @xmath277 is an edge if the clause @xmath278 appears . * if @xmath62 is a universal horn clause where the right - hand side of the implication in @xmath62 is @xmath279 then the _ conclusion edge of @xmath62 _ , denoted with @xmath280 , is the edge @xmath281 . if the right - hand side of the implication is @xmath282 then @xmath283 is the empty set . the definition of the prerequisite graph and the conclusion edge of a universal horn formula establishes a one - to - one correspondence between universal horn clauses and their representation as graphs . these definitions allow us to relate truth of a horn clause to homomorphic images of the involved graphs :    [ prop : homomorphism and horn clauses ]    1 . let @xmath62 be a universal horn clause with @xmath284 . a graph @xmath66 satisfies @xmath62 if and only the following holds : for every homomorphism @xmath285 , @xmath286 is an edge in @xmath287 2 . let @xmath62 be a universal horn clause such that @xmath288 . then a graph @xmath66 satisfies @xmath62 is and only if there is no homomorphism @xmath289    1 . let @xmath290 where all variables are implicitly universally quantified . first assume that @xmath291 and let @xmath285 be a homomorphism . due to the definition of @xmath292 there are edges @xmath293 in @xmath294 . since @xmath295 is a homomorphism , this implies that @xmath296 are edges in @xmath66 . hence the nodes @xmath297 satisfy the formula @xmath298 . therefore , the nodes @xmath299 satisfy the prerequisites of the clause @xmath62 . since @xmath291 this implies that @xmath286 is an edge in @xmath287 + now for the other direction , assume that @xmath66 fulfills the homomorphism property , and let @xmath300 . let @xmath301 be nodes in @xmath66 satisfying the prerequisite clause of @xmath302 i.e. , if @xmath303 is a clause in @xmath292 then @xmath304 is an edge in @xmath66 . then obviously the function @xmath295 mapping the variable @xmath305 to the node @xmath306 is a homomorphism from @xmath294 to @xmath66 . by the prerequisites , we know that @xmath286 is an edge in @xmath66 . hence , @xmath66 satisfies the formula @xmath62 . 2 .   analogous . there is a natural correspondence between implications of these formulas and graph homomorphisms . [ prop : homomorphism and horn clause implication ]    1 . let @xmath307 and @xmath308 be universal horn clauses such that there exists a homomorphism @xmath309 which maps the conclusion edge of @xmath307 to the conclusion edge of @xmath308 . then @xmath307 implies @xmath310 2 . let @xmath307 and @xmath308 be universal horn clauses such that @xmath311 and let @xmath312 be a homomorphism . then @xmath307 implies @xmath310    1 . let @xmath313 then by the prerequisites it follows that @xmath314 . now let @xmath66 be a graph such that @xmath315 and let @xmath316 be a homomorphism . by proposition  [ prop : homomorphism and horn clauses ] , it suffices to show that @xmath317 is an edge in @xmath66 . since @xmath295 and @xmath318 are homomorphisms , @xmath319 is a homomorphism as well . since @xmath315 proposition  [ prop : homomorphism and horn clauses ] implies that @xmath317 is an edge in @xmath85 as claimed . 2 .   let @xmath66 be a graph such that @xmath320 . due to proposition  [ prop : homomorphism and horn clauses ] , to show that @xmath321 it suffices that there is no homomorphism @xmath322 . hence assume that such a homomorphism exists . then @xmath323 is a homomorphism from @xmath324 into @xmath85 which is a contradiction to proposition  [ prop : homomorphism and horn clauses ] , since @xmath325      we now consider special cases of horn clauses , which will be central for the logics having satisfiability problems in @xmath0 . the following definition captures the case where the variables in the conclusion edge have a common predecessor in the prerequisite graph , but there is not necessarily a direct path between them . using results about graphs satisfying generalizations of formulas of this type , we will be able to show all of the @xmath0-containment results that the proof of the later classification theorem , theorem  [ theorem : horn conjunction classification ] , depends on . let @xmath326 be the formula @xmath327 where all variables are universally quantified ( and in the case that @xmath328 or @xmath329 appear in the formula , we replace them with @xmath33 ) . l3.3 cm     in figure  [ fig : varphi 2 to 4 example ] , we present the graph representation of the formula @xmath330 . the graph property described by these formulas is easy to see :    [ prop : varphi k to l property ] let @xmath66 be a graph , and let @xmath331 . then @xmath332 if and only if for any nodes @xmath333 if @xmath334 and @xmath335 then @xmath336 is an edge in @xmath287    this definition generalizes several well - known examples  in particular , a graph is reflexive if and only if it satisfies @xmath337 symmetry is expressed with @xmath338 and transitivity with @xmath339 . finally , a graph is euclidean iff it satisfies @xmath340 . therefore , this notation allows us to capture many interesting graph properties , and it is not surprising that generalizations of this idea are the main ingredients for our polynomial size model proofs . we start with looking at some properties and implications of formulas of the form @xmath341    [ lemma : varphi k to l implications ] let @xmath342 and let @xmath66 be a graph such that @xmath343    1 . @xmath344 2 . if @xmath345 then for any @xmath346 , @xmath347 3 . there is some @xmath348 such that @xmath349 for all @xmath350    _ proof _    1 . let @xmath33 be some node in @xmath85 such that @xmath351 and @xmath352 and let the ( not necessarily distinct ) intermediate vertices be denoted with @xmath353 . since @xmath326 holds in @xmath66 , this implies that there is an edge @xmath354 . by choice of nodes , @xmath355 . combining these , we obtain a path of length @xmath67 from @xmath356 to @xmath357 . on the other hand , @xmath358 . since @xmath326 holds in @xmath66 , it follows that there is an edge from @xmath357 to @xmath359 proving that @xmath360 holds in @xmath66 . clearly it suffices to show @xmath361 the claim for arbitrary @xmath52 follows inductively . let @xmath362 be chosen such that @xmath363 and there are edges @xmath364 and @xmath365 . we need to show that there is an edge @xmath366 + since @xmath367 it follows that @xmath368 is an edge in @xmath66 . since there obviously is a path of length @xmath369 from @xmath370 to @xmath356 , it follows that there is a path of length @xmath67 from @xmath370 to @xmath371 . since there also is a path of length @xmath372 from @xmath370 to @xmath373 it follows that there is an edge @xmath374 in @xmath66 , which concludes the proof . 3 .   this follows immediately from the above : from points @xmath197 and @xmath375 it follows that the claim holds for @xmath376    @xmath14    l4.5 cm     the formula @xmath326 is supposed to capture the case where the variables in the conclusion edge of a universal horn clause have a common predecessor . but not all of these cases are covered with this formula . the above figure  [ fig : varphi 2 to 4 example ] is a graphical representation of what the implication @xmath330 does . but what if this is only a subgraph of the prerequisite graph ? in a more general case , the node @xmath33 and the nodes @xmath377 will have more predecessors and successors . figure  [ fig : transformation original formula ] gives an example of a more general formula . we will now see that this formula can be `` simplified . '' this simplification is not an equivalent transformation of the formula , but we construct a new formula which is implied by the original one . the one - sided implication suffices to show many of the results we need . the simpler formula is presented in figure  [ fig : transformation resulting formula ] . it is easy to see that every graph which satisfies the formula displayed in figure  [ fig : transformation original formula ] also satisfies the formula from figure  [ fig : transformation resulting formula ] . this follows directly from proposition  [ prop : homomorphism and horn clause implication ] , since the prerequisite graph from figure  [ fig : transformation original formula ] can obviously be mapped homomorphically to the prerequisite graph from figure  [ fig : transformation resulting formula ] ( the homomorphism @xmath295 is defined as @xmath378 and maps the other nodes to the ones with the same labels ) . hence , if we can show @xmath0-containment for all universal elementary modal logics extending the one defined by the later formula , this puts the logic defined by the original formula into @xmath0  as well . l2.4 cm     any universal horn clause which can be mapped onto a tree can be embedded in a graph with certain properties , namely the properties of the formula we now define . due to corollary  [ corollary : formulas satisfiable in trees give pspace complete logics ] , it is natural that tree - like homomorphic images of our universal horn formulas are of interest to us . these formulas capture the generalizations of @xmath326 mentioned above , where we demand that the nodes @xmath379 have a sufficient number of predecessors or successors . we again use the representation of horn clauses as graphs . l3.3 cm     for @xmath380 the formula @xmath381 is defined as the universal horn clause displayed in figure  [ fig : general xyz stu formula ] . it should be noted that the notation @xmath381 suggests that @xmath382 can be compared to natural numbers , but what is meant in that notation is simply that the number of predecessors ( successors , resp . ) of @xmath379 can be compared to @xmath383 and @xmath384 respectively . hence , if we use `` natural names '' for the vertices , i.e. we have vertices @xmath385 and @xmath386 then this ensures that the vertices up to @xmath387 @xmath388 and @xmath389 exist . when proving that this formula holds in a graph , we will usually rely on the notation provided in figure  [ fig : general xyz stu formula ] , and assume that there are nodes @xmath390 with edges as seen in figure  [ fig : general xyz stu formula ] , i.e. , most of the time we do not mention the homomorphism explicitly . the formula @xmath381 can be seen to be only a slight generalization of the formulas @xmath326 we already considered , as exhibited by the following proposition :    [ prop : genvarphi property ] let @xmath66 be a graph , and let @xmath391 . then @xmath392 if and only if the following condition holds : for any nodes @xmath333 such that @xmath33 has a @xmath251-step predecessor , @xmath26 has a @xmath393-step successor and @xmath394 has an @xmath395-step successor , @xmath334 and @xmath335 it follows that @xmath336 is an edge in @xmath287    the above proposition immediately implies the following :    [ prop : cut to many pred many suc part gives non - gen varphi ] let @xmath396 and let @xmath102 be the restriction of @xmath66 to the set @xmath397 then @xmath398 this proposition is one of the reasons why corollary  [ corollary : suffices to restrict middle vertices for np ] is important : we can use it together with proposition  [ prop : cut to many pred many suc part gives non - gen varphi ] to restrict our attention to the vertices in the `` middle '' of the graph , and then talk about the formula @xmath326 instead of @xmath381 . this is the general approach for our @xmath0-containment proofs , although some technical difficulties remain , as we will see in the proof of theorem  [ theorem : above k to k+1 leads to np ] . there obviously is a close relationship between formulas of the form @xmath326 and formulas of the form @xmath381 . in particular , this relationship allows the `` lifting '' of implications , as is shown in the following easy lemma . [ lemma : varphi k to l implication gives genvarphi implications ] let @xmath399 and let @xmath326 imply @xmath400 . then @xmath381 implies @xmath401 where @xmath402    let @xmath66 be a graph satisfying @xmath381 . let @xmath403 be the nodes in the graph connected as the nodes in the prerequisite graph of @xmath404 . let @xmath102 be the graph @xmath66 restricted to the set of vertices which have a @xmath251-step predecessor , and @xmath405-step successor in @xmath66 . then , by choice of nodes , and propositions  [ prop : genvarphi property ] and  [ prop : varphi k to l property ] , it follows that @xmath406 . hence , due to the prerequisites , we know that @xmath407 . in particular , since the nodes @xmath403 satisfy the prerequisite graph of @xmath401 we know that @xmath408 . hence , it follows that @xmath336 is an edge in @xmath102 , and therefore it is an edge in @xmath85 as claimed . we need three more implications between formulas of this kind for our later @xmath0-results :    [ lemma : genvarphi k to 0 implications][lemma:(prop):varphi 0 to k gives varphi 0 to k^2 ] let @xmath409 and let @xmath66 be a graph .    1 .   if @xmath410 then @xmath411 2 .   if @xmath412 then @xmath413 where @xmath414 3 . let @xmath70 . then @xmath415 implies @xmath416    let @xmath417 be nodes in the graph fulfilling the prerequisite graph of the respective formulas .    1 .   by the @xmath418-property , it is clear that @xmath419 are edges in @xmath66 . hence , @xmath420 . again due to the property , it follows that @xmath421 is an edge in @xmath85 as required . 2 .   consider the subgraph @xmath422 . by choice of @xmath423 every node in @xmath102 has a @xmath251-step predecessor , a @xmath393-step successor , and an @xmath424-step successor in @xmath66 . hence , @xmath425 . due to part @xmath426 this implies that @xmath427 . hence , in @xmath102 there are edges @xmath428 . therefore , due to the @xmath418-property , it follows that @xmath429 is an edge in @xmath102 . hence , it follows that @xmath430 . the @xmath418-property implies that @xmath431 is an edge , as required . 3 .   this follows from lemma  [ lemma : test case 1 ] , since @xmath67-transitivity implies @xmath432-transitivity .      in this section , we prove @xmath0-containment results for logics defined by universal horn clauses . we show that `` most '' of the logics of the form @xmath433 give rise to a satisfiability problem in @xmath0 . it is comparably easy to show that a logic of the form @xmath434 leads to a satisfiability problem in @xmath0 , by carefully `` copying '' vertices and adding the correct neighbors . however , while this process leads to a model which still satisfies @xmath435 it does not give the desired result that the problem can be solved in @xmath436 for all universal horn logics which are extensions of @xmath434 . in order to prove this , our model - manipulations must be consistent with the conditions of theorem  [ theorem : ufo invariants ] . in the proof of the following theorem , we construct a small model using only restriction . note that the proof for this theorem is the only occasion where we actually prove the polynomial - size model property by explicitly constructing the model . all further @xmath0-results make use of theorem  [ theorem : above k to k+1 leads to np ] , by showing that the logic in question is an extension of one of the logics that this theorem deals with . for example , the logic @xmath437 satisfies the conditions of this theorem . it is therefore a central theorem for our complexity classification . the proof relies on one later result , namely the second case of theorem  [ theorem : tree - like models for horn logics ] . however , the proof for this case of theorem  [ theorem : tree - like models for horn logics ] does not rely on any facts about the classification algorithm studied later . in the following , a graph @xmath66 with root @xmath33 is @xmath33-canonical if for every node @xmath438 if @xmath439 and @xmath440 then @xmath441 . note that this does not mean that every node @xmath26 is reachable on only one path from the root , but that all paths from the root @xmath33 to @xmath26 have the same length . we say that a graph @xmath66 is _ canonical _ if it is @xmath33-canonical for a root @xmath33 of @xmath66 . it is easy to see that a graph is canonical if and only if it can be homomorphically mapped onto a strict line . [ theorem : above k to k+1 leads to np ] let @xmath62 be a universal horn formula implying @xmath442 for some @xmath443 . then @xmath63 has the polynomial - size model property , and @xmath444    due to proposition  [ proposition : elementary plus polysize model property is in np ] , it suffices to prove the polynomial - size model property for @xmath445 hence , let @xmath32 be a @xmath63-satisfiable modal formula , and , following proposition  [ prop : rooted models exist ] , let @xmath27 be a @xmath63-model with root @xmath33 such that @xmath34 . define @xmath446 to be the maximal length of a strict line on which @xmath62 is satisfied , and @xmath446 to be zero in the case that @xmath62 is satisfied on every strict line ( note that due to proposition  [ prop : trivial subgraph property ] , if @xmath62 is satisfied on the strict line of length @xmath212 then it is also satisfied on the strict line of length @xmath447 ) . this number is obviously a constant depending only on @xmath62 . if @xmath62 is satisfied on every strict line , we can , due to theorem  [ theorem : tree - like models for horn logics ] , assume that @xmath27 is @xmath33-canonical . note that we will work with restrictions of the model during the course of the proof  since any restriction of a canonical graph having the same root is still canonical , the submodels we consider later are canonical as well . now , define    @xmath448    the set @xmath260 contains all the nodes in @xmath27 which have `` enough '' predecessors and successors to ensure that the formula @xmath442 gives us all the necessary edges that we are interested in . to be more precise , we show the following fact :    [ prooffact : c models varphi i to i+1 ] for all @xmath449 it holds that @xmath450    it suffices to show the claim for @xmath451 . the result for arbitrary @xmath52 then follows from lemma  [ lemma : varphi k to l implications ] , and the observation that @xmath452 is true in any graph . hence , we show @xmath453 let @xmath454 be vertices from @xmath455 such that they satisfy the prerequisites of @xmath456 i.e. , let @xmath457 @xmath458 and @xmath459 be edges in @xmath27 . since @xmath460 we know that @xmath461 has a @xmath369-step predecessor @xmath462 which in turn has a @xmath251-step predecessor . due to the edges mentioned above , it obviously holds that @xmath463 and @xmath464 . since both @xmath465 and @xmath466 are elements of @xmath455 they have the required number of successors , and therefore , since @xmath467 proposition  [ prop : genvarphi property ] implies that @xmath468 is an edge in @xmath99 as claimed . due to lemma  [ lemma : few nodes with few predecessors ] , we can assume , without loss of generality , that @xmath469 is polynomially bounded ( in the length of @xmath32 ) . we can additionally assume , again due to lemma  [ lemma : few nodes with few predecessors ] , that the number of nodes @xmath19 with @xmath470 is also restricted by a polynomial . due to proposition  [ prop : rooted models exist ] , we can also assume that every world in @xmath27 can be reached from @xmath33 in @xmath182 steps . therefore , we can choose a set @xmath471 with the following properties :    * @xmath66 is polynomially bounded , * @xmath472 * for every node @xmath473 and every @xmath474 such that @xmath68 is an edge in @xmath99 and every subformula @xmath167 of @xmath32 such that @xmath187 there is a node @xmath475 such that @xmath476 is an edge in @xmath99 and @xmath477 * every node in @xmath260 can be reached on a path from some node in @xmath66 . additionally , if @xmath4 is satisfied on every strict line , every node in @xmath260 can be reached from some node in @xmath66 on a path of length at most @xmath478    such a set can be chosen with an application of the technique used to prove lemma  [ lemma : few nodes with few predecessors ] :    a set @xmath66 can be chosen with the properties above . first consider the case that @xmath62 is satisfied on every strict line . in this case , since @xmath27 is @xmath33-canonical , we know that @xmath210 is exactly the set of vertices on the first @xmath479 levels of @xmath27 ( the @xmath52-th level is the set of vertices @xmath19 in @xmath27 such that @xmath480 . note that a canonical graph can only have one root ) . since @xmath27 is @xmath33-canonical , we can simply choose @xmath66 to be the set of those nodes at level @xmath481 in the model @xmath27 which are also elements of @xmath260 . since in a canonical model @xmath99 for each node @xmath19 @xmath482 is exactly the level of @xmath19 in @xmath99 this is a set of polynomial size , and every path from @xmath33 to a node in @xmath260 passes through @xmath66 . further , every successor @xmath474 of a node @xmath473 is trivially a member of @xmath66 . since every node in @xmath27 can be reached from the root @xmath33 in at most @xmath182 steps , the claim follows . now consider the case where @xmath62 is not satisfied on every strict line . for each world @xmath483 let @xmath484 and let @xmath196 be a subset of successors of @xmath20 in @xmath27 such that for every @xmath198 there is a world @xmath199 such that @xmath68 is an edge in @xmath99 @xmath187 and @xmath485 . if it is possible to choose @xmath486 then do so . define @xmath201 and for each @xmath487 let @xmath488 now define @xmath145 to be the restriction of @xmath27 to the worlds in @xmath489 . we show that @xmath152 by proving that @xmath145 satisfies the conditions of lemma  [ lemma : modal restriction invariance ] . by construction , we know that @xmath183 . now let @xmath147 and let @xmath167 be a subformula of @xmath32 with @xmath490 . then @xmath491 and therefore there is a world @xmath199 with @xmath492 . since @xmath147 there is some @xmath52 with @xmath207 . it follows that @xmath493 and hence @xmath150 as claimed . since @xmath145 is a restriction of @xmath99 we know that @xmath145 also is a @xmath63-model , and inherits all size restrictions on submodels that we have already established . therefore , we can , without loss of generality , assume that @xmath494    now define @xmath495 . by the proof of lemma  [ lemma : few nodes with few predecessors ] , since @xmath481 is a constant , we conclude that @xmath66 is polynomial in @xmath496 . by construction , @xmath497 . we prove that every node @xmath498 can be reached on a path from a node in @xmath260 . for every @xmath483 there exists a sequence of nodes @xmath499 such that for all relevant @xmath212 @xmath500 @xmath501 is an edge in @xmath99 and @xmath502 . let @xmath503 be minimal such that @xmath504 . since @xmath505 it follows that @xmath506 and we know that such a @xmath503 exists , since @xmath507 . it suffices to prove that @xmath508 . since @xmath509 it remains to prove that @xmath510 . assume that this is not the case , from the above it then follows that @xmath511 . by choice of nodes , we know that @xmath512 has a @xmath481-step predecessor , and since @xmath512 is a predecessor of @xmath195 @xmath512 also has a @xmath513-step successor . since @xmath514 we know that @xmath515 therefore it follows that @xmath516 a contradiction to the minimality of @xmath517    now , let @xmath518 and let there be some @xmath474 such that @xmath68 is an edge in @xmath99 and @xmath151 for some @xmath148 . since @xmath518 we know that @xmath519 or @xmath20 does not have a @xmath481-step predecessor , and hence @xmath207 for some @xmath520 . by construction of @xmath521 there is some world @xmath522 which satisfies the requirements , since the successors are chosen to be from @xmath260 if possible . since @xmath523 this proves that @xmath66 indeed satisfies the conditions .    for every @xmath524 we define @xmath525 to be the set @xmath526 . obviously , @xmath525 is a graph with root @xmath527 and is a restriction of @xmath260 ( recall that @xmath528 is the restriction of @xmath27 to all vertices reachable from @xmath529 on a directed path ) . hence , proposition  [ prop : trivial subgraph property ] and fact  [ prooffact : c models varphi i to i+1 ] immediately imply the following :    [ prooffact : m_c_g models varphi i to i+1 ] let @xmath530 . then @xmath525 is a graph with root @xmath529 such that @xmath531 for all @xmath532    for any @xmath530 and @xmath202 we define @xmath533    we observe the following fact :    [ prooffact : x in l(g)(i ) y in l(g)(i+1 ) gives edge ( x , y ) ] let @xmath524 @xmath202 @xmath534 and @xmath535 . then @xmath281 is an edge in @xmath536    this immediately follows from fact  [ prooffact : m_c_g models varphi i to i+1 ] and the definition of @xmath537 by definition , it follows that @xmath538 and @xmath539 . from fact  [ prooffact : c models varphi i to i+1 ] , we know that @xmath540 and hence there is an edge @xmath281 in @xmath260 as claimed .    graphs fulfilling the formula @xmath541 are `` layered : '' whenever there are nodes @xmath26 and @xmath394 such that there is a path of length @xmath52 from the root to @xmath212 and of length @xmath542 to the node @xmath543 then there is an edge between @xmath26 and @xmath394 . from the definition , it is obvious that for any subgraph @xmath22 of @xmath260 with root @xmath527 that @xmath22 is canonical , if for every pair of natural numbers @xmath544 it follows that @xmath545 . we make a distinction between those elements in @xmath66 which lead to a canonical graph , and those which do not . in light of lemma [ lemma : modal restriction invariance with levels ] , it is natural that we do not need to look at the entire graph , but can ignore nodes which do not have `` short '' paths from the root of the graph leading to it . for a natural number @xmath546 we say that @xmath22 is _ @xmath547-canonical _ , if for all @xmath548 it holds that @xmath549    we define the following :    @xmath550    it is obvious that @xmath551 . for each @xmath552 let @xmath553 denote natural numbers , and let @xmath554 denote some node such that @xmath555 with @xmath556 and @xmath557 is minimal with these properties . in particular , observe that @xmath557 and @xmath558 are polynomial in @xmath559    we now show that for @xmath552 the graph @xmath560 still has root @xmath527 unless it is empty . it particular , this means that it makes sense to ask if these graphs are @xmath182-canonical . [ prooffact : reduces models still rooted ] let @xmath552 such that @xmath560 is not empty . then @xmath560 has root @xmath561    assume that this is not the case , i.e. , that there is some @xmath562 and in this graph , there is no path from @xmath529 to @xmath19 . since @xmath19 is an element of @xmath563 a path from @xmath529 to @xmath19 exists in the original model @xmath27 . let @xmath564 be this path . since the path does not exist in the graph @xmath565 it follows that one of the @xmath566 must be an element of @xmath567 . since there is a path from this @xmath566 to @xmath95 it follows that @xmath19 is an element of @xmath567 as well , which is a contradiction . the nodes @xmath554 can be seen as `` minimal non - canonical points '' in @xmath525 . the following makes this more precise :    let @xmath568 . then @xmath560 is @xmath182-canonical . due to fact  [ prooffact : reduces models still rooted ] , we know that @xmath560 has root @xmath527 and by definition this graph is a subset of @xmath260 . assume that it is not @xmath182-canonical . then there exist natural numbers @xmath569 and some node @xmath570 . due to the minimality of @xmath571 it follows that @xmath572 and hence @xmath573 . in particular , it follows by induction on fact  [ prooffact : x in l(g)(i ) y in l(g)(i+1 ) gives edge ( x , y ) ] that there is a path from @xmath574 to @xmath575 i.e. , @xmath576 . this is a contradiction .    as our next connectivity result , we show the following :    [ prooffact : forward and back edges ] let @xmath552 and let @xmath577 @xmath578 where @xmath579 and @xmath580 are natural numbers such that @xmath581 . then @xmath281 is an edge in @xmath536    since @xmath582 and @xmath583 by induction on fact  [ prooffact : x in l(g)(i ) y in l(g)(i+1 ) gives edge ( x , y ) ] we know that @xmath584 and obviously this implies that for every multiple of @xmath585 a path of that length exists in @xmath27 from @xmath554 to @xmath554 itself . now assume that @xmath586 for some integer @xmath587 . we make a case distinction :    case 1 : @xmath588 : :    the above implies that    @xmath589    and by choice of @xmath233 we also know that    @xmath590 .    since all of the involved nodes are elements of @xmath455 and    from fact  [ prooffact : c models varphi i to i+1 ] we know that    @xmath591 for all    @xmath592 this implies that there is an edge from    @xmath26 to @xmath394 in @xmath99 as claimed . case 2 : @xmath593 : :    by choice of @xmath594 we know that    @xmath595 .    by choice of @xmath233 the above and since @xmath596 is    positive , we also know that    @xmath597 . hence the existence of the edge @xmath281 again follows from    fact  [ prooffact : c models varphi i to i+1 ] . we therefore have the following structure of the model @xmath225 by definition , @xmath598 and by choice of @xmath85 every node in @xmath260 can be reached on a path from a node in @xmath66 . therefore , @xmath599 and hence @xmath27 can be written as the union of sub - graphs as follows :    @xmath600    recall that the set @xmath66 is polynomial in @xmath496 . due to corollary  [ corollary : suffices to restrict middle vertices for np ] , it suffices to restrict the `` middle part '' of this equation , i.e. , the components except @xmath210 and @xmath601 to polynomial size in order to obtain the desired polynomial model . in order to do this , we will now prove further connectivity results for the sub - models @xmath567 . it is important to note that due to proposition  [ prop : trivial subgraph property ] , all of these submodels inherit all of the properties of their respective super - models which can be expressed by a universal first order formula . the idea behind the construction is the following : for each node in the original model , we add enough successors in our new model to ensure that the new model satisfies the conditions of lemma  [ lemma : modal restriction invariance with levels ] . for the @xmath182-canonical submodels , we know that we can stop adding nodes at depth @xmath144 since other nodes can not be reached on a shorter path from the root . for the non-@xmath182-canonical submodels , we can not do this , but we also do not need to : due to fact  [ prooffact : forward and back edges ] , we have `` circular '' edges , hence we know that nodes in a `` low '' level also are in a `` high '' level .    for the construction , let @xmath602 and let @xmath603 for @xmath604 define @xmath605 ( note that in this case , by definition @xmath606 is a member of @xmath607 ) . for @xmath608 define    @xmath609    note that by definition and fact  [ prooffact : reduces models still rooted ] it follows that @xmath610 is a graph which is either empty or has root @xmath611 . it also follows from the above that for @xmath612 the graph @xmath610 is @xmath182-canonical . since the union over all @xmath610 is the same as the union over all @xmath525 ( for all @xmath613 ) , it follows that    @xmath614    note that @xmath615 is polynomial in @xmath254 since @xmath66 is . we need one helpful fact about the non-@xmath182-canonical @xmath610-models :    [ prooffact : non canonical models are union over restricted levels ] let @xmath616 i.e. , let @xmath610 be not @xmath182-canonical . then @xmath617    the inclusion @xmath618 is obvious , since @xmath619 . for the inclusion @xmath620 let @xmath621 . since , by definition , @xmath622 and hence @xmath623 there is a minimal @xmath624 such that @xmath625 . if @xmath626 then the claim holds . therefore , assume that @xmath627 and thus @xmath628 . since @xmath629 we also know that @xmath630 therefore let @xmath631 . by definition , it holds that @xmath632 and in particular , @xmath633 . by fact  [ prooffact : forward and back edges ] , we know that there is an edge from @xmath631 to @xmath625 . this implies , by definition , that @xmath634 and by minimality of @xmath233 we know that @xmath635 and hence @xmath636 i.e. , @xmath637 a contradiction . we now define a series of models @xmath215 for @xmath638 which , step by step , integrate `` enough '' vertices of the original model @xmath27 to ensure that the formula @xmath32 still holds , but restrict the size to a polynomial . as the induction start , we define @xmath639 . for @xmath227 the construction is as follows :    * add every world from @xmath640 to @xmath214 * add @xmath611 to @xmath214 * if @xmath641 i.e. , if @xmath610 is @xmath182-canonical , then for each @xmath642 and each formula @xmath643 if there is a world @xmath644 such that @xmath187 then add _ one _ of these worlds into @xmath645 * if @xmath646 i.e. , if @xmath610 is not @xmath182-canonical , then for each @xmath647 and each formula @xmath153 perform the following : * * if there is a world @xmath644 such that @xmath187 then add _ one _ of these worlds @xmath19 into @xmath215 . * * if there is a world @xmath20 which has been added into one of the @xmath182-canonical submodels in the step above , and there is a successor @xmath644 of @xmath20 such that @xmath648 then add _ one _ of these worlds @xmath19 into @xmath645    by construction , since @xmath558 and @xmath557 are polynomial in @xmath496 for each @xmath552 and @xmath220 there are only polynomially many worlds in @xmath649 . we now define @xmath145 to be the model @xmath650 . then the set of worlds in @xmath145 which have @xmath651-step successor and a @xmath481-step predecessor is polynomially bounded , since this is a subset of @xmath649 . hence , due to corollary  [ corollary : suffices to restrict middle vertices for np ] , it suffices to show that @xmath152 in order to exhibit a model of @xmath32 which is polynomial in size . in order to prove this , we show that @xmath145 satisfies the conditions of lemma  [ lemma : modal restriction invariance with levels ] . since @xmath652 by definition and @xmath653 @xmath33 is an element of @xmath145 by definition . therefore , let @xmath20 be an element of @xmath206 and let @xmath167 be a subformula of @xmath83 such that @xmath149 and let @xmath654 be a natural number such that @xmath655 and @xmath656 . it suffices to show that there is a world @xmath150 such that @xmath187 and @xmath68 is an edge in @xmath536    since @xmath149 there is a world @xmath657 such that @xmath476 is an edge in @xmath99 and @xmath658 . there are several cases to consider . if @xmath659 then by the construction of @xmath206 @xmath660 is an element of @xmath145 as well . hence we can choose @xmath19 to be @xmath660 . if @xmath518 and @xmath661 then it holds that either @xmath662 or @xmath663 . if @xmath664 then we know that @xmath665 and we can choose @xmath666 . hence assume that @xmath662 . in this case , by choice of @xmath85 there is a world @xmath667 such that @xmath668 and @xmath669 is an edge in @xmath27 . since @xmath670 we can choose @xmath671 . if @xmath672 then @xmath673 holds as well . therefore , it remains to consider the case @xmath674 . first , assume that there is no @xmath675 such that @xmath676 . since @xmath677 it follows that @xmath621 for some @xmath52 . since @xmath678 @xmath610 must be @xmath182-canonical , since all other @xmath610 contain all successors from @xmath260 to nodes in @xmath610 it follows that @xmath679 and therefore @xmath680 holds as well . since @xmath678 there is a non-@xmath182-canonical submodel @xmath681 such that @xmath682 and hence , due to fact  [ prooffact : non canonical models are union over restricted levels ] , there is some @xmath683 such that @xmath684 . in this case , a node @xmath19 fulfilling the requirements has been added to the model @xmath145 due to the last condition in the construction . now assume that there is some @xmath685 such that @xmath676 . if it is possible to choose this @xmath52 in such a way that @xmath610 is not @xmath182-canonical , then we do so .    in particular , since @xmath476 is an edge in @xmath99 there is some natural number @xmath587 such that @xmath686 and @xmath687 . if it is only possible to choose an @xmath52 leading to a @xmath182-canonical model @xmath688 then choose @xmath52 and @xmath587 in such a way that @xmath587 is minimal with this property . we make a case distinction . case 1 : @xmath616 i.e. , @xmath610 is not canonical . : :    by fact  [ prooffact : non canonical models are union over restricted    levels ] , due to the minimality of @xmath233 we know that    @xmath689 . now , since    @xmath690 and    @xmath691 it follows that    @xmath692 . hence , by construction    there is a @xmath693 such that    @xmath187 and due to fact  [ prooffact : x in l(g)(i )    y in l(g)(i+1 ) gives edge ( x , y ) ] , there is an edge @xmath68    in @xmath536 case 2 : @xmath694 i.e. , @xmath610 is @xmath182-canonical . : :    if    @xmath695    then , due to the construction of @xmath206 a world    @xmath19 from @xmath696 satisfying    @xmath167 was added in the construction , and due to    fact  [ prooffact : x in l(g)(i ) y in l(g)(i+1 ) gives edge ( x , y ) ] ,    @xmath68 is an edge in @xmath536    +    therefore , assume that    @xmath697    i.e. ,    @xmath698 .    since @xmath610 is    @xmath182-canonical , we know that    @xmath20 can not be reached from @xmath611 with a path    shorter than @xmath182 steps . due    to the choice of @xmath52 and @xmath233 we also know    that @xmath20 does not appear in a    non-@xmath182-canonical submodel    ( otherwise , since the    non-@xmath182-canonical submodels    are successor - closed there would be a    non-@xmath182-canonical submodel    @xmath610 containing both @xmath20 and    @xmath699 and we would have chosen this ) , and that in each    @xmath182-canonical submodel where    @xmath20 appears , it has depth of at least    @xmath700 .    +    if @xmath62 is satisfied on every strict line , we    know that every node from @xmath260 can be reached from an    element in @xmath66 with at most    @xmath182 steps , which is a    contradiction . +    now consider the case that @xmath62 is not    satisfied on every strict line . since in the    @xmath182-canonical submodels ,    strict lines having the length of the depth of the submodel appear ,    and @xmath62 is satisfied in @xmath99 we    know that these submodels can not have depth of more than    @xmath446 .    therefore , we know that    @xmath701    a contradiction .    hence , we know that @xmath191 concluding the proof of theorem  [ theorem : above k to k+1 leads to np ] .    we will now show that theorem  [ theorem : above k to k+1 leads to np ] implies @xmath0-results for a number of related logics . the following theorem shows that modal logics for classes of frames which fulfill a natural generalization of the euclidean property have the polynomial - size model property , and hence can be solved in @xmath0 . note that the case @xmath702 of corollary  [ corollary : main np result corollary ] follows from the main result of  @xcite . our results and theirs are incomparable : they achieve the @xmath0-result for _ all _ normal modal logics extending what in our notation is @xmath703 where our results only hold for logics defined by universal horn clauses ( although the proof of theorem  [ theorem : above k to k+1 leads to np ] in most cases gives the @xmath0-result for all extensions of the logic which are defined by universal formulas over the frame language  the only exception is the case where the graph formula is satisfied on every strict line , note that this case needed special treatment in the proof of theorem  [ theorem : above k to k+1 leads to np ] , and relies on the tree - like property for these logics proven later in theorem  [ theorem : tree - like models for horn logics ] ) . we achieve @xmath0-results for many logics which are not extensions of @xmath703 but do not prove these results for all extensions of these logics .    with the preceding theorem and the results on the implication for formulas of the form @xmath704 we obtain the following corollary :    [ corollary : main np result corollary ] let @xmath62 be a universal horn formula implying @xmath381 for some @xmath705 such that one of the following conditions holds :    * @xmath706 * @xmath707 and @xmath708    then @xmath63 has the polynomial - size model property , and @xmath444    first assume that @xmath709 . lemma  [ lemma : varphi k to l implications ] shows that @xmath326 implies @xmath710 for some @xmath348 . from lemma  [ lemma : varphi k to l implication gives genvarphi implications ] , we conclude that @xmath381 implies @xmath711 for some natural numbers @xmath712 and @xmath713 . therefore , @xmath62 also implies @xmath714 and due to theorem  [ theorem : above k to k+1 leads to np ] , @xmath63 has the polynomial - size model property and @xmath444    for the case @xmath707 and @xmath715 observe that due to lemma  [ lemma : genvarphi k to 0 implications ] , @xmath63 is also an extension of @xmath716 for some constants @xmath717 . due to the prerequisites , it holds that @xmath718 . hence , the result follows from the case above . corollary  [ corollary : main np result corollary ] covers all cases obtained from formulas of the form @xmath381 where we possibly could expect the polynomial size property to hold : the requirement demanding that @xmath719 is crucial , since the formula @xmath720 is satisfied in any symmetric graph , and hence satisfiability problems for the corresponding logics are @xmath1-hard due to corollary  [ corollary : ufos satisfied in symmetric tree are pspace hard ] . additionally , logics defined by formulas of the form @xmath415 are @xmath1-hard as well : this formula is satisfied in every reflexive , transitive graph , and therefore the complexity result follows from theorem  [ theorem : ladner hardness cases for k - transitivity ] . we therefore have proven that for horn formulas defined by these single clauses , as soon as they are not satisfied in various combinations of strict , transitive , reflexive , and symmetric trees , they already imply the polynomial - size model property .    up to now , we only considered the effect of a single universal horn clause . however , there are many cases where the logics defined by individual formulas have a @xmath1-hard satisfiability problem , but the complexity of the problem for logic defined by their conjunction drops to @xmath0 . a well - known example for such a case is the modal logic @xmath721 which is the logic over graphs which are both symmetric and transitive . on their own , both of these properties lead to @xmath1-hard logics , but their conjunction gives a logic which is in @xmath0 . in our notation , it can easily be seen that @xmath722 . for this concrete example and many generalizations , the following theorem gives this result . [ theorem : transitive and symmetric gives np generalization ] let @xmath723 and let @xmath724 . let @xmath62 be a universal horn formula such that @xmath62 implies @xmath725 . then @xmath63 has the polynomial size model property , and @xmath444    we first prove that @xmath726 implies @xmath727 if @xmath67 is odd , and @xmath728 if @xmath67 is even . let @xmath66 be a graph satisfying @xmath729 and let @xmath730 ( @xmath731 if @xmath67 is even ) and @xmath732 ( @xmath733 if @xmath67 is even ) be nodes in @xmath66 such that @xmath734 and @xmath735 are edges for all relevant @xmath52 . first , let @xmath67 be odd . since @xmath736 it follows that @xmath66 is symmetric . by applying the @xmath415-property @xmath369 times , we get a path of length @xmath369 from @xmath33 to @xmath737 . hence , since @xmath738 is an edge , it follows that @xmath739 and due to the @xmath415-property , this implies that @xmath740 is an edge as required . now let @xmath67 be even . since @xmath741 and @xmath715 the symmetry of @xmath66 ensures that there is a path of length @xmath67 from @xmath33 to @xmath742 . hence , there is an edge @xmath743 and due to the symmetry of @xmath85 an edge @xmath744 . by @xmath745 applications of the @xmath746-property , we know that @xmath747 . hence , we conclude that @xmath748 and another application of the @xmath415-property gives the edge @xmath749 as required .    for the @xmath0-result , observe that @xmath725 implies @xmath750 where @xmath751 @xmath752 and @xmath753 . due to the above and lemma  [ lemma : varphi k to l implication gives genvarphi implications ] , we know that this formula implies @xmath754 for some @xmath717 if @xmath67 is odd , and it implies @xmath755 for some @xmath756 if @xmath67 is even . further , if @xmath67 is odd , then it follows that @xmath757 . hence , @xmath758 . if @xmath67 is even , then , since @xmath715 we know that @xmath759 and in both cases the @xmath0  result follows from corollary  [ corollary : main np result corollary ] . theorem  [ theorem : transitive and symmetric gives np generalization ] concludes our results about logics defined by specific horn formulas . we now have collected all tools required to prove the main result of the paper , the complexity classification of satisfiability problems for logics defined by universal horn formulas .      in this section , we show a dichotomy theorem , which classifies the complexity of the satisfiability problem for logics of the form @xmath760 where @xmath11 is a conjunction of universal horn clauses , into solvable in @xmath0  and @xmath1-hard . the classification is given in the form of the algorithm @xmath761  presented in figure  [ figure : classification algorithm ] . in order to explain the algorithm , we need some more definitions .    for a set @xmath762 we say that a graph @xmath66 satisfies the conditions of @xmath763 if it has the corresponding properties , i.e. , if @xmath764 then @xmath66 is required to be reflexive , if @xmath765 then @xmath66 is required to be symmetric , and if @xmath766 then @xmath66 is required to be @xmath67-transitive . a @xmath763-tree is a graph which can be obtained from a strict tree @xmath258 by adding exactly those edges required to make it satisfy the conditions of @xmath763 ( note that this is a natural closure operator ) . similarly , a @xmath763-line is the @xmath763-closure of a strict line . finally , for a universal horn clause @xmath276 let @xmath767 denote the pairs @xmath768 such that @xmath258 is a @xmath763-tree , and @xmath769 is a homomorphism . intuitively , due to proposition  [ prop : homomorphism and horn clauses ] , this is the set of @xmath763-trees about which the clause @xmath62 makes a statement , along with the corresponding homomorphisms . we first define the cases of universal horn clauses leading to @xmath0-containment of the satisfiability problem :    let @xmath62 be a universal horn clause , and @xmath770 . we say that @xmath771 satisfies the _ @xmath0-case _ , if one of the following occurs :    1 . @xmath284 for @xmath772 and there is @xmath773 such that there is no directed path connecting @xmath774 and @xmath775 in @xmath776 2 . @xmath777 and @xmath288 or the vertices from @xmath283 are different and not connected with an undirected path in @xmath294 ( this also applies if @xmath26 or @xmath394 do not appear in @xmath294 ) 3 . @xmath284 for @xmath778 and there is a homomorphism @xmath779 where @xmath780 is the @xmath763-line @xmath781 and there are @xmath782 such that @xmath783 such that @xmath784 and @xmath785 4 . @xmath284 for @xmath778 and there exist @xmath786-lines @xmath787 and @xmath788 and homomorphisms @xmath789 @xmath790 such that @xmath791 and @xmath792 @xmath793 and @xmath794 where @xmath708    we now define the properties of horn clauses which do not lead to @xmath0-containment of the satisfiability problems on their own . recalling section  [ subsection : ladner ] , it is natural that clauses which are satisfied in every reflexive , transitive , or symmetric tree are among these . this is captured by the following definitions : if @xmath62 is a universal horn clause with @xmath284 for @xmath795 or @xmath778 we say that @xmath771 satisfies the _ reflexive case _ , if @xmath795 or for every @xmath796 such that @xmath286 is not an edge in @xmath776 it holds that @xmath797 . @xmath771 satisfies the _ transitive case for @xmath70 _ , if it does not satisfy the reflexive case , and for every @xmath798 such that @xmath286 is not an edge in @xmath776 there is a path from @xmath774 to @xmath775 in @xmath776 and there is some @xmath773 such that there is no edge @xmath799 and @xmath775 is exactly @xmath67 levels below @xmath774 in @xmath258 . finally , @xmath771 satisfies the _ symmetric case _ if it does not satisfy the reflexive of the transitive case , and for every @xmath773 such that @xmath286 is not an edge in @xmath776 there is an edge @xmath800 in @xmath258 . we can now state the classification theorem  the proof will follow from the individual results in this section . note that the algorithm as stated can not be implemented directly , since it uses tests of the form if a given first - order formula is satisfied in certain infinite classes of graphs , and checks if certain elements are present in the infinite set @xmath767 . however , we believe that size - restrictions for the structures actually required to look at can be proven , and hence the algorithm hopefully can be implemented to give a deterministic decision procedure . however , the main usage of the algorithm is to show more general classification theorems , as we will see in corollary  [ corollary : horn cunjunction without algorithm ] .    [ theorem : horn conjunction classification ] let @xmath167 be a conjunction of universal horn clauses . then the complexity of @xmath801 is correctly determined by @xmath761 . a first look at the algorithm in figure  [ figure : classification algorithm ] reveals that it is obviously necessary to prove that the choices that the algorithm has to make always can be made : in the relevant situations , at least one of the `` reflexive , '' `` transitive , '' or `` symmetric '' conditions occurs . however , before starting with the proof , we explain the general idea of the algorithm and give an example for a logic which @xmath761  proves to have a satisfiability problem in @xmath0 .    in the variable @xmath802 the algorithm maintains a list of implications of the formula @xmath167 . for example , @xmath761  puts @xmath803 into @xmath763 if it detects the formula @xmath167 to require a graph satisfying it to be `` near - reflexive '' ( meaning , reflexive in all nodes with sufficient height and depth ) . similarly , @xmath804 means that @xmath11 requires a graph to be `` near - symmetric , '' and @xmath805 means that @xmath11 requires a graph to be `` near-@xmath67-transitive '' ( this will be made precise in lemma  [ lemma : horn conjunction algorithm adds correctly to types - list ] ) . if at one point @xmath761  detects that a clause @xmath62 satisfies one of the @xmath0-conditions , then this means that the clause @xmath302 in addition with the requirements kept in @xmath802 implies a graph - property which leads to the polynomial - size model property . it is well - known that the modal logic over the class of frames which are both transitive and symmetric has a satisfiability problem in @xmath0 . generalizing this , when @xmath761  detects that @xmath11 requires `` near - symmetry '' and `` near-@xmath67-transitivity , '' this also leads to the polynomial - size model property and thus to @xmath0-membership of the satisfiability problem , applying theorem  [ theorem : transitive and symmetric gives np generalization ] . l6.5 cm     as an example , let @xmath62 be the universal horn clause with prerequisite graph as shown in figure  [ fig : applications section example graph 1 ] , with @xmath806 and let @xmath11 be the horn formula having @xmath62 as its only conjunct . the algorithm @xmath761  starts with @xmath807 and hence in its first iteration , checks if @xmath62 is satisfied in every strict tree . this is not the case , as figure  [ fig : applications section example graph 2 ] shows ( here , we simply marked each note with the names of the vertices which are preimages of the homomorphism ) : this is a homomorphic image of @xmath294 as a strict line ( which in particular is a strict tree ) , in which the images of @xmath26 and @xmath394 are not connected with an edge . therefore , @xmath62 is not satisfied in this line , and hence not in every strict tree . however , it is clear that if we want to map @xmath294 into a strict tree , then all the vertices between @xmath808 and @xmath503 must be `` pairwise identified , '' just like in figure  [ fig : applications section example graph 2 ] . l6.5 cm     therefore the transitive case is satisfied , and the figure shows that this is true for @xmath809 ( among possibly others ) . hence @xmath761  adds the element @xmath810 to @xmath763 . next it checks if @xmath62 is satisfied in every @xmath811-tree . this again is not the case , and the homomorphic image of @xmath294 as a @xmath811-line in figure  [ fig : applications section example graph 3 ] shows that @xmath62 satisfies @xmath0-condition @xmath812 ( we only included those lines added by the @xmath810-closure that are required for our function to be a homomorphism ) . therefore , the logic @xmath63 has the polynomial - size model property , and its satisfiability problem is in @xmath0 . this example demonstrates that in the run of @xmath761 , a clause @xmath62 can meet different cases depending on the content of the variable @xmath813 in the situation that @xmath807 the clause @xmath62 satisfies the transitive case , but when @xmath814 this is no longer the case . -line ]    as mentioned above , the first fact that we need to prove about @xmath761  is that it is well - defined , that is , the case distinction between the `` reflexive , '' `` transitive '' and `` symmetric '' cases is complete . [ lemma : big classification algorithm is well - defined ] @xmath761  is well - defined : in all relevant situations , at least one of the `` reflexive , '' `` transitive , '' and `` symmetric '' cases occurs . assume that the algorithm is not well - defined , and let @xmath11 be an instance for which the algorithm behavior is unspecified . let @xmath62 be a clause for which none of the @xmath0-conditions and none of the reflexive , transitive , and symmetric conditions hold . let @xmath763 be as determined by @xmath761  when encountering @xmath815    since the algorithm only chooses @xmath62 if @xmath62 is not satisfied on every @xmath763-tree , we know that due to proposition  [ prop : homomorphism and horn clauses ] , there is some @xmath798 . now assume that @xmath288 or @xmath284 for @xmath816 and @xmath817 do not both appear in @xmath294 . then @xmath0-condition @xmath69 is satisfied , and we have a contradiction . therefore we know that @xmath62 is a universal horn clause such that @xmath284 for some variables @xmath817 such that @xmath795 or @xmath818 since the reflexive case does not apply , we know that @xmath816 and hence @xmath819    since @xmath436-condition @xmath197 does not apply , we know that for every @xmath820 there is a directed path connecting @xmath774 and @xmath821    since the transitive case does not apply , we know that there is some @xmath822 in which there is no path from @xmath774 to @xmath775 . we therefore know , by the above , that there is a path from @xmath775 to @xmath774 in @xmath258 . hence , @xmath258 is not symmetric . since @xmath258 is a @xmath763-tree , we know that @xmath823    since there is a path from @xmath775 to @xmath774 in @xmath258 but not vice versa , we know that @xmath824 and since there is a path from @xmath775 to @xmath774 in the ( possibly reflexive and/or @xmath72-transitive for some set @xmath72 ) tree @xmath776 this implies that @xmath774 is on a lower level in @xmath258 than @xmath775 . let @xmath67 denote the difference in levels between @xmath774 and @xmath825 then @xmath826 . by mapping @xmath258 into a @xmath763-line @xmath787 with the homomorphism @xmath318 assigning each vertex @xmath20 the element @xmath827 where @xmath52 is the level of @xmath20 in @xmath776 we can , using the homomorphism @xmath828 map @xmath294 homomorphically into @xmath829 in such a way that @xmath830 and @xmath831 where @xmath52 denotes the level of @xmath774 in @xmath832    if @xmath715 then the line @xmath829 satisfies @xmath0-condition @xmath833 a contradiction . therefore , we know that @xmath834 and thus @xmath835 and @xmath829 satisfy @xmath0-condition @xmath836 .    since @xmath62 also does not satisfy the symmetric case , we know that there is some @xmath773 such that there is no edge @xmath286 and no edge @xmath800 in @xmath258 . by @xmath436-condition @xmath426 we know that there is a directed path connecting @xmath774 and @xmath775 in @xmath258 . since @xmath837 and @xmath258 is a @xmath786-tree , we know that @xmath258 is not symmetric . if @xmath764 and @xmath258 is a @xmath763-tree , this implies that @xmath258 is reflexive , and hence @xmath838 . if @xmath839 then we know that , since @xmath840 also is not an element of @xmath802 that no node in @xmath258 is connected to itself with a directed path , and therefore we also know that @xmath838 . now assume that there is a path from @xmath775 to @xmath774 in @xmath258 . then the shortest of these paths must have length @xmath719 ( since there is no edge @xmath800 and therefore we can map @xmath258 ( and therefore @xmath294 ) homomorphically into a line @xmath829 as in the case above , where the distance of the image of @xmath774 and @xmath775 is @xmath65 and since @xmath775 is mapped to a predecessor of @xmath841 this line satisfies @xmath0-condition @xmath833 a contradiction . therefore we know that in @xmath776 there is a directed path from @xmath774 to @xmath775 . since @xmath286 is no edge in @xmath776 we know that the shortest of these paths must have length @xmath842 . since @xmath258 is not symmetric , this implies that @xmath775 must be on a lower level in @xmath258 than @xmath841 and the difference in levels is @xmath842 . similarly , to the above , we can construct a @xmath786-line @xmath843 and a homomorphism @xmath844 such that for @xmath845 if @xmath52 is the level of @xmath19 in @xmath776 then @xmath846 . let @xmath847 denote the homomorphism @xmath323 . due to the choice of @xmath67 and the definition of @xmath848 we know that @xmath849 and @xmath850 for some @xmath212 and hence @xmath847 and @xmath851 satisfy @xmath0-condition @xmath836 . since above , we already constructed @xmath835 and @xmath829 satisfying @xmath0-condition @xmath852 this implies that @xmath62 satisfies @xmath0-condition @xmath852 a contradiction .    also note that in the transitive case , a @xmath719 can always be chosen : since by construction of the algorithm , @xmath62 is not satisfied on every @xmath786-tree , there is some @xmath768 such that @xmath286 is not an edge in @xmath258 . since the reflexive case does not apply , we can choose @xmath768 in such a way that @xmath838 . due to the transitive case , there is a path from @xmath774 to @xmath775 in @xmath776 and hence the shortest of these paths must have length of at least @xmath375 hence the difference of levels is at least @xmath69 ( we know that even if @xmath765 @xmath775 must be below @xmath774 in @xmath776 otherwise @xmath0-condition @xmath812 would apply ) . now that we know that @xmath761  is well - defined , we show that it always comes to a halt and hence , generates an answer  this is not immediate : note that in the example formula from figure  [ fig : applications section example graph 1 ] discussed above , we already saw that it is possible for the algorithm to revisit a clause . therefore one might consider it possible for the algorithm to repeatedly add the same element to the variables @xmath763 without coming to a halt , or the list @xmath763 to grow infinitely . in order to show that this does not happen , we prove a bound on the number of the elements that can be added into this list during the run of the algorithm . [ lemma : path from x to y in transitive case ] let @xmath62 be a clause in a universal horn formula @xmath11 such that @xmath62 satisfies the transitive case for a list @xmath763 such that @xmath853 for some @xmath854 and @xmath855 . then there is a path from @xmath26 to @xmath394 in @xmath856    the main idea of the proof is to show that if there is no path from @xmath26 to @xmath394 in @xmath292 then these variables are `` independent '' enough in @xmath294 to satisfy @xmath0-condition @xmath833 which then is a contradiction , since the clause satisfies the transitive case .    by the prerequisites , since @xmath62 satisfies the transitive case , @xmath62 is not satisfied in every @xmath763-tree , and hence in particular there is some @xmath773 such that @xmath286 is not an edge in @xmath258 . since @xmath4 satisfies the transitive case , there is a path from @xmath774 to @xmath775 in @xmath258 . by the prerequisites , we know that there is some @xmath857 . we then know that @xmath858 since @xmath859 is never adder to @xmath763 ( note that this is tautological , since any graph is @xmath197-transitive ) . if @xmath258 were reflexive , then by proposition  [ prop : k - transitivity facts ] , we know that @xmath258 would also be @xmath69-transitive , i.e. , transitive , and hence there would be an edge @xmath286 in @xmath776 a contradiction . hence we know that @xmath258 is not reflexive , and therefore @xmath839 since @xmath258 is a @xmath763-tree . since by the prerequisites , we know that @xmath837 we know that @xmath258 is also not symmetric . since there is a path from @xmath774 to @xmath825 and @xmath258 is neither symmetric nor reflexive , we know that @xmath775 is on a lower level in @xmath258 that @xmath774 . we also know that there is no path from @xmath775 to @xmath774 in @xmath258 . let @xmath860 be the difference of levels between @xmath774 and @xmath775 in @xmath258 . since we know that there is no edge @xmath286 in @xmath776 we know that @xmath861    now define a partial order @xmath862 on the variables in @xmath302 by @xmath863 if @xmath864 or if there is a path from @xmath20 to @xmath19 in @xmath294 . since @xmath294 can be mapped into a @xmath763-tree which is acyclic , we know that @xmath862 is anti - symmetric . since @xmath862 is obviously reflexive and transitive , this implies that @xmath862 is a partial order . now map @xmath258 into a @xmath786-list @xmath865 with the homomorphism @xmath848 such that for all @xmath845 @xmath866 where @xmath52 denotes the level of @xmath19 in @xmath258 . from the above we know that @xmath867 and @xmath868 for some @xmath869    let @xmath870 such that @xmath871 . such am @xmath49 exists , since @xmath872 . let @xmath873 be the @xmath786-line of length @xmath874 and define a function @xmath875 by    @xmath876    we show that @xmath877 is a homomorphism . for this , let @xmath68 be an edge in @xmath294 . since @xmath323 is a homomorphism , we know that @xmath878 is an edge in @xmath829 . we make a case distinction :    @xmath879 and @xmath880 : :    then , @xmath881 and @xmath882 have the    same position in @xmath851 as    @xmath883 and    @xmath884 have in @xmath829 . since    @xmath851 restricted to @xmath885 is    isomorphic to @xmath886 this implies that    @xmath887 is an edge in @xmath888    as required . @xmath889 and @xmath890 : :    in this case , @xmath881 and @xmath882    have the same positions in @xmath851 restricted to    @xmath891 as    @xmath883 and    @xmath884 have in @xmath829 . since the    restricted line is isomorphic to @xmath886 we again conclude    that @xmath887 is an edge in    @xmath892 @xmath889 and @xmath880 : :    since @xmath68 is an edge in    @xmath292    this implies @xmath863 . since @xmath862 is    transitive , this implies @xmath893 a contradiction . @xmath879 and @xmath894 : :    let @xmath895 and let    @xmath896 . then we know that    @xmath897 is an edge in @xmath829 . therefore ,    since @xmath898 and @xmath885    are isomorphic , we also know that there is an edge    @xmath899 in @xmath851 . in @xmath888    there obviously is a @xmath900-step path from    @xmath901 to @xmath902 . therefore , in    @xmath888 there is a @xmath903-step path from    @xmath904 to @xmath902 . since    @xmath853    and @xmath851 is a    @xmath763-list , we know that    @xmath851 is @xmath905-transitive , and by    proposition  [ prop : k - transitivity facts ] , this implies that    @xmath851 is also @xmath906-transitive . therefore , there is an edge @xmath907 . by    definition of @xmath908 since @xmath909    @xmath910 @xmath895 and    @xmath911 we know that    @xmath912 and    @xmath913 . thus , from the above we know    that @xmath887 is an edge in    @xmath892    since @xmath887 is an edge in @xmath851 in all cases , we know that @xmath914 is indeed a homomorphism . now assume that there is no path from @xmath26 to @xmath394 in @xmath294 . since @xmath62 satisfies the transitive case , we know by the construction of @xmath761  that @xmath62 does not satisfy the reflexive case , and hence in particular , @xmath915 . therefore we know that @xmath916 . since @xmath917 obviously holds , and since @xmath867 and @xmath918 we know that    @xmath919    since , by choice of @xmath920 @xmath921 this implies that @xmath877 and the @xmath763-line @xmath851 satisfy @xmath0-condition @xmath833 a contradiction . therefore we know that there is a path from @xmath26 to @xmath394 in @xmath292 as claimed .    a first helpful tool to show this is the following proposition , which says that there are no `` redundant '' transitivity conditions which get added to @xmath786 . [ prop : algorithm does not add already implied transitivity ] let @xmath922 be added to the variable @xmath763 by @xmath761 . then @xmath763 did not imply @xmath67-transitivity before adding @xmath923    assume that @xmath763 already implied @xmath922 . since @xmath922 is added by @xmath761 , there is a clause @xmath62 with conclusion edge @xmath281 for @xmath818 which satisfies the transitive condition for @xmath67 at this point of the algorithm s run . therefore , there is some @xmath773 such that @xmath286 is not an edge in @xmath776 and @xmath775 is exactly @xmath67 levels below @xmath774 . since by the assumption the conditions of @xmath763 already imply @xmath67-transitivity , the @xmath67-step path from @xmath774 to @xmath775 implies that @xmath286 is an edge in @xmath776 a contradiction . now that we know that transitivity conditions which were already implied by the conditions present in @xmath786  do not get added to the list , there is a clear strategy how we can prove that @xmath786  does not grow infinitely : we first prove just how many transitivity conditions are implied by the conditions in @xmath786 , and then show that from a certain point on , everything that will be added to @xmath786  by @xmath761  already is implied . in order to prove this , we need some technical results about implications of various forms of @xmath72-transitivity .    [ lemma : test case 1 ] let @xmath924 . then @xmath925-transitivity implies @xmath926-transitivity for all @xmath927    we show the claim by induction on @xmath928 . for @xmath929 this holds trivially , since @xmath925-transitivity by definition implies @xmath860-transitivity . now assume that it holds for @xmath930 let @xmath66 be some graph which is @xmath925-transitive , and let @xmath931 be nodes in @xmath66 such that @xmath501 is an edge for all relevant @xmath52 . we need to show that @xmath932 is an edge in @xmath66 . since by the induction hypothesis , @xmath925-transitivity implies @xmath926-transitivity , we know that @xmath66 is @xmath926-transitive . therefore there is an edge @xmath933 in @xmath66 . by choice of @xmath934 there is a @xmath935-step path from @xmath936 to @xmath937 . therefore there is a @xmath905-step path from @xmath938 to @xmath939 and since @xmath66 is @xmath905-transitive , this implies that @xmath940 is an edge in @xmath85 as required . [ lemma : test case 2 ] let @xmath941 such that @xmath942 . then @xmath943-transitivity implies @xmath944-transitivity for all @xmath927    let @xmath945 for some @xmath946 @xmath947 . then @xmath948 . since @xmath949 we know that @xmath943-transitivity implies @xmath950-transitivity . by lemma  [ lemma : test case 1 ] , we know that @xmath951-transitivity implies @xmath952-transitivity , and since @xmath905-transitivity is obviously implied by the prerequisites , this proves the lemma . [ lemma : test case 4b ] let @xmath953 and let @xmath954 such that @xmath955 and for @xmath544 @xmath956 . then there exists some @xmath957 such that @xmath958 such that @xmath959-transitivity implies @xmath944-transitivity for all @xmath927    let @xmath960 and let @xmath961 where @xmath962 . due to lemma  [ lemma : test case 1 ] , @xmath963-transitivity implies @xmath964-transitivity for all @xmath965 . therefore we can choose @xmath966 and we know that @xmath72-transitivity implies @xmath967-transitivity . since for all @xmath930 @xmath968 is equivalent to @xmath969 modulo @xmath970 and modulo @xmath971 ( since @xmath971 divides @xmath970 ) , we can assume without loss of generality that @xmath972 for all @xmath973 . let @xmath974 where @xmath975 . such numbers @xmath976 exist , since @xmath977 for all @xmath782 . since @xmath978 we know that @xmath979 and therefore @xmath980 for all @xmath981    define @xmath982 . note that since @xmath971 divides @xmath983 this implies that @xmath984 . for the @xmath969 it holds that @xmath985 and again , since @xmath971 divides @xmath983 we have that @xmath986 . now since @xmath974 it follows that @xmath987 is equivalent to @xmath424 modulo @xmath988 and hence @xmath49 and @xmath969 are equivalent modulo @xmath971 for all @xmath52 . now note that    @xmath989    therefore , since @xmath72-transitivity implies @xmath969-transitivity for all @xmath212 we know that @xmath72-transitivity implies @xmath990-transitivity for all @xmath52 . since @xmath991 and for @xmath544 it also holds that @xmath992 ( otherwise it would follow that @xmath993 and hence @xmath994 a contradiction ) , it follows that @xmath995 . we therefore know that for each @xmath996 @xmath72-transitivity implies @xmath997-transitivity , and since @xmath998 the claim follows from lemma  [ lemma : test case 2 ] . the following lemma is the final of our results about implied transitivity conditions . its technical formulation hides the fact that the statement of the lemma is actually rather natural . as an example , consider the case where @xmath999 and @xmath1000 . then @xmath1001 and then the lemma says that there is some odd number @xmath49 such that for all odd numbers @xmath1002 @xmath1003-transitivity implies @xmath1004-transitivity . the key idea is that then , once @xmath1005 and @xmath1006 are elements of @xmath802 we know that due to proposition  [ prop : algorithm does not add already implied transitivity ] , @xmath761  does not add any more @xmath922-conditions to @xmath786  anymore for odd @xmath67s which are greater than or equal to @xmath49 . therefore there are only finitely many odd @xmath67s such that @xmath761  can add @xmath922 from this point on . if @xmath761  would add an infinite number of @xmath922-conditions , then one of them must therefore be one where @xmath67 is even . assume that this already happens with @xmath1007 i.e. , that @xmath1008 is an even number . then @xmath1009 is odd , and therefore the greatest common divisor of @xmath1010 and @xmath1009 is @xmath197 . by the lemma , we therefore know that there is some @xmath49 such that @xmath1011-transitivity implies @xmath1012-transitivity for all @xmath1013 and then @xmath761  can only add @xmath922-conditions for @xmath1014 and this is only a finite number of possibilities . thus we know that @xmath761  must stop adding transitivity conditions at some point .    with the above proof - strategy in mind , it is clear that the statement of the following lemma is crucial in restricting the number of @xmath922-conditions added by @xmath761 . [ lemma : test case 5 ] let @xmath1015 and let @xmath1016 . then there exists some @xmath957 such that @xmath1017 and @xmath1018-transitivity implies @xmath944-transitivity for all @xmath927    let @xmath1019 . we show the claim inductively on @xmath103 . if @xmath1020 then @xmath1021 and by lemma  [ lemma : test case 1 ] , @xmath1022-transitivity implies @xmath1023-transitivity for all @xmath592 hence the claim follows with @xmath1024    since we need the case @xmath1025 explicitly in the induction , we prove it individually . hence let @xmath1026 and let @xmath1027 where @xmath1028 .    from lemma  [ lemma : test case 1 ] , we know that @xmath925-transitivity implies @xmath1029-transitivity for all @xmath1030 . now note that for all @xmath1031    @xmath1032    due to lemma  [ lemma : test case 4b ] , it suffices to show that all of these @xmath969 are equivalent to @xmath197 modulo @xmath988 and for @xmath1033 @xmath956 . it is obvious that all @xmath969 are equivalent to @xmath197 modulo @xmath971 . now assume that there are @xmath1034 such that @xmath1035 . then the following holds :    @xmath1036    this is a contradiction , since due to the above , we know that @xmath1037 . this completes the proof for the case @xmath1038    now inductively assume that the lemma holds for @xmath1039 . let @xmath1040 . recall that @xmath1041 . we first show that @xmath1042 which is a standard fact from number theory . obviously , @xmath971 divides both @xmath1043 and @xmath1044 and hence @xmath1045 . on the other hand , let @xmath529 be a common divisor of @xmath1046 and @xmath1047 . since @xmath529 divides @xmath1044 @xmath529 is also a divisor of @xmath1048 and since @xmath529 divides @xmath1049 it is a common divisor of all @xmath1050 . therefore , @xmath1051 . in particular , this holds for @xmath1052 and therefore @xmath1053 . since the other direction holds due to the above , we have shown that @xmath1054    due to the induction hypothesis , we know that there is a natural number @xmath1012 such that @xmath1055 and for all @xmath1056 @xmath72-transitivity implies @xmath1057-transitivity . let @xmath1058 and let @xmath1059 be a natural number such that @xmath1060 . then , by choice of @xmath1061 we know that @xmath72-transitivity implies @xmath1057-transitivity . let @xmath1062 . since @xmath72-transitivity also implies @xmath1043-transitivity , we know from the case @xmath1025 that there exists a natural number @xmath49 such that @xmath1063 and for all @xmath592 @xmath72-transitivity implies @xmath1064-transitivity . in order to prove the lemma , it therefore suffices to show that @xmath1065 . it holds that @xmath1066    since @xmath971 is a divisor of @xmath1047 and of @xmath1049 it follows that @xmath1067 . on the other hand , @xmath1068 is a common divisor of @xmath1069 and @xmath1046 . since @xmath1070 we know that @xmath1068 divides @xmath1047 . since @xmath1068 also divides @xmath1049 this implies that @xmath1068 is a divisor of @xmath1071 . therefore @xmath1072 and @xmath1073 and hence we have proven that @xmath1074 as claimed . we can now prove that there are only finitely many additions of the form @xmath922 during the algorithm s run , using the arguments from the discussion before lemma  [ lemma : test case 5 ] :    [ lemma : algorithm adds only finitely many transitivity conditions ] let @xmath11 be a universal horn formula . then @xmath1075 on input @xmath10 only adds finitely many conditions of the form @xmath922 to @xmath1076    assume that this is not the case . due to proposition  [ prop : algorithm does not add already implied transitivity ] , we know that each added @xmath922-element is not implied by the previous elements , in particular , no element is added twice . hence there is an infinite sequence @xmath1077 such that all @xmath1078 are added to @xmath802 they are added in this order , and for @xmath1079 we have @xmath1080    for @xmath1081 let @xmath1082 . then @xmath1083 is obviously decreasing , and bounded by @xmath197 . therefore , the sequence converges , i.e. , there is some @xmath1084 such that @xmath1085 for all @xmath1086 . due to lemma [ lemma : test case 5 ] , we know that there is some @xmath49 such that @xmath1087-transitivity implies @xmath944-transitivity for all @xmath592 and @xmath1017 . since the sequence @xmath1088 is infinite and no element is repeated , there is some @xmath1086 such that @xmath1089 . since @xmath1090 we know that @xmath971 divides @xmath1091 . therefore , let @xmath1092 . since @xmath1093 let @xmath1094 . since @xmath1095 we know that @xmath1096 . hence it follows that    @xmath1097    due to the choice of @xmath49 and since @xmath1098 we therefore know that @xmath1099-transitivity implies @xmath1100-transitivity . this is a contradiction to proposition  [ prop : algorithm does not add already implied transitivity ] , since @xmath1100 is added after @xmath1101 . therefore , there are only finitely many elements of the form @xmath922 added by the algorithm .    since we have now restricted the number of elements @xmath922 added to @xmath802 we can prove that the algorithm halts on any input . @xmath761  always halts . assume that it does not halt for an instance @xmath11 . due to lemma  [ lemma : algorithm adds only finitely many transitivity conditions ] , we know that there are only finitely many elements of the form @xmath922 which are added to @xmath763 by @xmath761 . since the only other elements which can be added to @xmath763 are @xmath1102 and @xmath1103 this implies that there are only finitely many elements of any type which are added to @xmath763 . now let @xmath763 be as determined by the algorithm . since the size of @xmath763 is bounded and the variable never shrinks , this is well - defined . since the algorithm does not halt , we know that there is a clause @xmath62 in @xmath11 which is not satisfied in every @xmath763-tree , and @xmath62 does not satisfy any of the @xmath836 @xmath0-conditions . thus there is some @xmath798 such that @xmath62 is not satisfied in @xmath258 . since we already showed that @xmath761  is well - defined , and none of the @xmath0-cases applies ( otherwise the algorithm would come to a halt ) , we know that one of the reflexive , transitive , or symmetric cases applies . in particular , @xmath806 and @xmath795 or @xmath818 and @xmath286 is not an edge in @xmath258 . if one of the cases corresponding to an element not in @xmath763 applies , then this leads to an enlargement of @xmath802 a contradiction to the choice of @xmath763 . hence one of the cases corresponding to one of the elements already in @xmath763 applies . we make a case distinction :    case 1 : the reflexive case applies . : :    in the case that @xmath1104 the clause is trivially satisfied    in the reflexive graph @xmath258 . assume that    @xmath915 . in this case ,    @xmath797 . but since    @xmath764 and    @xmath1105    we know that @xmath258 is a reflexive tree . hence , the edge    @xmath286 exists in @xmath776 a    contradiction . case 2 : the transitive case applies for some @xmath1106 : :    in this case , there is a path of length @xmath67 from    @xmath774 to @xmath775 in @xmath258 . but since    @xmath766    and    @xmath1105    we know that @xmath258 is a @xmath67-transitive tree .    hence , the edge @xmath286 exists in    @xmath776 a contradiction . case 3 : the symmetric case applies . : :    in this case , there is an edge from @xmath775 to    @xmath774 in @xmath258 . but since    @xmath765 and    @xmath1105    we know that @xmath258 is a symmetric tree . hence , the edge    @xmath286 exists in @xmath776 a    contradiction . since we have a contradiction in each case , this completes the proof . now that we know that the algorithm is both well - defined and comes to a halt , it remains to prove its correctness . the case in which the algorithm states @xmath1-hardness is easily seen to be correct :    [ lemma : horn conjunction algorithm correct on pspace ] if for a universal horn formula @xmath10 @xmath761  states that @xmath75 is @xmath1-hard , then this is true . the only possibility for the algorithm to state that the problem is @xmath1-hard is when the while - loop does not discover any clauses @xmath62 anymore which are not satisfied in every @xmath763-tree , and @xmath763 does not contain both @xmath840 and @xmath1107 for any @xmath70 . since each clause @xmath62 in @xmath11 is satisfied in every @xmath763-tree , this implies that the conjunction @xmath11 is also satisfied in each @xmath763-tree . hence one of the following cases occurs :    * @xmath11 is satisfied in every strict tree ( if @xmath1108 ) , * @xmath11 is satisfied in every reflexive tree ( if @xmath1109 ) , * there is a set @xmath74 such that @xmath11 is satisfied in every @xmath72-transitive tree ( if @xmath1110 ) , * @xmath11 is satisfied in every symmetric tree ( if @xmath1111 ) , * @xmath11 is satisfied in every tree which is both reflexive and symmetric ( if @xmath1112 ) , * there is a set @xmath74 such that @xmath11 is satisfied in every tree which is both reflexive and @xmath72-transitive ( if @xmath1113 ) .    in each of these cases , the hardness result follows directly from theorem  [ theorem : ladner hardness cases for k - transitivity ] . we are now interested in the @xmath0-cases . we first show that if @xmath761  adds one of the requirements @xmath1114 or @xmath1107 for some @xmath67 to the list @xmath802 then the formula @xmath11 requires any graph @xmath66 satisfying @xmath11 to have the corresponding property ( except for vertices with insufficient depth or height in the graph ) . more precisely , we show the following lemma :    [ lemma : horn conjunction algorithm adds correctly to types - list ] let @xmath11 be a universal horn formula , and let @xmath1115 be added to @xmath763 by @xmath761  on input @xmath11 . then the following holds :    * if @xmath1116 then @xmath11 implies @xmath1117 for some @xmath1118 * if @xmath1119 then @xmath11 implies @xmath1120 for some @xmath1118 * if @xmath1121 then @xmath11 implies @xmath1122 for some @xmath1123    inductively assume that all values added before @xmath1124 ( if any ) were `` correct '' in the sense that they satisfy the conditions of the lemma . let the content of the variable @xmath763 directly before adding @xmath1124 be denoted with @xmath1125 . let @xmath62 be the clause in @xmath11 for which @xmath1124 was added . then , by the construction of the algorithm , we know that @xmath62 satisfies the case in the algorithm corresponding to @xmath1126 it particular , @xmath284 for some variables @xmath795 or @xmath818 . first assume that @xmath819    we also know that @xmath62 is not satisfied in every @xmath1125-tree . hence , let @xmath1127 such that @xmath286 is not an edge in @xmath258 . this must exist due to proposition  [ prop : homomorphism and horn clauses ] . by construction of @xmath761 , in the case that @xmath1128 we have that @xmath1129 and in the case that @xmath1130 we can choose @xmath768 in such a way that @xmath775 is is @xmath67 levels below @xmath774 in @xmath258 . finally , in the case that @xmath1131 we know that there is an edge @xmath800 in @xmath258 . since the reflexive condition does not apply , we can choose @xmath768 in such a way that @xmath824 and since @xmath1132 this implies that @xmath774 is in a lower level of @xmath258 than @xmath775 . since all additions before @xmath1124 were correct , we know that all the types in @xmath1125 have been added correctly , i.e. , we can assume that there is some @xmath251 such that    * if @xmath1133 then @xmath11 implies @xmath1117 for some @xmath1118 * if @xmath1134 then @xmath11 implies @xmath1120 for some @xmath1118 * if @xmath1135 then @xmath11 implies @xmath1122 for some @xmath1123    we can use the same value @xmath251 for all formulas here by taking the maximum , since clearly , @xmath381 implies @xmath1136 if @xmath1137 @xmath1138 and @xmath1139 . now let @xmath1140 be the homomorphic image of @xmath258 under the homomorphism @xmath1141 as a @xmath1125-line , where @xmath1141 assigns each @xmath1142 the node @xmath827 with @xmath52 being the level of @xmath19 in @xmath258 . let @xmath774 be in the @xmath654th level of @xmath776 and let @xmath775 be in the @xmath1143th level of @xmath258 ( where @xmath103 is the height of @xmath258 ) . due to the construction of @xmath1144 we know that @xmath1145 and @xmath1146 . first note that :    * if @xmath1128 then @xmath1129 and hence @xmath1147 . it follows that @xmath1148 * if @xmath1130 then by choice of @xmath776 @xmath775 is exactly @xmath67 levels below @xmath26 in @xmath776 and therefore we know that @xmath1149 . * if @xmath1131 then , since @xmath1132 we know that in @xmath1150 we only have edges between non - decreasing nodes . since the symmetric case applies , we know that @xmath800 is an edge in @xmath258 . since @xmath824 @xmath774 is at a lower level than @xmath775 in @xmath776 and it follows that @xmath1151 . if @xmath1152 then it follows that the line @xmath780 satisfies @xmath0-condition @xmath833 a contradiction . therefore we know that @xmath1153    we now show that    @xmath1154    for this , let @xmath66 be a graph such that @xmath137 by induction we know that the nodes of @xmath66 which have both a @xmath251-step predecessor and a @xmath251-step successor satisfy the conditions of @xmath1125 . to prove the claim , let @xmath1155 be elements of @xmath66 which have both an @xmath1156-step predecessor and an @xmath1156-step successor , and    @xmath1157    in order to prove the lemma , we need to prove that @xmath68 is an edge in @xmath66 . since @xmath137 and @xmath62 is a clause in @xmath10 it suffices to prove that there is a homomorphism @xmath1158 such that @xmath1159 and @xmath1160 . then there is an edge @xmath68 in @xmath66 due to proposition  [ prop : homomorphism and horn clauses ] . since @xmath1161 is a homomorphism and @xmath1162 and @xmath1163 it suffices to show that there is a homomorphism @xmath1164 such that @xmath1165 and @xmath1166 . then the homomorphism @xmath1167 satisfies the necessary conditions . let @xmath33 be an @xmath654-step predecessor of @xmath20 in @xmath66 such that @xmath33 has a @xmath251-step predecessor in @xmath85 and let @xmath503 be a @xmath547-step successor of @xmath19 in @xmath66 which has a @xmath251-step successor in @xmath66 . both must exist due to the choice of @xmath1155 . additionally , if @xmath1168 and therefore @xmath1169 is an edge in @xmath85 choose @xmath33 to be an @xmath1170-step predecessor of @xmath19 ( in which case it is also a @xmath654-step predecessor of @xmath20 ) , and in this case also let @xmath503 to be a @xmath1171-step successor of @xmath20 ( in which case it is also a @xmath547-step successor of @xmath19 ) . now , define @xmath1172 and let @xmath1173 from @xmath66 be chosen in such a way that @xmath1174 and @xmath1175 and for all relevant @xmath212 @xmath735 is an edge in @xmath66 . this is possible since @xmath20 and @xmath19 satisfy the conditions corresponding to @xmath1176    * if @xmath1128 we know that @xmath1177 and @xmath864 . hence the nodes @xmath904 can be chosen satisfying the demanded conditions by choosing @xmath1178 to be the nodes on the @xmath654-step - path from @xmath33 to @xmath1179 and @xmath1180 to be the nodes on the @xmath547-step path from @xmath864 to @xmath517 * if @xmath1130 we know that @xmath1181 and we can choose @xmath1178 to be the nodes on the path from @xmath33 to @xmath195 @xmath1182 to denote the @xmath67-step path from @xmath20 to @xmath19 ( which exists due to the choice of @xmath20 and @xmath19 ) , and @xmath1180 be the nodes on the @xmath547-step path from @xmath19 to @xmath517 * if @xmath1131 then by the above we know that @xmath1183 and we know that there is an edge @xmath1169 in @xmath66 . we also know that in this case , @xmath33 is an @xmath1170-step predecessor of @xmath19 . hence we can choose the nodes in the following way : let @xmath1184 be chosen as the nodes on the @xmath1170-step path from @xmath33 to @xmath95 and let @xmath1185 be the nodes on the @xmath1171-step path from @xmath20 to @xmath503 . since @xmath1169 is an edge in @xmath85 this gives the edge @xmath1186 which is required since @xmath1187    we now construct the homomorphism @xmath1188 for each relevant @xmath212 let @xmath1189 . then by construction , @xmath1165 and @xmath1166 . hence it remains to prove that @xmath318 is a homomorphism . since @xmath780 is a _ prev - types - list_-line , let @xmath1190 be a strict line such that @xmath780 is the @xmath1125-closure of @xmath1190 . since @xmath735 is an edge in @xmath66 for all relevant @xmath212 it follows that @xmath1164 is a homomorphism . since every @xmath904 has a @xmath251-step successor and a @xmath251-step predecessor in @xmath85 we know that the subgraph @xmath1191 satisfies the conditions from @xmath1192 and since @xmath780 is the @xmath1193-closure of @xmath1194 this implies that for every edge present in @xmath1150 the images of the corresponding vertices are also connected with an edge in @xmath85 and hence @xmath318 is indeed a homomorphism , finishing the proof of the lemma for the case that @xmath819    now assume that @xmath1195 or @xmath1196 and therefore @xmath795 . since there obviously is a homomorphism @xmath769 for some @xmath1125-tree @xmath776 the clause @xmath62 forces every node in a graph containing a @xmath763-line of sufficient length to be reflexive . since due to the induction hypothesis , we know that every model of @xmath167 of sufficient depth contains arbitrary long @xmath1125-lines , this concludes the proof for the remaining case @xmath1197    due to lemma  [ lemma : horn conjunction algorithm adds correctly to types - list ] , we know that the list @xmath763 maintained by @xmath761  is sensible , and we are now in a position to prove that the @xmath0-cases claimed by the algorithm are correct as well . let @xmath11 be a universal horn formula . if @xmath761  states that @xmath1198 has the polynomial - size model property and @xmath75 is in @xmath0 , then this is true . _ there are two possibilities for the algorithm to claim the polynomial - size model property , and hence @xmath0-membership . first let us assume that for some @xmath715 both @xmath840 and @xmath1107 were added to @xmath763 . in this case , due to lemma  [ lemma : horn conjunction algorithm adds correctly to types - list ] , we know that there is some @xmath1199 such that @xmath11 implies both @xmath1122 and @xmath1117 . hence theorem  [ theorem : transitive and symmetric gives np generalization ] implies both the polynomial - size model property of the logic @xmath84 and the @xmath0-membership of its satisfiability problem .    the second case in which @xmath761  claims the @xmath0-result is if it detects a clause @xmath62 which satisfies one of the conditions @xmath1200 . we know by lemma  [ lemma : horn conjunction algorithm adds correctly to types - list ] , that for each element from @xmath802 the formula @xmath11 implies a formula of the corresponding type . hence we can assume that there is a natural number @xmath1201 such that the set of vertices in @xmath66 which have both a @xmath251-step predecessor and a @xmath251-step successor satisfy the conditions from @xmath763 . we make a case distinction .    * * @xmath62 satisfies @xmath0-condition @xmath1202  * * in this case , we know that @xmath284 for some @xmath772 and that there is a pair @xmath822 such that there is no directed path connecting @xmath774 and @xmath775 in @xmath258 . note that we can assume @xmath837 since otherwise every pair of vertices in @xmath258 would be connected with a directed path . first assume that it is possible to choose @xmath258 and @xmath295 in such a way that @xmath838 . in this case , since @xmath258 is a tree , we know that @xmath774 and @xmath775 have a common predecessor @xmath33 in @xmath258 . let @xmath33 be a common predecessor which is `` minimal , '' i.e. , no node in a lower level than @xmath33 is a common predecessor . we construct a @xmath1203tree @xmath1204 as a homomorphic image of @xmath258 via the homomorphism @xmath318 as follows : let @xmath103 be the height of the tree @xmath776 and let @xmath1205 be a @xmath763-line such that every element in @xmath258 is mapped on its corresponding level in @xmath1150 except the nodes on the path from @xmath33 to @xmath774 ( excluding @xmath33 ) and the successors of @xmath774 . let @xmath808 be the level of @xmath33 in @xmath776 i.e. , let @xmath1206 . let @xmath1207 and @xmath1208 be the levels of @xmath774 and @xmath775 in @xmath776 since there is no directed path connecting @xmath774 and @xmath825 it follows that @xmath1209 . now introduce nodes @xmath1210 such that @xmath1211 is an edge , and @xmath735 is an edge for every relevant @xmath212 and map the path from @xmath33 to @xmath774 and the successors to @xmath774 to the `` branch '' @xmath1210 ( add as many of these nodes as the `` branch '' of @xmath258 requires ) . now close the construction under the @xmath763-condition , and call the tree obtained in this way @xmath1204 . since @xmath1204 is the `` canonical homomorphic image '' of @xmath776 it is again a @xmath786-tree , and in @xmath1212 there is a path of length @xmath67 from @xmath1213 to @xmath1214 and a path of length @xmath928 from @xmath1213 to @xmath1215 . let @xmath1216 be the clause with prerequisite graph @xmath1204 and conclusion edge @xmath317 . since @xmath323 is a homomorphism , we know from proposition  [ prop : homomorphism and horn clause implication ] that @xmath62 implies @xmath1217    intuitively , @xmath1216 is the @xmath763-closure of a clause of the form @xmath1218 with @xmath1219 chosen according to the height of the tree @xmath258 and the length of the branch containing @xmath774 ( without loss of generality , we assume that the branch containing @xmath774 does not contain the deepest node in the tree ) . we now show that @xmath1220 the complexity result then follows from corollary  [ corollary : main np result corollary ] .    hence , let @xmath66 be a graph such that @xmath137 and let @xmath20 and @xmath19 be vertices in @xmath66 such that @xmath20 and @xmath19 have a predecessor @xmath1221 and @xmath461 has a @xmath1222-step predecessor , @xmath20 has a @xmath1223-step successor , and @xmath19 has an @xmath1224-step successor , and there is a @xmath67-step path from @xmath461 to @xmath195 and an @xmath928-step path from @xmath461 to @xmath19 . then , since these vertices satisfy the conditions of @xmath763 by lemma  [ lemma : horn conjunction algorithm adds correctly to types - list ] , we can homomorphically map the prerequisite graph of @xmath1204 into @xmath66 via the homomorphism @xmath1225 such that @xmath1226 @xmath1227 and @xmath1228 . the edges required in order for @xmath1225 to be a homomorphism exist because of the paths of the corresponding lengths connecting @xmath181 @xmath195 and @xmath95 and because all of the relevant nodes in @xmath66 satisfy the @xmath763-conditions . hence , by proposition  [ prop : homomorphism and horn clauses ] , we know that @xmath68 is an edge in @xmath85 as required to show .    therefore , assume that it is not possible to choose @xmath768 in such a way that @xmath824 i.e. , assume that in every @xmath820 @xmath774 and @xmath775 are connected with a directed path or are identical . since @xmath62 satisfies the first @xmath0-condition , we know that there is a pair @xmath822 such that there is no directed path connecting @xmath774 and @xmath775 in @xmath776 and hence @xmath1129 and this node is irreflexive in @xmath258 . in particular , we know that @xmath803 is not an element of @xmath763 . we also know that @xmath1229 since otherwise , every node in the connected graph @xmath258 would be connected to any other with a directed path ( @xmath258 obviously is not the irreflexive singleton , since @xmath838 ) . now define @xmath318 to be @xmath258 s canonical homomorphic mapping to a @xmath763-line @xmath1230 it then follows that @xmath1231 for some @xmath52 . since @xmath26 and @xmath394 are different nodes in @xmath292 we can modify this line as follows : we introduce a new node @xmath904 which is a `` neighbor '' to @xmath827 i.e. , a node which is connected to all predecessors and all successors of @xmath1232    call this line @xmath1233 . note that since @xmath763 only contains variations of transitivity , there is no condition requiring that @xmath305 is a reflexive node . since we connected @xmath904 to all successors and predecessors of @xmath827 the line @xmath1233 still satisfies all conditions from @xmath802 and @xmath305 and @xmath904 are not connected with an edge in @xmath1233 . we now construct a homomorphism @xmath1234 by defining @xmath1235 for all @xmath1236 and @xmath1237 . since the involved nodes are irreflexive and @xmath323 is a homomorphism , and @xmath904 has all edges that @xmath305 has , we know that @xmath1225 is a homomorphism . let @xmath1216 be the universal horn clause with prerequisite graph @xmath1238 and conclusion edge @xmath1239 . the homomorphism @xmath1225 and proposition  [ prop : homomorphism and horn clause implication ] show that @xmath62 implies @xmath1216 . note that the clause @xmath1216 requires the following : for every pair of nodes @xmath1240 in a graph @xmath66 satisfying the conditions of @xmath763 which have a common predecessor @xmath461 and a common successor @xmath1241 with sufficient height and depth , there is an edge connecting @xmath1242 and @xmath1243 . since by lemma  [ lemma : horn conjunction algorithm adds correctly to types - list ] , every graph satisfying @xmath11 also satisfies the requirements from @xmath763 for nodes with sufficient depth and height , we can apply @xmath1216 to nodes of sufficient depth and height in every such graph . l8 cm     let @xmath66 be a graph satisfying @xmath1244 and let @xmath260 be the set of nodes in @xmath66 which have sufficient height and depth to be able to apply the conditions of @xmath1216 . we show that @xmath260 is reflexive , transitive , and symmetric . note that since @xmath66 satisfies @xmath1244 and @xmath62 is a clause in @xmath11 implying @xmath1245 we know that @xmath66 satisfies @xmath1216 as well . we first show that @xmath260 is reflexive . let @xmath19 be a node in @xmath260 . since @xmath19 satisfies the conditions of both @xmath305 and @xmath904 in the line @xmath1238 and since @xmath1246 and @xmath66 satisfies @xmath1245 we know that there is an edge @xmath1247 in @xmath85 and hence @xmath19 is reflexive .    for symmetry , let there be nodes @xmath1248 such that @xmath1249 is an edge in @xmath66 . by the above , we know that both of these nodes are reflexive , and in particular have unbounded height and depth in @xmath66 . therefore , we can map the predecessor graph of @xmath1245 i.e. , the line @xmath1233 to these nodes in such a way that for @xmath1250 @xmath305 is mapped to @xmath1251 @xmath904 is mapped to @xmath1251 and all @xmath1252 for @xmath1253 are mapped to @xmath1254 . since in @xmath1238 all edges go from variables with lower indexes to variables with higher indexes , in this way we have constructed a homomorphism from @xmath1255 to @xmath455 such that the conclusion edge @xmath1239 of @xmath1216 is mapped to the pair @xmath1256 . hence , by proposition  [ prop : homomorphism and horn clauses ] , and since @xmath66 satisfies @xmath1245 we know that there must be an edge @xmath1256 in @xmath455 as required . r8 cm     finally , we show that @xmath260 is transitive . for this , assume that @xmath1257 and @xmath1258 are edges in @xmath260 . since we already proved symmetry for @xmath455 we know that in this case , @xmath1259 and @xmath1260 are also edges . we can again construct a homomorphism mapping all elements of @xmath1233 to @xmath1261 except mapping @xmath305 to @xmath808 and @xmath904 to @xmath20 . since the nodes @xmath1262 and @xmath20 are reflexive in @xmath260 by the above , and there is no edge @xmath1239 or @xmath1263 in @xmath1150 this is a homomorphism . since @xmath66 satisfies @xmath1264 proposition  [ prop : homomorphism and horn clauses ] shows that @xmath1265 is an edge in @xmath455 as claimed .    in particular , since @xmath260 is reflexive , symmetric , and transitive , this means that @xmath1266 . since @xmath260 is defined as the nodes which have some sufficient depth and height @xmath251 in the graph , and @xmath1267 it follows that @xmath1268 for some @xmath1201 and hence @xmath1269 . therefore , @xmath1198 is a logic extending @xmath1270 and therefore the complexity result as well as the polynomial - size model property follow from corollary  [ corollary : main np result corollary ] . * @xmath62 satisfies @xmath0-condition @xmath1271  *    by the prerequisites , since @xmath62 is not satisfied on every @xmath763-tree , we can homomorphically map @xmath294 onto a @xmath763-line . first assume that @xmath283 is empty . then any graph @xmath66 satisfying the conditions of @xmath763 which has a line of more than this length does not satisfy the clause @xmath62 . since every graph satisfying @xmath11 also satisfies @xmath62 and the conditions of @xmath763 for nodes of sufficient depth and height , every graph satisfying @xmath11 of sufficient depth and height does not satisfy @xmath302 and hence not @xmath11 . this implies that graphs satisfying @xmath11 can only be of depth limited by a constant , and hence lemma  [ lemma : few nodes with few predecessors ] immediately implies the polynomial - size model property . therefore assume that @xmath284 for variables @xmath1272 and assume that @xmath817 are not connected with an undirected path in @xmath294 . since @xmath26 and @xmath394 lie in different connected components of the underlying directed graph consisting of @xmath1273 and @xmath294 can be homomorphically mapped into a @xmath763-line , the `` left side '' of the implication @xmath62 is satisfied by any pair of vertices @xmath68 in a graph satisfying the @xmath763-conditions of sufficient depth and height . therefore , the subgraph @xmath260 containing all nodes with sufficient height and depth forms a universal subgraph , and the @xmath0-result follows by the same reasoning as in case @xmath1202    * * @xmath62 satisfies @xmath0-condition @xmath1274  * * in this case , it follows by the same reasoning as in lemma  [ lemma : horn conjunction algorithm adds correctly to types - list ] that any graph satisfying @xmath11 also needs to satisfy the formula @xmath1275 for some @xmath251 and some @xmath719 . hence the complexity result follows from corollary  [ corollary : main np result corollary ] .    * * @xmath62 satisfies @xmath0-condition @xmath1276  * * again , with the proof of lemma  [ lemma : horn conjunction algorithm adds correctly to types - list ] it can easily be seen that @xmath11 implies formulas @xmath1117 and @xmath1122 for some @xmath719 and some natural number @xmath251 . therefore the @xmath0-result follows from theorem  [ theorem : transitive and symmetric gives np generalization ] . @xmath14    the preceding lemmas have established that @xmath761  is well - defined , always comes to a halt , and in each case produces the correct result . hence , we have proven theorem  [ theorem : horn conjunction classification ] . this theorem and its proof now yield an interesting corollary :    [ corollary : horn cunjunction without algorithm ] let @xmath11 be a universal horn formula . if one of the following cases applies :    * @xmath11 is satisfied in every strict tree , * @xmath11 is satisfied in every reflexive tree , * @xmath11 is satisfied in every @xmath72-transitive tree for some @xmath71 * @xmath11 is satisfied in every symmetric tree , * @xmath11 is satisfied in every symmetric and reflexive tree , * @xmath11 is satisfied in every @xmath72-transitive and reflexive tree for some @xmath71    then @xmath75 is @xmath1-hard and @xmath84 does not have the polynomial - size model property . in all other cases , @xmath84 has the polynomial - size model property and @xmath1277    we know by theorem  [ theorem : horn conjunction classification ] that @xmath761  correctly determines the complexity of the problem @xmath75 . by the algorithm , it is obvious that the only arising cases are @xmath1-hard and @xmath0 . from the proof of lemma  [ lemma : horn conjunction algorithm correct on pspace ] , we know that the @xmath1-cases all satisfy the statement of the corollary , and theorem  [ theorem : ladner hardness cases for k - transitivity ] shows that in these cases , we always have @xmath1-hardness . finally note that all of our @xmath0-proofs also give the polynomial - size model property , and all @xmath1-hardness proofs also show that this property does not apply . in section  [ sect : main dichotomy result ] , we have shown that logics defined by universal horn formulas have a satisfiability problem which is solvable in @xmath0 , or is @xmath1-hard . we now show a tree - like model property for these logics , which we will put to use in the next section by concluding @xmath1-membership for a broad class of these logics . recall that corollary  [ corollary : every k - satisfiable formula satisfiable in strict tree ] stated the tree - like model property for the modal logic @xmath1278 every @xmath60-satisfiable formula has a tree - like model which also is a @xmath60-model ( which is easy , since every model is a @xmath60-model ) . what we want to show is that a logic @xmath760 where @xmath11 is a universal horn formula satisfied on every reflexive / symmetric/@xmath72-transitive tree , has the following property : every modal formula which has a @xmath84-model also has a @xmath84-model which is `` nearly '' the reflexive / symmetric/@xmath72-transitive closure of a strict tree . in order to prove this result , we first recall from the literature the concept of a bounded morphism , which allows us to prove modal equivalence of models . let @xmath258 and @xmath27 be modal models , and let @xmath1279 be a function . then @xmath134 is a _ bounded morphism _ if the following holds :    1 .   for all @xmath1280 @xmath33 and @xmath1281 satisfy the same propositional variables , 2 . @xmath134 is a homomorphism , 3 . if @xmath1282 is an edge in @xmath99 then there is some @xmath1142 such that @xmath68 is an edge in @xmath258 and @xmath1283    the most important feature of bounded morphisms is that they leave the modal properties of the involved models invariant :    [ prop : bounded morphism modal invariance ] let @xmath258 and @xmath27 be modal models , and let @xmath1279 be a bounded morphism . then for each modal formula @xmath32 and for each @xmath1280 it holds that @xmath1284 if and only if @xmath1285    with bounded morphisms , we can now prove that our logics have `` tree - like '' models . we first recall a standard result from the literature about the logic @xmath61 :    [ prop : tree like model exists with bounded morphism ] let @xmath34 such that @xmath27 is rooted at @xmath33 . then there exists a tree - like model @xmath258 and a surjective bounded morphism @xmath1286    we now generalize this result to universal horn logics , and `` tree - like '' models . we already know from corollary  [ corollary : horn cunjunction without algorithm ] that for each universal horn formula @xmath11 for which the logic @xmath84 has a satisfiability problem which can not be solved in @xmath0 , the formula @xmath11 is satisfied on every tree which additionally is closed under reflexivity , @xmath72-transitivity and/or symmetry . we now show that a version of the `` converse '' is also true : not only are all of these trees models for the corresponding logics , but for every modal formula satisfiable in such a logic , we can find a model which is `` almost '' such a tree . the reason for the `` almost '' is that our horn formulas usually will not imply a property like @xmath72-transitivity , but only @xmath72-transitivity for nodes at a certain depth in the graph , as shown in lemma  [ lemma : horn conjunction algorithm adds correctly to types - list ] . we will see in sections  [ sect : pspace for non - transitive ] and  [ sect : applications ] , that the characterization of the involved models can be used to obtain @xmath1  upper bounds for a wide class of logics . [ theorem : tree - like models for horn logics ]    1 . let @xmath11 be a universal horn formula such that @xmath761  returns @xmath1-hard on input @xmath11 . let @xmath763 be as determined by @xmath761  on input @xmath11 . since the algorithm determines the logic to be @xmath1-hard , this is well - defined . then for every modal formula @xmath32 which is @xmath84-satisfiable , there exists a @xmath84-model @xmath258 and a world @xmath1287 such that @xmath1284 and there is a strict tree @xmath1288 such that @xmath258 and @xmath1288 have the same set of vertices , and + @xmath1289 + where @xmath1290 denotes the @xmath763-closure of @xmath1291 2 . let @xmath11 be a universal horn formula such that @xmath11 is satisfied on every strict line . then for every modal formula @xmath32 which is @xmath84-satisfiable , there exists a @xmath84-model @xmath258 and a world @xmath1287 such that @xmath1292 and @xmath258 is @xmath33-canonical . we prove both claims with nearly the same construction , indicating when differences are required . since @xmath32 is @xmath84-satisfiable , there is a @xmath84-model @xmath27 and a world @xmath80 such that @xmath34 . for the first claim , let @xmath763 be as determined by @xmath761  when started on input @xmath11 . since the algorithm does not return @xmath1293 we know that @xmath1294 or @xmath1295 . since the second @xmath0-condition does not apply , we know that for any clause @xmath62 in @xmath11 such that there is a homomorphism @xmath769 for some @xmath763-tree @xmath776 that @xmath284 for some variables @xmath817 with @xmath795 or @xmath819    for the second claim , we show that for every clause @xmath62 in @xmath1244 if @xmath62 is not satisfied in every @xmath33-canonical graph , then @xmath1296 . obviously , the prerequisite graph of such a clause @xmath62 can be mapped into some @xmath33-canonical graph , and therefore also into its image @xmath780 as a strict line . since @xmath11 is satisfied on every strict line , so is @xmath302 and hence @xmath1297 since otherwise , the clause would be unsatisfied on @xmath1150 a contradiction .    for both claims , due to proposition  [ prop : rooted models exist ] , we can assume that @xmath27 is rooted at @xmath33 . from proposition  [ prop : tree like model exists with bounded morphism ] , we know that there is a model @xmath1298 which is a strict tree , and a surjective bounded morphism @xmath1299 . let @xmath1300 . let @xmath1301 denote the root of @xmath1298 . the strict tree @xmath1298 is trivially @xmath1301-canonical . we define a sequence of models @xmath1302 such that for each @xmath1081 it holds that when we are proving the first claim :    1 . @xmath1303 2 . @xmath1304 3 . @xmath1305 is a homomorphism .    in the case of the second claim , we exchange the second point with `` @xmath1306 is @xmath1301-canonical . '' note that due to corollary  [ corrollary : universal elementary logics have countable model property ] , we can assume that the model @xmath27 is countable . the proof of proposition  [ prop : tree like model exists with bounded morphism ] from @xcite then constructs a model @xmath1298 which is also countable . hence assume that @xmath1298 is a countable model . now let @xmath1307 be a surjective enumeration of @xmath1308 i.e. , of all possible edges in the involved trees . the construction of our model is as follows : for @xmath1309 the model @xmath1298 from above obviously satisfies the conditions , since every bounded morphism is also a homomorphism . for @xmath1310 we make a case distinction :    * if every clause in @xmath11 is satisfied in @xmath1311 then let @xmath1312 * otherwise , let @xmath1313 be a clause from @xmath11 which is not satisfied in @xmath1306 such that @xmath1314 for variables @xmath1315 and let @xmath1316 be a homomorphism such that @xmath1317 is not an edge in @xmath1306 . this must exist by proposition  [ prop : homomorphism and horn clauses ] , since by the above , the case @xmath1318 can not occur . choose @xmath1319 in such a way that the pair @xmath1317 has a minimal index in the sequence @xmath1320 . now let @xmath1321 be defined with vertex set @xmath1322 edge set @xmath1323 and the same propositional assignments as @xmath1324    we show that the construction satisfies the requirements 1 - 3 . the first point , which is the same for both claims , holds by definition . for the first claim , we prove that for each @xmath1325 it holds that @xmath1326 . since by definition , @xmath1327 we know that for all @xmath1325 it holds that @xmath1328 and we also know that @xmath1329    hence assume that there is some minimal @xmath103 such that @xmath1330 . due to the minimality of @xmath1325 and since the claim holds for @xmath1309 we know that the edge which is not present in @xmath1331 is the edge @xmath1332 . by definition , @xmath1333 is a homomorphism . since due to minimality of @xmath1325 we know that @xmath1334 this implies that @xmath1335 is a homomorphism as well . since @xmath62 is a clause in @xmath10 and @xmath1336 we know that @xmath1337 and with proposition  [ prop : homomorphism and horn clauses ] , we conclude that @xmath1332 is an edge in @xmath1338 a contradiction . therefore we know that @xmath1326 for all @xmath1325 and hence we have proven the second point in the case of the first claim .    for the second claim , we need to show that @xmath1306 is a @xmath1301-canonical graph . for @xmath202 let @xmath1339 denote the nodes in the @xmath52-th level of @xmath1340 i.e. , the set @xmath1341 . in order to prove that @xmath1306 is @xmath1301-canonical , since @xmath1342 is , it suffices to prove that the edge @xmath1332 in the step from @xmath1342 to @xmath1343 does not destroy the property of being canonical , i.e. , we need to show that @xmath1344 and @xmath1345 for some @xmath52 . let @xmath780 be the homomorphical image of @xmath1342 as a strict line via the homomorphism @xmath318 ( since @xmath1342 is @xmath33-canonical , this exists and is unique ) . since @xmath1333 is a homomorphism , we know that @xmath1346 is a homomorphism as well . since @xmath11 is satisfied on every strict line , this is also true for @xmath302 and hence due to proposition  [ prop : homomorphism and horn clauses ] , we know that @xmath1347 is an edge in @xmath780 . therefore , @xmath1348 is exactly one level above @xmath1349 in @xmath1340 as required .    for both claims , we now show that @xmath1305 is a homomorphism for all @xmath103 . again , we prove the fact by induction , and for @xmath1309 this holds due to the choice of @xmath1350 since every bounded morphism is a homomorphism . therefore , let the claim hold for @xmath1325 and let @xmath68 be an edge in @xmath1321 . if @xmath68 is not the edge @xmath1351 then we know that @xmath68 is an edge in @xmath1306 as well , and since due to induction hypothesis , we know that @xmath1305 is a homomorphism , it follows that @xmath1352 is an edge in @xmath27 . therefore assume that @xmath1353 and @xmath1354 . we need to show that @xmath1355 is an edge in @xmath27 . by construction , we know that @xmath1316 is a homomorphism . since by induction hypothesis , we know that @xmath1305 is a homomorphism , it follows that @xmath1356 is a homomorphism as well . since @xmath27 is a @xmath84-model and @xmath1313 is a clause in @xmath10 we know that @xmath27 satisfies @xmath1357 and thus by proposition  [ prop : homomorphism and horn clauses ] , we know that @xmath1355 is an edge in @xmath99 as required . we now construct the desired @xmath84-model as follows : define @xmath1358 as having @xmath1359 and @xmath1360 . we show that @xmath1358 is a @xmath84-model , and that @xmath1361 is a bounded morphism . assume that @xmath1358 is not a @xmath84-model . by construction , we know that in this case , there is no @xmath103 such that @xmath1362 and therefore each @xmath1321 has exactly one additional edge in comparison to @xmath1306 . hence we can define a sequence @xmath1363 such that @xmath1364 iff @xmath1365 . then @xmath1366 is a sequence of pairwise different natural numbers . since @xmath11 is not satisfied in @xmath1367 there is a clause @xmath62 from @xmath11 which is not satisfied in @xmath1358 . for both claims , we therefore know by the above that @xmath284 for variables @xmath817 with @xmath795 or @xmath818 . by proposition  [ prop : homomorphism and horn clauses ] , we know that there is a homomorphism @xmath1368 such that @xmath286 is not an edge in @xmath1358 . let @xmath1369 such that @xmath1370 . since in the sequence @xmath1371 no number is repeated , there is some natural number @xmath1372 such that @xmath1373 for all @xmath1086 . since @xmath294 is a finite graph , and @xmath1327 and @xmath1374 we know that there is some @xmath1375 such that @xmath1376 is a homomorphism . then @xmath1377 is also a homomorphism for all @xmath1378 since every edge present in @xmath1379 is also present in every @xmath1306 for @xmath1380 . let @xmath1381 . then in the step from @xmath1306 to @xmath1382 the edge @xmath1383 was added , and by choice of @xmath103 we know that @xmath1373 . since @xmath1384 is not an edge in @xmath1367 we know that @xmath1384 is also not an edge in @xmath1306 . recall that @xmath1385 are chosen in such a way that the edge @xmath1386 has minimal index in the sequence @xmath1387 this is a contradiction , since the edge @xmath1384 is an edge with a smaller index than @xmath1388 and since @xmath1377 is a homomorphism , @xmath1384 satisfies the conditions of the edge @xmath1386 in the construction of @xmath1389    it remains to show that @xmath1361 is a bounded morphism . property @xmath1390 holds by construction , since we do not change propositional assignments , and @xmath1299 is a bounded morphism . we now show that @xmath134 is a homomorphism . hence let @xmath68 be an edge in @xmath1358 . since @xmath1358 is the union over all @xmath1311 there is some @xmath1391 such that @xmath68 is an edge in @xmath1306 . since by the above , @xmath1305 is a homomorphism , it follows that @xmath1352 is an edge in @xmath99 as claimed . for property @xmath1392 let @xmath1393 and @xmath660 in @xmath27 such that @xmath1282 is an edge in @xmath27 . since @xmath1299 is a bounded morphism , we know that there is some @xmath1394 such that @xmath68 is an edge in @xmath1350 and @xmath1395 . by construction , @xmath68 is also an edge in @xmath1367 and therefore @xmath1361 is a bounded morphism . by choice of @xmath1396 and since @xmath1397 @xmath134 is also surjective . hence there is some @xmath1398 such that @xmath1399 . since @xmath179 it follows from proposition  [ prop : bounded morphism modal invariance ] that @xmath1400 . by construction , for the first claim it holds that @xmath1401 since this holds for the individual @xmath1306 and @xmath1358 is the union over the edges of all @xmath1311 and for the second claim , @xmath1358 is obviously @xmath1301-canonical : assume that it is not , then there is a node @xmath1402 and natural numbers @xmath1403 such that @xmath1404 and @xmath1405 . since only a finite number of edges is relevant for this path , there exists some @xmath103 such that @xmath1406 and @xmath1407 . this is a contradiction , since @xmath1306 is @xmath1301-canonical . note that we can assume that the node @xmath461 is the root of @xmath1367 since due to proposition  [ prop : rooted models exist ] , we can assume that every node in @xmath1358 can be reached from @xmath1408      in the previous section , we showed that for logics defined by universal horn formulas , satisfiable formulas are always satisfiable in a tree - like model . tree - like models are the main argument in many proofs showing @xmath1-membership for satisfiability problems in modal logic . we now show that these models indeed allow us to construct @xmath1  algorithms for a wide class of modal logics . note that while the construction in the proof of the following theorem has similarities to the constructions by ladner in  @xcite or by halpern and moses in  @xcite , the focus of our result is different . many proofs of previous @xmath1-algorithms also gave proofs of a variant of some tree - like model property . our proof relies on this property ( which we already proved for our logics in theorem  [ theorem : tree - like models for horn logics ] ) , and as a consequence , the verification that the algorithm works correctly with respect to the modal aspect of its task is very easy to verify . the main work of the proof is to prove that the algorithm handles the first - order part of the satisfiability problem correctly , i.e. , that the model it constructs is in fact a model satisfying the first - order formula @xmath11 defining the logic . whereas this is easy for standard classes of frames ( checking reflexivity , symmetry , transitivity etc is straightforward ) , in the general case that we cover here this requires most of the work . the main feature of the logics that we use here is that of _ locality _ : the proof makes extensive use of the fact that in order to verify that the first - order clauses are satisfied it is sufficient to consider local parts of the model constructed by the algorithm . this is the main reason why we believe that this proof does not easily generalize to cases where a variant of transitivity is among the conditions implied by the first - order formula @xmath1409    [ theorem : pspace membership for non - trans logics ] let @xmath11 be a universal horn formula such that @xmath761  does not add any element of the form @xmath922 to @xmath786  on input @xmath11 . then @xmath1410    _ proof . _ since @xmath1411 we can assume that @xmath1412 . let @xmath763 be as determined by @xmath761  on input @xmath11 . from the prerequisites , we know that @xmath1294 . from theorem  [ theorem : tree - like models for horn logics ] , we know that for every @xmath84-satisfiable modal formula @xmath83 there is a model @xmath258 of @xmath32 such that @xmath258 is an edge - extension of a strict tree @xmath1288 , and every edge present in @xmath258 which is not an edge of @xmath1288 is a reflexive or a symmetric edge .    by the proof of lemma  [ lemma : few nodes with few predecessors ] , we can assume that in the tree @xmath1413 every node has at most @xmath1414 successors . the strategy of the @xmath1-algorithm is as follows : we nondeterministically guess the model @xmath258 and verify that it is a model of both @xmath32 and of @xmath11 by performing a depth - first - search . it is straightforward to see that in this way , we can verify that the modal formula @xmath32 holds in the model . to also check if @xmath11 is satisfied requires a bit more effort : even though we know that @xmath11 only adds reflexive or symmetric edges in addition to those present in @xmath1413 we need to be careful which edges are required and which are not ( there may very well be formulas which are not satisfiable on a symmetric and reflexive tree , but are @xmath84-satisfiable ) . the main reason why we can perform these tests is that the properties that we work with have a `` local character : '' to check if an edge is required between some nodes @xmath20 and @xmath19 in @xmath776 we need to know whether there is a clause @xmath62 in @xmath11 such that @xmath62 can be homomorphically mapped into @xmath258 in such a way that the conclusion edge is mapped to the pair @xmath68 . since we are working with a tree only extended with reflexive and symmetric edges , we know that a homomorphic image of a connected component of some @xmath294 including @xmath20 and @xmath19 contains only vertices which are `` near '' to both @xmath20 and @xmath19 . therefore we can verify that these clauses are satisfied by procedures looking only locally at the model @xmath258 . there are two main obstacles to this approach : for once , the clause @xmath62 that requires @xmath68 to be an edge might very well contain more than one connected component except that one containing the conclusion edge ( we can ignore the case where there is no conclusion edge , or the vertices from the conclusion edge are unconnected in @xmath292 since if such a clause can be applied , i.e. , homomorphically mapped to @xmath776 then it can also be homomorphically mapped to the @xmath763-closure of @xmath776 and hence to a @xmath763-tree , in which case @xmath761  reports @xmath0-membership , which is a contradiction to our assumption @xmath1412 ) . the other obstacle is that although we only need to look at vertices in the `` neighborhood '' of the current vertex to check that it has all the right edges coming in and out , we need to ensure that all the vertices that we looked at `` locally '' are consistent , when we revisit a part of the model which is close to a node that we already considered . the ways to deal with these obstacles is the following : for the first problem , we simply keep a list of connected components of @xmath294-graphs , and at the beginning of the algorithm , guess for each one if it will appear as a homomorphic image in the tree ( which of course later we need to verify ) . for the second problem , we keep more nodes in storage than just the ones in the neighborhood of the one we are currently visiting , but only a polynomial number .    strictly speaking , the algorithm does not operate on a model , but on an `` annotated model . '' the annotation of a world is the set of subformulas and negated subformulas of the input formula @xmath32 which are true at this world , and are required to be true to ensure that the formula @xmath32 is true at the root - world .    by proposition  [ prop : rooted models exist ] , we can assume that the tree @xmath258 has height of at most @xmath182 . for a node @xmath19 in the @xmath52-th level of @xmath776 let @xmath1415 denote the set of subformulas and negated subformulas of @xmath32 which have a modal depth of at most @xmath1416 . these are exactly those formulas for which we need to know that they hold at @xmath19 in order to verify that the input formula @xmath32 holds at the root of @xmath832    we now describe the decision procedure , which is a nondeterministic @xmath1-algorithm . let @xmath72 be the cardinality of the largest connected component in any of the graphs @xmath294 for clauses @xmath62 of @xmath11 . note that this number only depends on @xmath10 and therefore can be regarded as constant . the algorithm as stated in figure  [ fig : pspace algorithm ] does not work in polynomial space , since it guesses and stores the possibly exponentially - sized model @xmath258 . we will first show that the algorithm as stated is correct and then prove how it can be implemented using only polynomial space , by only storing a currently relevant subset of the model @xmath832    for the description of the algorithm , we will call a node @xmath1142 _ back - symmetric _ if there is an edge @xmath1417 where @xmath20 is the predecessor of @xmath19 in @xmath1288 . when the algorithm guesses the model @xmath776 it additionally guesses the set @xmath1415 for every node @xmath19 in @xmath776 and for each node it guesses if it is back - symmetric and if it is reflexive . the procedure @xmath1418 performs the following check : for a node @xmath19 on the @xmath52-th level of @xmath776 @xmath1419 is required to contain all subformulas and negated subformulas of @xmath32 which have modal depth of at most @xmath1420 and are true at @xmath19 . hence , @xmath1421 must contain exactly one of @xmath1422 or @xmath79 for each relevant @xmath78 and additionally , if @xmath1423 then both @xmath1424 and @xmath1425 need to be members as well . similarly , if @xmath1426 is a member , then at least one of them must be an element of @xmath1427    the procedure @xmath1428 works as follows : if there is a clause @xmath62 in @xmath11 with @xmath1429 for @xmath1195 such that all connected components of @xmath294 can be mapped homomorphically into @xmath776 then @xmath1428 ensures that @xmath19 is reflexive . note that all other horn clauses in @xmath11 satisfy that @xmath284 for some @xmath818 . for these clauses , the procedure considers the subgraph @xmath1430 consisting of all nodes of @xmath258 which can be reached from @xmath19 in at most @xmath72 undirected steps ( note that a node can be reached in at most @xmath72 steps in @xmath258 if and only if it can be reached in at most @xmath72 steps in @xmath1288 ) . for every connected component @xmath260 of @xmath292 @xmath1428 tests all functions @xmath1431 . if one of these @xmath295 is a homomorphism , then @xmath1428 rejects , if the algorithm guessed in the beginning that @xmath260 can not be mapped homomorphically into @xmath258 . if there is one clause @xmath62 in @xmath11 such that all connected components of @xmath294 can be mapped into @xmath258 ( according to the list of these possibilities maintained by the algorithm ) and @xmath1428 detected a homomorphism @xmath1432 ( where @xmath1433 is the connected component of @xmath294 containing the nodes from the conclusion edge of @xmath62 ) for some @xmath62 with @xmath284 such that @xmath1434 then @xmath1428 rejects if @xmath286 is not an edge in @xmath1435    we prove that the algorithm is correct . first note that for each connected component @xmath260 of some @xmath294 for a clause @xmath62 in @xmath10 if there is a homomorphism @xmath1436 then there is a node @xmath1142 such that @xmath1431 is a homomorphism . this holds because all edges in @xmath258 are already present in the strict tree @xmath1288 or are symmetric or reflexive edges , and the homomorphic image of @xmath260 under the homomorphism @xmath295 is a connected component of @xmath776 and the maximal distance of the nodes in this image is @xmath72 ( recall that this is the maximal cardinality of a connected component in any @xmath294 ) . therefore , we can assume that for each connected component @xmath260 of some @xmath292 if it can be homomorphically mapped into @xmath776 then @xmath1437  guessed this correctly in the beginning in every accepting run of the algorithm ( an incorrect guess would , due to the observation just made , be detected by @xmath1428 for some node @xmath19 ) . now assume that the algorithm accepts . we claim that the model obtained from the annotated model guessed by the algorithm where a variable @xmath26 is true at a world @xmath19 if and only if @xmath1438 is a model of both the modal formula @xmath32 ( at the root - world @xmath33 ) and of the horn formula @xmath11 . by the checks the algorithm performs , it can easily be verified by induction on the level of the nodes ( corresponding to the modal depth of the involved formulas ) that for every world @xmath19 in @xmath776 every formula in @xmath1415 is satisfied at @xmath19 . since @xmath1439 this implies that @xmath1284 . the base case for the induction is clear , since for worlds @xmath19 in the level @xmath144 @xmath1415 only contains literals , and the algorithm ensures that @xmath1415 is propositionally consistent . since for each subformula @xmath79 of @xmath32 of relevant modal depth , @xmath1415 contains exactly one of @xmath79 and @xmath1440 the induction hypothesis can be applied in the relevant cases . note that the algorithm also checks consistency for the cases in which we have reflexive and/or symmetric edges . it remains to show that @xmath258 is also a model of the first - order formula @xmath11 . assume that this is not the case . then there exists some clause @xmath62 in @xmath11 which is not satisfied in @xmath258 . in particular , this implies that @xmath294 can be homomorphically mapped into @xmath776 and since @xmath1441 this implies that @xmath294 can be homomorphically mapped into a @xmath786-tree . since we assumed that @xmath1442 does not return @xmath436 on input @xmath10 we know that none of the @xmath0-conditions from @xmath761  are satisfied . since none of the @xmath0-conditions from @xmath761  occur , we know that @xmath62 has conclusion edge @xmath284 for variables @xmath817 where @xmath795 or @xmath818 . first assume that @xmath795 . since @xmath294 can be mapped homomorphically into @xmath776 the procedure @xmath1443 required every node in @xmath258 to be reflexive , hence @xmath62 is satisfied in @xmath258 . not assume that @xmath818 . since none of the @xmath0-conditions apply , we know that @xmath26 and @xmath394 are connected with an undirected path in @xmath294 . in particular , they lie in the same connected component @xmath1433 of @xmath294 . since @xmath62 is not satisfied in @xmath776 this implies by proposition  [ prop : homomorphism and horn clauses ] that there are nodes @xmath1444 such that @xmath68 is not an edge in @xmath776 there is no edge @xmath68 in @xmath776 and there is a homomorphism @xmath769 such that @xmath1445 and @xmath1446 . due to the above , we know that @xmath1432 is a homomorphism . therefore , the homomorphism @xmath295 was found by @xmath1447 and @xmath1428 . since @xmath294 can be homomorphically mapped into @xmath776 we know that every connected component @xmath260 of @xmath294 can be homomorphically mapped into @xmath776 and due to the above , we know that the @xmath1437  guessed this correctly in an accepting run of the algorithm . therefore , the procedure @xmath1443 ensured that @xmath68 is an edge in @xmath776 a contradiction . now assume that @xmath32 is @xmath84-satisfiable . due to the remarks at the beginning of the proof , we know that in this case , there exists a @xmath84-model @xmath258 such that @xmath258 is an edge - extension of a strict tree , and @xmath1448 . therefore the algorithm can guess this model and verify that it satisfies both @xmath32 and @xmath1409    it remains to prove that the algorithm can be implemented in nondeterministic polynomial space . the result then follows , since due to a classic result by savitch  @xcite , @xmath1449 . in order to implement the algorithm using only polynomial space , the main change needed compared to the version stated in figure  [ fig : pspace algorithm ] is how much of the guessed model @xmath258 is stored in memory at a given time . the @xmath1450-implementation does not guess the entire model @xmath258 at the start of the algorithm , but guesses each node the moment it is first accessed ( either by being created explicitly , or by being explored as an @xmath72-step neighbor of another node by the procedure @xmath1443 ) . it removes the node from memory at a time when it will not be accessed anymore in the remaining execution of the algorithm . to be precise , the algorithm at all times keeps in its memory the node @xmath1451 and all of its predecessors , and all nodes which can be reached from these in at most @xmath72 steps in the tree @xmath1288 . since in @xmath776 every node has at most @xmath1414 successors in the next level , and @xmath72 is a constant , this is a polynomial number of nodes . we now need to prove that no necessary information is removed from memory , i.e. , that no node is first created , then deleted and then accessed again . note that from the construction of the algorithm , it is obvious that new nodes are visited in a depth - first order .    therefore assume that this happens for some node @xmath1452 . note that any node which gets deleted from memory is not reachable from the root world @xmath33 in at most @xmath72 steps , and therefore @xmath1452 is at some level @xmath1453 in the tree @xmath1454 . let @xmath1455 be the node for which @xmath1452 was visited for the first time , i.e. , the first node visited such that @xmath1456 ( recall that @xmath1457 is the set of nodes which can be reached from @xmath1455 in at most @xmath72 undirected steps in @xmath258 ) . since @xmath1452 is deleted from memory and required again later , there is some node @xmath1254 such that @xmath1452 can not be reached from any predecessor of @xmath1254 in at most @xmath72 steps , and a node @xmath1458 such that @xmath1452 can be reached from @xmath1458 in at most @xmath72 steps . let @xmath654 be the ( uniquely determined ) common predecessor of @xmath1452 and @xmath1254 with a maximal level in the tree . then , since @xmath654 is a predecessor of @xmath1459 we know that @xmath1460 . hence , @xmath1452 is at least @xmath72 levels below @xmath654 . since @xmath1288 is a tree , any node @xmath503 such that @xmath1461 must therefore be a successor of @xmath654 . in particular , @xmath1458 is a successor of @xmath654 . this is a contradiction , because @xmath1437  traverses the tree in depth - first - search , and hence does not leave the sub - tree with root @xmath654 and re - enters it later . therefore we have shown that it is sufficient to keep a polynomial number of nodes in storage , and which nodes to keep can be decided by an easy pattern . hence it follows that the algorithm can indeed by implemented in nondeterministic polynomial space as required , concluding the proof . @xmath14      theorem  [ theorem : horn conjunction classification ] and [ theorem : pspace membership for non - trans logics ] can be used to classify the complexity of a lot of concrete logics , but they also imply more general results , for which we will give two examples . for once , recall that ladner proved that all normal modal logics @xmath180  such that @xmath64 ( the logic over all transitive and reflexive frames ) is an extension of @xmath180  give rise to a @xmath1-hard satisfiability problem . the following corollary shows that this result is optimal in the sense that every universal horn logic which is a `` proper extension '' of @xmath1462  in the way that they imply the conditions of @xmath1462 , already gives an @xmath0-solvable satisfiability problem . [ corollary : ladner hardness result optimal ] let @xmath11 be a universal horn formula such that @xmath11 implies @xmath1463 . then either @xmath1464 or @xmath84 has the polynomial - size model property and @xmath1277    by the prerequisites , we know that @xmath11 is equivalent to @xmath1465 . hence we can , without loss of generality , assume that @xmath1466 and @xmath1467 appear as clauses in @xmath1409    if every clause in @xmath11 is satisfied in every transitive and reflexive tree , then every modal formula @xmath32 which is satisfiable in a transitive and reflexive tree is @xmath84-satisfiable . note that a special case of theorem  [ theorem : tree - like models for horn logics ] gives the result that every @xmath64-satisfiable formula also is satisfiable in a reflexive and transitive tree . therefore , every @xmath64-satisfiable formula is also @xmath84-satisfiable , and hence , every @xmath84-validity is also @xmath64-valid . therefore , @xmath64 is an extension of @xmath84 . since by proposition  [ proposition : extensions of elementary logics and first - order implication ] , @xmath84 is an extension of @xmath1468 this implies that @xmath1469    therefore , we can assume that @xmath11 is not satisfied in every reflexive and transitive tree . now let @xmath763 be as determined by @xmath761  on input @xmath11 . since @xmath1466 and @xmath1467 are clauses in @xmath10 we know that @xmath1102 and @xmath1470 are elements of @xmath763 . if all elements in @xmath763 are of the form @xmath1102 or @xmath1471 then we know ( since @xmath67-transitivity is implied by @xmath69-transitivity ) , since @xmath11 is satisfied on every @xmath786-tree , that @xmath11 is satisfied in every reflexive and transitive tree , a contradiction . therefore , we now that @xmath1472 and hence by construction , @xmath761  reports @xmath0-membership . since by theorem  [ theorem : horn conjunction classification ] the output of the algorithm is correct , we know that @xmath1473 and @xmath84 has the polynomial - size model property , as claimed . we further can show a @xmath1  upper bound for all universal horn logics which are extensions of the logic @xmath1474 , and hence , from theorem  [ theorem : horn conjunction classification ] , conclude that these are all either solvable in @xmath0  ( and thus @xmath0-complete if they are consistent ) , or @xmath1-complete . [ corollary : above reflexive gives pspace ] let @xmath11 be a universal horn formula such that @xmath11 implies @xmath1466 . then @xmath1410    assume without loss of generality that @xmath761  determines the logic @xmath84 to have a @xmath1-hard satisfiability problem , otherwise the theorem holds trivially , since @xmath1411 . if @xmath11 implies @xmath1475 then the result follows from corollary  [ corollary : ladner hardness result optimal ] . hence assume that this is not the case . note that in reflexive graphs , @xmath67-transitivity is equivalent to transitivity . also note that the conditions requiring a node to have a certain depth or height in a graph are always satisfied in a reflexive graph , because nodes here have infinite depth and height . therefore , if @xmath11 implies a formula of the form @xmath1476 for some @xmath1477 and some @xmath1478 then @xmath11 also implies @xmath1479 and due to the above , we can assume that this is not the case . thus , @xmath763 as determined by @xmath761  contains no condition of the form @xmath922 for any @xmath70 . the complexity result now follows from theorem  [ theorem : pspace membership for non - trans logics ] .    in a similar way , we can prove that all universal horn logics which imply a variant of symmetry give rise to a satisfiability problem in @xmath1 . a noteworthy difference in the prerequisites of corollary  [ corollary : above reflexive gives pspace ] and corollary  [ corollary : pspace for extensions of symm ] is that the former requires the reflexivity condition to be implied by the formula @xmath1244 while the latter only needs a `` near - symmetry''-condition as detected by @xmath761 . [ corollary : pspace for extensions of symm ] let @xmath11 be a universal horn formula such that @xmath1442 adds @xmath1480 to @xmath763 on input @xmath11 . then @xmath1481 . in particular , any universal horn logic which is an extension of @xmath1482 has a satisfiability problem solvable in @xmath1 .    if @xmath1473 the claim trivially holds . hence , since @xmath1442 is correct due to theorem  [ theorem : horn conjunction classification ] , we can assume that @xmath1442 returns @xmath1-hard , and @xmath1472 where @xmath763 is as determined by @xmath761 . since @xmath761  does not report @xmath0 , we know from its construction that @xmath1483 for all @xmath1484 . hence the complexity result follows from theorem  [ theorem : pspace membership for non - trans logics ] . we analyzed the complexity of modal logics defined by universal horn formulas , covering many well - known logics . we showed that the non - trivial satisfiability problems for these logics are either @xmath0-complete or @xmath1-hard , and gave an easy criterion to recognize these cases . our results directly imply that ( unless @xmath1485 ) such a logic has a satisfiability problem in @xmath0  if and only if it has the polynomial - size model property . we also demonstrated that a wide class of the considered logics has a satisfiability problem solvable in @xmath1 . open questions include determining complexity upper bounds for the satisfiability problems for all modal logics defined by universal horn formulas . we strongly conjecture that all of these are decidable , and consider it possible that all of these problems are in @xmath1 . a successful way to establish upper complexity bounds is the guarded fragment  @xcite . this does not seem to be applicable to our logics , since it can not be used for transitive logics , and we obtain @xmath1-upper bounds for all of our logics except those involving a variant of transitivity . the next major open challenges are generalizing our results to formulas not in the horn class , and allowing arbitrary quantification . initial results show that even when considering only universal formulas over the frame language , undecidable logics appear . an interesting enrichment of horn clauses is to allow the equality relation . preliminary results indicate that corollary  [ corollary : horn cunjunction without algorithm ] holds for this more general case as well .
Abstract:

Answer: modal logics are widely used in computer science . the complexity of modal satisfiability problems has been investigated since the 1970s , usually proving results on a case - by - case basis . we prove a very general classification for a wide class of relevant logics : many important subclasses of modal logics can be obtained by restricting the allowed models with first - order horn formulas . we show that the satisfiability problem for each of these logics is either @xmath0-complete or @xmath1-hard , and exhibit a simple classification criterion . further , we prove matching @xmath1  upper bounds for many of the @xmath1-hard logics .