Implementing Restart Model Elimination and Theory Model Elimination on top of SETHEO
- 格式:pdf
- 大小:192.08 KB
- 文档页数:24
implementation realization 编程-回复编程是一门创造性的艺术,也是现代社会不可或缺的技能之一。
在实际的编程过程中,有很多重要的步骤和技巧需要遵循和掌握。
本文将以“implementation realization 编程”为主题,一步一步回答与之相关的问题。
首先,我们来解释一下“implementation realization 编程”这个术语。
在编程中,实现(Implementation)是指根据设计的要求,将程序代码编写成可执行的程序。
而实现的实现(Realization)是将程序代码在计算机上运行并实现其预定的功能。
因此,“implementation realization 编程”就是指编写和运行代码的过程。
第一步,当我们开始编写代码时,首先需要明确自己的目标和需求。
我们必须清楚地知道我们想要实现什么功能,并且对于这个功能的具体要求和限制也要有清楚的了解。
这些目标和需求将为后续的编程过程提供指导。
第二步,为了更好地编写代码,我们需要选择一个合适的编程语言。
编程语言有很多种类,每种语言都有自己的特点和适用场景。
选择一个合适的编程语言对于实现我们的目标非常重要。
同时,我们还需要熟悉所选择的编程语言的语法和规则。
第三步,我们需要进行程序的设计。
程序设计是实现的基础,它为后续的编码提供了框架和结构。
在设计程序时,我们需要确定程序的模块和功能,并建立它们之间的关系和依赖关系。
一个好的程序设计能够提高代码的可读性和可维护性。
第四步,我们需要开始编写代码。
在编写代码时,我们可以根据程序的设计和需求,逐步地实现每个功能模块。
同时,我们需要遵循良好的编程实践,如使用有意义的变量名、合理地进行代码缩进、进行注释等,以提高代码的可读性和维护性。
第五步,编写完代码后,我们需要进行代码的测试和调试。
测试是确保代码正确性的重要环节。
我们可以通过编写测试用例,并对代码进行单元测试和集成测试,来验证代码的功能和正确性。
implementation在计算机程序中的意思在计算机程序中,implementation(实现)是一个重要的概念。
它指的是将软件系统的设计转化为可执行的代码的过程,也即将程序设计的想法转化为计算机能够理解和运行的指令集合。
在本文中,我们将探讨implementation在计算机程序中的意义以及其在软件开发过程中的重要性。
一、实现的概念及作用实现是指将软件系统的设计转化为计算机程序的过程。
在软件开发中,实现是软件生命周期的重要环节之一。
它是软件开发过程中的一个具体步骤,通过该步骤可以将软件设计的抽象思想转化为可以被计算机执行的实体。
实现的主要作用是实际完成软件系统的设计,并将其转化为计算机可以执行的代码。
通过实现,程序员可以将软件需求和设计的想法付诸实践,使其成为具体可行的计算机程序。
实现的过程中,程序员需要根据设计文档和需求说明书,编写相应的代码,并进行测试和调试,确保程序的正确性和性能。
二、实现的步骤在实现一个计算机程序时,一般会按照以下步骤进行:1. 编写代码:根据软件设计的要求和需求进行代码编写。
在编写代码时,程序员需要使用合适的编程语言,并按照设计的要求实现相应的功能模块。
2. 调试与测试:在编写代码后,程序员需要对代码进行调试和测试。
通过测试,可以发现潜在的错误和不足之处,并修改或完善代码。
3. 代码优化:在确保程序的功能正确性后,程序员还可以对代码进行优化。
优化的目标是提高程序的性能和效率,减少内存占用和运行时间。
4. 文档编写:实现完成后,程序员需要编写相应的文档,包括程序的使用手册、编程说明等。
这些文档有助于其他程序员了解和使用该程序。
5. 部署与发布:最后,实现完成的程序可以进行部署和发布。
部署是指将程序安装到计算机系统中,使用户可以使用;发布是指将程序提供给用户下载或使用。
三、实现的重要性实现是软件开发过程中至关重要的一环。
以下是实现的几个重要方面:1. 将设计转化为现实:实现将软件设计的抽象思想变为计算机可以执行的代码,使设计变得具体可行。
执行python manage.py makemigrations命令的问题_光环大数据Python培训
在修改了models.py后,有些用户会喜欢用pythonmanage.pymakemigrations生成对应的py代码。
但有时执行pythonmanage.pymakemigrations命令(也可能人比较皮,把migrations文件夹给删了),会提示"Nochangesdetected."可能有用的解决方式如下:
先pythonmanage.pymakemigrations--emptyyourappname生成一个空的initial.py
再pythonmanage.pymakemigrations生成原先的model对应的migrationfile
Python培训、Python培训班、Python培训机构,就选光环大数据!
为什么大家选择光环大数据!
大数据培训、人工智能培训、Python培训、大数据培训机构、大数据培训班、数据分析培训、大数据可视化培训,就选光环大数据!光环大数据,聘请专业的大数据领域知名讲师,确保教学的整体质量与教学水准。
讲师团及时掌握时代潮流技术,将前沿技能融入教学中,确保学生所学知识顺应时代所需。
通过深入浅出、通俗易懂的教学方式,指导学生更快的掌握技能知识,成就上万个高薪就业
学子。
【报名方式、详情咨询】
光环大数据官方网站报名:/ 手机报名链接:http:// /mobile/。
abaqus job=*.inp interactiveINP文件中的有些关键词是ABAQUS/CAE所不支持的,导入INP文件时会在窗口底部的信息区中看到警告信息:WARNING: The following keywords/parameters are not yet supported by the input file reader这时导入ABAQUS/CAE的模型是不完整的,所以分析时出错。
如果在ABAQUS Command窗口中输入以下命令来提交分析,就没有这种问题:abaqus job=INP文件的名称我的文件名为:2D.inp在temp目录里(默认目录)我输入:abaqus job=inp2d.inp 按回车后出现如下SyntaxError: invalid syntax 语法错误按如下输入及结果:>>> abaqus job=inp c:\temp\2D.inp SyntaxError: invalid syntax 我不知道如何处理了,能再帮我讲一下吗?谢谢了请教一下如何处理abaqus-help里inp文件不是在ABAQUS/CAE底部的>>> 后面输入,而是:在WINDOWS中点击[开始] →[程序] →[ABAQUS 6.5-1] →[ABAQUS Command],然后在DOS窗口中输入:abaqus job=2Dinteractive:This option will cause the job to run interactively.For ABAQUS/Standard the log file will be output to the screen;for ABAQUS/Explicit the status file and the log file will be output to the screen.*模型的重启动分析-restart按理说restart不应该算是一个分析的技巧,而是一个常识,不过呢可能有很多朋友没有建过大型模型导致restart也用的较少,所以也介绍下1.什么是restart你的job可能包含多个step,可是如果你的模型很大,可能会有这样一种情况,当你花了几天几夜,终于分析好的时候,你发现the first step的边界条件设置的有问题,这对于你真是晴天霹雳,于是你只好重新来过,可是低二天你发现你的电脑restart,这时的你可能只能问上帝了,how can i do? *restart,就是将一个复杂的模型分析过程分成很多的阶段,甚至是一个increatment step 一个阶段,你可以对每个阶段的结果进行检验,然后进入下一个阶段进行分析。
模块的依赖管理和解决方案在现代软件开发中,模块化编程已成为一种普遍的实践方法。
通过将复杂的系统拆分为独立的模块,开发人员能够更加高效地组织和维护代码。
然而,随着项目规模的增长和模块数量的增加,模块之间的依赖关系管理变得越来越复杂。
为了解决这个问题,我们需要一种有效的模块依赖管理和解决方案。
模块的依赖管理是指在一个项目中,不同的模块之间可能存在的相互依赖关系。
这些依赖关系可以是模块之间的函数调用、数据传递或者其他形式的交互。
在编程过程中,我们需要确保这些依赖关系能够正确地被满足,以保证整个系统的正常运行。
一种常见的模块依赖管理和解决方案是使用软件包管理器。
软件包管理器是一种工具,用于自动化地下载、安装和管理项目所需的依赖包。
通过使用软件包管理器,开发人员可以方便地将项目依赖的模块添加到项目中,并且可以自动解决模块之间的依赖关系。
在现代编程语言中,许多语言都提供了自己的软件包管理器。
例如,Python语言中的pip、JavaScript语言中的npm、Ruby语言中的gem等。
这些软件包管理器都提供了一个中央仓库,开发人员可以从中搜索、下载和安装所需的模块。
使用软件包管理器,我们可以通过简单的命令来管理项目的依赖关系。
例如,在Python中,可以使用pip install命令来安装一个模块,pip uninstall命令来卸载一个模块。
同时,软件包管理器还会自动解析模块之间的依赖关系,确保所有的依赖都能正确地被满足。
除了使用软件包管理器,还有其他一些解决方案可以用于模块的依赖管理。
例如,使用虚拟环境可以帮助我们隔离不同项目的依赖关系,避免冲突和混乱。
虚拟环境是一种独立于系统环境的隔离环境,可以在其中安装和管理项目所需的依赖包。
通过使用虚拟环境,我们可以为每个项目创建一个独立的环境,确保项目之间的依赖关系不会相互干扰。
此外,还有一些工具可以帮助我们更好地管理模块的依赖关系。
例如,依赖关系可视化工具可以帮助我们了解项目中的依赖关系,并帮助我们识别潜在的问题。
布尔运算1 设置:布尔运算有多种形式,在布尔运算前可进行相关设置,方法如下:命令:BOPTNGUI:main menu / preprocessor / modeling / operate / Booleans / settingKeep input entities :用于控制是否保留原始图形。
If operation has no effect 下拉列表是控制布尔运算异常时,弹出的消息对话框。
Numbering compatible with 下拉列表框是控制用何种版本的ansys程序对布尔操作产生的图形进行编号。
Point coincidence toler 一栏用于设置容差。
两点之间的距离小于这个容差,就被认为是同一点。
2 Intersect (交运算)交运算的结果是由每个初始图形的共同部分形成一个新的图形。
也就是说,交表示多个图形的重复区域注意:这个新区域可能与原始图形有相同的维数,也可能低于原始图形的维数。
例如,两条线的交可能是一个关键点,也可能是一条线。
2.1 一般的交运算Main menu / preprocessor / modeling / Booleans / intersect / commonA)线与线的交 / linesB)面与面的交 / areasC)体与体的交 / volumes2.2 两两相交两两相交是由图形集叠加而形成的一个新的图像集,即两两相交表示至少任意两个原图形的相交区域。
Main menu / preprocessor / modeling / Booleans / intersect / pairwise /A)线的两两相交 / linesB)面的两两相交 / areasC)体的两两相交 / volumes2.3 特殊交运算A)线与面相交Main menu / preprocessor / modeling / operate / Booleans / intersect / line with areaB)面与体相交Main menu / preprocessor / modeling / operate / Booleans / intersect / area with volumeC)线与体相交Main menu / preprocessor / modeling / operate / Booleans / intersect / line with volume3 Add(加运算)加运算的结果是得到一个包含个原始图形所有部分的新图形。
VCS常⽤命令说明VCS常⽤命令说明1、VCS仿真环境:2、VCS常⽤编译命令:vcs source_files [source_or_object_files] optionseg: vcs top.v toil.v -RI +v2ksource_filesThe Verilog, OpenVera assertions, or OpenVera testbench source files for your design separated by spaces.source_or_object_filesOptional C files (.c), object files (.o), or archived libraries (.a). These are DirectC or PLI applications that you want VCS to link into the binary executable file along with the object files from your Verilog source files.OptionsCompile-time options that control how VCS compiles your Verilog source files. Details of Options:+incdir+directory: Specifies the directory or directories that VCS searches for include files used in the `include compiler directive. More than one directory may be specified, separated by +.-I: Compiles for interactive use.-line: Enables source-level debugging tasks such as stepping through the code, displaying the order in which VCS executed lines in your code, and the last statement executed before simulation stopped. Typically you enter this option with a +cli option,for example: vcs +cli+1 -line-l filename:Specifies a file where VCS records compilation messages. If you also enter the -R or -RI option, VCS records messages from both compilation and simulation in the same file.-P pli.tab: Compiles a user-defined PLI definition table file.-PP: Compiles a VCD file for interactive debugging while minimizing the amount of net data for fast post-processing.+v2k: Enables new language features in the proposed IEEE 1364-2001 standard. See “Implemented IEEE Std 1364-2001 Language Constructs” on page 2-23.-v filename:Specifies a Verilog library file. VCS looks in this file for module and UDP definitions for the module and UDP instances that VCS found in your source code when it did not find the corresponding module or UDP definitions in your source code.+define+macro:Defines a text macro in your source code to a value or character string. You can test for this definition in your Verilog source code using the …ifdef compiler directive.-f filename: Specifies a filename that contains a list of absolute pathnames for Verilog source files and compile-time options. +vc: Enables extern declarations of C/C++ functions and calling these functions in your source code.-vera: Specifies the standard VERA PLI table file and object library.-comp64: option to compile a design on a 64-bit machine;3、VCS运⾏命令1、Running:$ simv2、Save and Restart ExampleA simple example of save and restart is given below to demonstrate the basic functionality.The $save call does not execute a save immediately, but schedules the checkpoint save at the end of the current simulation time just before events scheduled with #0 are processed. Therefore, events delayed with #0 are the first to be processed upon restart. Example:test.v:module simple_restart;initial begin#10$display("one");$save("test.chk");$display("two");#0 // make the following occur at restart$display("three");$display("four");endendmoduleNow to compile the example Source file:vcs -Mupdate test.vNow run the simulation:simvrestart the simulation from the state saved in the check file,enter:test.chkVCS displays the following:Restart of a saved simulationthreefour4、System Task to Generate VCD/VCD+ FileVCD+ system tasks are used to capture and save value change data in a binary format so that the data can be viewed in the Waveform Window, Register Window, Source Window, and Logic Browser.$vcdpluson : begins recording signal value changes of the specified scope(s) or signals to the VCD+ history file. Syntax:$vcdpluson (level,scope*,signal*);$vcdplusoff :s tops recording the signal value changes for specified scope(s) or signal(s).Syntax:$vcdplusoff (level,scope*,signal*);$vcdplusfile: S pecifies a VCD+ file name. If not specified, VCD.vpd is default for VHDL and vcdplus.vpd is default for Verilog.Syntax:$vcdplusfile ("filename");$vcdplusclose: Terminates all tracing, flushes data to file, closes the current VCD+ file, and resets all default settings. $vcdplusclose;5. 参考⽂件:1. VCS?/VCSi?User Guide Version X-2005.06 August 20052. VirSim User Guide Version 4.43、IEEE Standard Hardware Description Language Based on the Verilog Hardware Description Language IEEE Std 1364-1995。
iosimplementing deprecated method -回复如何在iOS中实现废弃方法(Implementing Deprecated Method in iOS)引言:在iOS应用程序开发过程中,我们经常会遇到使用废弃方法的情况。
尽管这些方法已经被新的版本所取代,但有时我们仍然需要使用它们,特别是在维护旧版本的应用程序时。
本文将介绍如何在iOS中实现废弃方法,并提供一步一步的指导。
第一步:了解废弃方法在开始实现废弃方法之前,我们需要先了解废弃方法的含义和替代方案。
废弃方法是指由于某些原因不再被推荐使用的方法。
这些原因可能包括性能问题、安全风险或者更好的替代方法的存在。
在苹果的开发者文档中,会明确标注哪些方法已经被废弃,并给出了替代方案。
我们应该始终遵循苹果的建议,尽量避免使用废弃方法,因为它们可能在未来的版本中完全被移除。
第二步:检查应用程序中的废弃方法使用在开始实现废弃方法之前,我们应该先检查应用程序的代码,找出是否有使用废弃方法的地方。
可以使用Xcode的搜索功能,或者通过静态代码分析工具来找出废弃方法的使用情况。
通过在Xcode中搜索废弃方法的调用,我们可以找到所有使用该方法的地方,并进行相应的替换或修改。
这一步是非常重要的,因为我们要确保代码的兼容性和易于维护。
第三步:找到替代方案一旦我们确定了应用程序中的废弃方法使用情况,我们需要找到合适的替代方案。
苹果的文档通常会给出推荐的替代方法,我们可以根据文档的说明来选择适合的替代方案。
替代方案可能是一个新的方法或者一个新的API,我们需要仔细阅读文档,并理解新方法的使用和功能。
第四步:修改代码一旦我们找到了替代方案,我们可以开始修改代码,以实现废弃方法的替换。
首先,我们需要找到应用程序中使用废弃方法的地方,并将其替换为新的方法。
这可能需要修改调用方法的参数或者调整其它相关的代码。
其次,我们还需要处理废弃方法的返回值或者错误处理,确保新的方法能够正确处理废弃方法的功能。
Implementing Restart Model Elimination and Theory Model Elimination on top of SETHEOPeter BaumgartnerUniversity of KoblenzRheinau156075KoblenzGermanypeter@informatik.uni-koblenz.deJohann SchumannInstitut f¨u r InformatikTechnische Universit¨a t M¨u nchenGermany80290M¨u nchenschumann@informatik.tu-muenchen.de AbstractThis paper presents an implementation for the efficient execution of Theory Model Elimination(TME),TME by Linearizing Completion,and Restart Model Elimination(RME)on top of the automated theorem prover SETHEO.These calculi allow for theoryreasoning using a Model Elimination based theorem prover.They are described indetail and their major properties are shown.Then,a detailed description how TME byLinearizing Completion and RME can be implemented on top of SETHEO’s AbstractMachine(S A M)is given.Due to theflexibility of the Abstract Machine and its inputlanguage LOP,only simple transformations of the input formula are sufficient to obtainan efficient implementation.Only for RME,one machine-instruction of the S A M had tobe modified slightly.We present results of experiments comparing plain SETHEO withan implementation of TME with PTTP(PROTEIN)and the SETHEO implementationpresented here.1IntroductionThe model elimination calculus(ME calculus)has been developed already in the early days of automated theorem proving[Loveland,1968].It is a goal-oriented,linear and refutationally complete calculus forfirst order clause logic.Model elimination is the base of numerous proof procedures forfirst order deduction.There are high speed theorem provers,like METEOR ([Astrachan and Stickel,1992]or SETHEO([Letz et al.,1992,Letz et al.,1994])and there is a whole class of provers,namely Prolog technology theorem proving(PTTP)as introduced in [Stickel,1988,Stickel,1989],which rely on model elimination.This paper deals with several variants of model elimination with an emphasis on the implementational issue.These variants are called restart model elimination[Baumgartner1and Furbach,1994a]and theory model elimination[Baumgartner,1992,Baumgartner,1994]. They will be reviewed in the respective sections below.For a more detailed description the reader is referred to the cited literature.In brief,restart model elimination is a variant which was motivated by taking a logic programming view at theorem proving.In logic programming one typically reads a clause operationally as a“contrapositive”which means,roughly,“in order to prove it suffices to prove and”.However,in (ordinary)model elimination in the presence of non-definite clauses(i.e.,clauses with more than one positive literal)this natural reading has to be given up.For completeness reasons it is required to add the contrapositivesIn other words,the“body”literals and have to be considered as entry points for the proof search,too.Why should we bother with these contrapositives?Suppose,for example we are given an input clause1which can be used within a formalization of propositional calculus.A possible contrapositive isThe procedural reading of this contrapositive is somewhat strange and leads to an unnecessary blowing-up of the search space;in order to prove one has to prove–a goal which is totally unrelated to by introducing a new variable.Now,the question arises whether model elimination can be modified in such a way that the above“natural”contrapositives suffice.Indeed,this is achieved in restart model elimination (there are also several other calculi achieving this,e.g.Loveland’s NearHorn-Prolog[Loveland, 1987],Gabbay’s N-Prolog[Gabbay,1985]and Plaisted’s problem reduction formats[Plaisted, 1988]).In restart model elimination,for non-definite clauses,likeonly the following contrapositives have to be considered:It is even possible to restrict to one of those(cf.the selection function below).Of course there is a price to pay.In restart model elimination an additional inference ruleis needed,the restart rule,which allows to begin a completely new proof once a negative bodyliteral,such as or is encountered.As mentioned above,restart model elimination is motivated by logic programming.Be-sides that,we think that restart model elimination is also useful in an automated theoremproving context:in proving theorems such as“if0then20”a human typically uses case analysis according to the axiom000.This seems a verynatural way of proving the theorem and leads to a well-understandable proof.Restart modelelimination carries out precisely such a proof by case analysis.Now let us turn to the other variant,theory model elimination.Theory reasoning wasintroduced by M.Stickel within the general,non-linear resolution calculus[Stickel,1985];formodel elimination it is defined and investigated in[Baumgartner,1992,Baumgartner,1994].Theory reasoning means to relieve a calculus from explicit reasoning in some domain(e.g.,equality,partial orders,taxonomic reasoning)by taking apart the domain knowledgeand treating it by special inference rules.In an implementation,this results in a universal“foreground”reasoner that calls a specialized“background”reasoner for theory reasoning.The advantages of theory reasoning,when compared with the naive method of supplying thetheories’axioms as clauses,are the following:for thefirst,the theory inference system maybe specially tailored for the theory to be reasoned with;thus higher efficiency can be achievedby a clever reasoner that takes advantage of the theories’properties.For the second,a lotof computation that is not relevant for the overall proof plan is hidden in the background.Thus proofs become shorter and are more compact,leading to better readability(although werecognize that this is a matter of taste).More technically,in theory reasoning the idea offinding complementary literals is gener-alized to a semantic level.For instance,in the theory of strict orderings,the literals, and may be detected to be inconsistent by the background reasoner.The general idea is to do the search for complementary literals on this semantical level at every place where syntactical reasoning is used in the non-theory version of the calculus.The question arises how to obtain for a given theory a background calculus.To this end,one of the authors has designed a compilation technique which allows to transform a Horntheory into inference rules which are suitable to be used in conjunction with model elimination.This method,called linearizing completion[Baumgartner,1995]is used throughout all ourexperiments.Fortunately,theory reasoning can be applied to ordinary model elimination,as well asrestart model elimination in a complete way.Together with various sub-variants of restartmodel elimination we have now a considerable spectrum of different calculi for differentneeds of automated reasoning at hand.It is the purpose of this paper to evaluate some of thesecombinations by using the Setheo theorem prover.The rest of this paper is structured as follows:after concluding this introduction withsome preliminaries(basic definitions)we will briefly review the model elimination calculus(Section2).Then we generalize it towards theory model elimination in Section3.Section4describes another calculus variant,restart model elimination.Implementation on SETHEO isdiscussed in Section5.Finally,Section6reports on experimental results.31.1PreliminariesA clause is a multiset of literals,written as the disjunction1.As usual,clauses areconsidered implicitly as being universally quantified,and a clause set is considered logicallyas a conjunction of clauses.Instead of the chains of the original model elimination calculuswe follow[Baumgartner and Furbach,1993]and work in a branch-set setting.A branch is afinite sequence of literals,written by juxtaposing its constituents12.A branch set isafinite multiset of branches.Concerning interpretations we restrict ourselves to Herbrand-Interpretations over a(mosttimes implicitly)givenfinite signatureΣ.Furthermore we supposeΣto contain the0-arypredicate symbol which is to be interpreted by in every interpretation.We assume atheory to be given by a satisfiable set of universally quantified formulas,e.g.as a clause set(because a Herbrand-theorem holds).In the sequel always denotes such a theory.As anexample one might think of the theory of equality,given by the usual axioms.A Herbrand -interpretation for a formula is a Herbrand-interpretation over the joint signatures of and that satisfies,i.e..We write to indicate that is a-interpretation and satisfies(i.e.is a-model for).Furthermore,is called-valid,F,iffevery-interpretation satisfies,and is-(un-)satisfiable iff some(none)-interpretationsatisfies.As a consequence of these definition it holds iff is-unsatisfiable iff is unsatisfiable.2Review of Model EliminationWe will briefly and rather informally review our format of model elimination.It differs from the original one presented by[Loveland,1968];the format we use is described in[Letz et al., 1992]as the base for the prover SETHEO.In[Baumgartner and Furbach,1993]this calculus is discussed in detail and compared to various other calculi.This model elimination manipulates trees by extension-and reduction-steps.As an example consider the clause setA model-elimination refutation is depicted in Figure1.It is obtained by successive fanning with clauses from the input set(extension steps.Additionally,it is required that every inner node(except the root)is complementary to one of its sons.An arc indicates a reduction step, i.e.the closing of a branch due to a path literal complementary to the leaf literal.We will nor present the inference rules formally,because this is done in a more general form in the following section.3Theory Model EliminationIn this section we will review the extension of model elimination towards theory reasoning.A more thorough treatment can be found in[Baumgartner,1994].Theory reasoning comes in two variants[Stickel,1985]:total and partial theory reasoning. Total theory reasoning directly lifts the idea offinding syntactical complementary literals4******Figure 1:A Model Elimination Refutationin inferences (e.g.,resolution)to a semantic level.In partial theory reasoning semantical complementary sets are computed stepwise by means of intermediate goals (called “residues”).The partial variant is of particular interest for us because we have a technique to automatically construct background reasoners for partial theory model elimination [Baumgartner,1995].This technique,called linearizing completion is briefly described below in Section 3.1.Definition 3.1(Theory model elimination (TME))The inference rule theory extension step which transforms a branch set and some clauses in a new branch set is defined as follows:K 1K m L 1R 1L n R n2Residues can be generalized to clauses as in [Stickel,1985],if it is of interest.5K1K m F1result for thefirst-order case with variables would be technically much more complicated (cf.[Lloyd,1987]).Completeness is stated for the ground case only.Although not quite trivial,lifting to the first order case can be carried out by generalizing standard techniques(see e.g.[Chang and Lee,1973,Lloyd,1987]).Theorem3.5(Ground Completeness of Regular Total TME)Let be a theory,c be a computation rule and let M be a-unsatisfiable ground clause set.Let C M be such that C is contained in some minimal-unsatisfiable subset of M.Then there exists a regular total TME refutation of M wrt.c with query C.For the ground proof the excess literal parameter technique can be used in a similar way as it is done for the non-theory version in[Baumgartner and Furbach,1994a].Regularity is shown by restricting for every branch to be closed the available input clause set to those clauses that are free of literals occurring in that branch.An important class of theories are definite theories,i.e.,theories that are axiomatized by a set of definite clauses3.For such theories wefind a special structure of implications: Proposition3.6For every definite theory and for every-valid implication L1L n L n1it holds that either(1)all literals L1L n and the conclusion L n1are positive, or(2)one single literal L i(1i n)is negative and L n1is either negative or F.This special structure of implications can immediately be imposed on the corresponding implications in the definition of extension steps above.If additionally the input clause set is “Horn”,then the ancestor literals of leafs need not to be stored and all extending literals are positive.This result generalizes a well-known property of ordinary model elimination,which states that no reduction steps are required(even possible)in the Horn case.3.1Partial Theory Model Elimination by Linearizing CompletionLet usfirst give some motivation for the linearizing completion technique from the viewpoint of partial theory model elimination.Recall from the definition of theory model elimination(Def.3.1,in particular condition3) that we distinguish between total and partial theory model elimination,where the latter differs from the former only by the possibility to derive residues(i.e.,new subgoals)different from .In other words,in total theory model elimination the contradiction must be discovered by the background reasoner in a single step,while this need not necessarily be so in partial theory model elimination.However,it may be practically difficult or even impossible to design an appropriate background calculus for total theory reasoning.Consider e.g.the theory of equality,where the background calculus then must be capable to enumerate all solutions for a given rigid E-unification problem[Gallier et al.,1987].However the decidability of simultaneous rigid E-unification is still open.No matter how this question will eventually be answered,there are(other)undecidable theories.For undecidable theories we can expect to obtain at mostan enumeration procedure for solutions rather than an algorithm.So,the computations in the background calculus have to be interleaved with the foreground calculus.This makes it difficult to treat the background calculus as a“black box”.In order to remedy the situation,partial theory model elimination offers the framework to split the one single total extension step into a sequence of partial extension steps,followed by a concluding total step.Take the example of equality again.Then,for instance,a total step involving rigid E-unification can be replaced by a sequence of paramodulation steps which transforms an initially given equational goal into which in turn is to be closed by a trivial total step.However,as defined so far,the difficulty with the partial variant is that it adds possible inferences,but does not restrict the total inferences.Thus,partial theory model elimination can be seen only as a framework,and completeness holds vacuously.Furthermore,for efficiency reasons one would certainly not want to consider all-valid implications(Condition3in Def.3.1again)for extension steps.Take again equality:the paramodulation inference rule does not compute all equational consequences of the given key set.For example,is such a-valid implication,but paramodulation does not allow toflip the sides of an equation.This is the point where linearizing completion comes in.The purpose of linearizing completion is to minimize both the possible total and partial extension steps.This is done in a rather general way.Linearizing completion takes as input an arbitrary Horn clause set,such as for example the following set which axiomatizes a theory of strict orderings:Then this set is saturated under certain operations(roughly:binary resolution)modulo a certain notion of redundancy(see[Baumgartner,1995]for a more accurate description of the method).The result is a–possibly infinite–set of clauses.In this case,however,we are lucky and linearizing completion produces the followingfinite set::(Irref)(Asym)(Trans-1)(Trans-2)(Syn)The associated operational meaning of,for instance,the clause(Trans-1)is“from literals and infer the literal”.Consequently,we call such clauses inference rules. Under this operational viewpoint it is clear that(Trans-1)and(Trans-2)are different,although they are logically equivalent.As in theory model elimination the conclusion as in the(Irref) and(Syn)rules stands for.Now we can get back to explain the connection between linearizing completion and partial theory model elimination.The idea is to describe the set of permissible total and partial theory extension steps by such inference rules.This shall be defined more precisely:Definition3.7(Inference systems,theory extension step based on)An inference rule is an expression of the formL1L n L n19where all L i s,1i n ,are literals (called premise literals ),and L n 1is either a literal or F (called conclusion ).The declarative meaning of an inference rule is the implication L 1L n L n 1.An inference system is a set of inference rules.On modifying the definition of theory extension step (Def.3.1)we define the inference rule theory extension step based on to be defined as theory extension step ,except that condition 3is replaced by the following:3.there exists a new variantL 1L n Resof an inference rule from ,there exist indices 1j 1j k m 1and there exists a substitution which is a most general unifier for the multisets L 1L n and K j 1K j k K m .A theory model elimination derivation based onis a derivation where all extension steps arebased on .In words,in order to carry out a theory extension step according to this definition,one has to find an inference rule from whose premise literals simultaneously unify with the leaf literal and some literals from the branch to be extended.If this succeeds the instantiated conclusion of the inference rule yields the residue.In case the conclusion is we have a total step,otherwise a partial step.It should be clear that by this device the set of possible extension steps can be pruned considerably.This holds for instance when using the above inference system for strict orderings.The soundness of this calculus obviously depends on the soundness of .It holds that theory model elimination based on is sound if every inference rule in is a logical consequence (according to the declarative reading)of the underlying theory.Completeness is much harder to establish.As a sufficient condition completeness holds if is obtained by linearizing completion,as e.g.above.We will leave this presentation of linearizing completion now.Finally,it should be noted that since linearizing completion is a tedious task if done by hand we have implemented it and used it in the experiments below.In case linearizing completion results in an infinite inference system finite approximations were used.4Restart Model EliminationLet us now modify the theory model elimination calculus (Section 3),such that only a single contrapositive per clause is needed.The modifications work for both the total as well as the partial variant.Hence we will give up the distinction in this section.For the modifications we have to presuppose definite theories (see the preceeding section).Furthermore,in order to get a complete calculus,we have to assume that there exists only one10clause containing only negative literals,which furthermore does not contain variables,and this clause is to be used as query in refutations4.We note that Theorem3.5can be adapted for this new setting.Definition4.1(Restart Theory Model Elimination)First,extension steps are restricted to operate on negative leafs only.For this define a definite theory extension step in the same way as theory extension step,except that additionally K m is required to be a negative literal and allother key set literals K j1K jkL1L n are required to be positive literals.In order to deal with positive leafs K m define the inference rule restart step as follows: K1K m4Without loss of generality this can be achieved by introducing a new clause and transforming every purely negative clause1into1.5This property is needed for the completeness proof;it guarantees for lifting that the selection function will select on thefirst order level a literal whose ground instance was selected at the ground level.111ABF CADpositive literals occurring in are pairwise distinct.For example,the refutation in Figure3is blockwise regular.Fortunately it holds:Theorem4.4Strict Restart TME with selection function is complete when restricted to block-wise regular refutations.5Implementation on top of SETHEO5.1Architecture of the SystemIn this section,we describe,how partial theory model elimination by Linearizing Completion can be implemented efficiently on the automated theorem prover SETHEO.Figure4shows the components of the system and how the input formula(a set of clauses)is processed.Then,during the compilation phase,contrapositives of the form6:-1111are generated.If0,the:-is changed to?-.Such a contrapositive is used–like in PROLOG–as a possible start clause(query).For the following,a contrapositive of a clause is labeled(for an inference rule of)where is the number of the clause,and is the index of the head literal(1).A LOP formula can contain a mixture of clauses(with<-,fanned during compilation)and contrapositives(with:-or?-,not fanned)75.2Implementation of the theory extension stepIn order to implement theory model elimination by Linearizing Completion,the theory exten-sion step based on the given set of inference rules must be realised within the framework of SETHEO.For the following,we drop the condition that the premise literals of a given inference rule must simultaneously unify with the leaf literal and literals from the branch to be extended(see Definition3.7).This restriction allows for a much easier implementation on top of SETHEO,since SETHEO’s proof procedure considers exactly one branch to be extended at a time.The extension step of Definition3.7can directly be transformed into a model elimination tableau in the following way:given a branch of the tableau with a selected literal(leaf). Furthermore,we have an inference rule:11Then a theory extension step based on this inference rule can be established by a pure model elimination tableau as shown in Figure5.The inference rule(as a clause)is appended to the leaf-node of the tableau.The following conditions must hold:1.one of the literals(1)must be complementary to the selected leaf literal.Thus this branch is closed(marked by an asterisk in Figure5).2.all other literals1(except)must be solved by(a)a model eliminationreduction step into one of the literals on the path from the current leaf to the root of the tableau,or by(b)a closed tableau.Its start clause(into which a model elimination extension step is made)must be a clause of the input formula(i.e.,a clause of the form from Definition3.1).Hence,it must not be an inference rule from.Then,the residuum literal1with the substitution applied comprise the new leaf-node of the tableau.In case,1,no new leaf node is created.This means that the branch with could already be closed.Example5.1Again consider the formula and theory of Example3.2(page6).Then step2 of Fig.2is equivalent to the tableau shown in Fig.6.146In the actual LOP clauses,the negation symbol is written as.7Of course,completeness not ensured,if not all contrapositives belonging to one clause are present in the inputfile.(cf.Section4).15A literal decorated with means8that can only have connections to the head-literals of the given contrapositives.In our case,it can have a connection to all literals of our set of clauses.It is obvious that this restriction implements our condition(2b).5.3Low-level ImplementationThe current version of the language LOP,however,does not support the direct specification of sets of connections.Therefore,the selection of connections is performed on a lower level during the preprocessing and compilation phase in the module thcomp.In afirst step,we duplicate all contrapositives of,whereby all predicate symbols of the head-literals of the copy are consistently renamed into new ones(e.g.,now gets). Thus,for a clause11from we get(1): :-1111:-1111Additionally,each contrapositive of the inference rules of is processed by renaming all tail literals(1)which are decorated by Then,we obtain contrapositives of the following structure:1:-21:-111This duplication of contrapositives and renaming ensures our condition(2b),namely that an extension step from one of the tail literals(1)of an inference rule can be possibly performed into contrapositives of only.During the compilation by SETHEO, a graph of all possible connections(“weak unification graph”,[Eder,1985])is generated. In order to ensure correct evaluation of model elimination reduction steps,the renaming of predicate symbols must be undone before the actual search starts.The graph of all possible connections,however,is not changed again.Furthermore,all methods for pruning the search space which are built into SETHEO(e.g., constraints,for details see[Letz et al.,1992,Letz et al.,1994])can be directly applied.Due to SETHEO’s pure depth-first left-to-right search,the shape of the search space is somewhat different to that of the original theory model elimination.This difficulty,however,can be overcome by assigning different costs for solving the different literals of the inference rule. For SETHEO which performs a depth-first search with iterative deepening,the cost is expressed by modifying the currently available resources(number of available levels to the depth bound). For each literal of an inference rule,the following costs have been determined empirically:if is solved by a model elimination reduction step,or a unit clause from,then the cost is0.the cost for solving a literal(1)is2,andthe cost for solving1is1.In our implementation,the changes of the resources are performed by using built-in predicates(getdepth/1,setdepth/1).5.4Implementation of Restart TME on top of SETHEOThe implementation of(Strict)Restart TME based on Linearizing Completion can be separated into two steps:implementation of restart model elimination(RME)and implementation of the theory part.Since the second step is almost identical to the transformation described above, we only focus on implementing RME on top of SETHEO.As mentioned in Section4,there are 4crucial issues wrt.non-restart model elimination:1.there is only one start clause(clause with negative literals only and without variables),2.clauses are in general not fanned into contrapositives,and3.whenever a positive literal in the tail of a clause is found,a restart step must be performed.4.only blockwise regularity can be demanded.In SETHEO,issue(1)is fulfilled automatically,since a specific start clause“?-query.”is added to the formula per default.Clauses in the input formula of SETHEO are not fanned into contrapositives,if the:-syntax is used(see also Section5.2).Then,the head-literal of such a clause is the only entry-point for extension steps into that clause.Therefore,an input clause11with and being positive atoms is converted into a set of contrapositives:their heads are exactly the positive literals9.All other contrapositives, starting with the negative literals are not needed.However,to match(3),for all positive literals,occurring in the tail of such a clause,restart-steps must be performed.In out notation, we write for some.Hence,we obtain the following set of LOP-clauses: :-211:-111The restart step itself(denoted by)must be handled within the compiler and the SETHEO abstract machine S A M.The following actions must be performed during run-time to implement the restart step:1.The current literal must be placed into the path to be available for model eliminationreduction steps,and2.a“restart”must be made,i.e.,the query“query”must be called.。