cmodels - sat-based disjunctive answer set solver
- 格式:pdf
- 大小:57.29 KB
- 文档页数:5
simcse 原理-回复标题:深入理解SIMCSE原理SIMCSE,全称为Sentence Infernece-based Multi-View Contrastive Learning for Semantic Text Embedding,是一种基于句子推断的多视图对比学习语义文本嵌入方法。
本文将逐步解析SIMCSE的原理,以帮助读者深入理解其工作机制。
一、引言在自然语言处理领域,语义文本嵌入是一种将文本转换为数值向量表示的方法,使得相似的文本在向量空间中有相近的距离。
然而,传统的文本嵌入方法如Word2Vec、GloVe等主要关注词汇级别的语义,对于句子级别的语义理解能力有限。
为此,SIMCSE提出了一种新的句子级别语义嵌入方法。
二、SIMCSE的基本框架SIMCSE主要包括两个主要部分:句子扰动和对比学习。
1. 句子扰动:SIMCSE通过随机masking句子中的部分词汇或者使用不同的预训练模型对同一句子进行编码,生成同一句子的不同视图。
这种操作可以增加模型的鲁棒性,并引入更多的语义信息。
2. 对比学习:生成的句子视图会被输入到一个共享的编码器(如BERT、RoBERTa等预训练模型)中,得到各自的嵌入表示。
然后,SIMCSE通过最大化同一句子不同视图的嵌入表示之间的cosine similarity,以及最小化不同句子的嵌入表示之间的cosine similarity,进行对比学习。
三、SIMCSE的工作流程以下是SIMCSE的具体工作流程:1. 数据预处理:首先,对输入的文本数据进行预处理,包括分词、去除停用词等操作。
2. 句子扰动:对每个句子进行两种类型的扰动操作,生成两个不同的视图。
一种是随机masking句子中的部分词汇,另一种是使用不同的预训练模型对同一句子进行编码。
3. 编码处理:将扰动后的句子输入到预训练的Transformer模型(如BERT、RoBERTa等)中,得到各自的嵌入表示。
sat内容-回复着名的SAT考试(全称为Scholastic Assessment Test,中文译为学术评估测试)是美国大学入学申请中所需的标准化考试之一。
它的题目范围广泛,涵盖了数学、阅读、写作等多个领域。
而今,我们将聚焦在一个具体的SAT题目,让我们一步一步来解答。
我们选择的SAT题目是:“读到这篇文章时,你曾经感到你曾退步,无法成长实力?”。
首先,我们需要仔细阅读题目,确保完全理解题意。
这个题目问的是在读这篇文章的过程中,是否曾经感到自己的实力有所退步,无法成长。
这是一个比较主观的问题,因此我们需要思考自己的回答,并找到能够支持自己观点的理由。
接下来,我们需要展开思路,构思文章的大纲。
为了回答这个问题,我们可以从以下几个方面展开讨论:1.回忆过去的成长经历2.评估目前的实力和成长潜力3.列举解决方法和达成目标的计划一旦我们有了这些基本的思路,我们就可以开始写作了。
第一段我们可以用来引入话题,并回答问题:“回顾过去的学习历程,我可以坦诚地说,我在某些环节确实曾经感到自己的实力有所退步,无法继续成长。
然而,这些经历并没有阻碍我持续努力学习和不断发展自己。
”第二段我们可以回忆过去的成长经历:“在过去的学习中,我曾经遇到各种各样的挑战和困难。
比如,在数学方面,我曾经在几何和代数课程上遇到困难,我觉得自己的数学能力退步了。
但是,我没有放弃,我积极寻求帮助,参加补习班和请教老师,最终我成功克服了这些问题并取得了进步。
”第三段我们可以评估目前的实力和成长潜力:“目前,我已经在学术和个人发展方面取得了一定的进步。
通过参加各种学术竞赛和科学实验,我发现我对科学领域有着特别的兴趣和天赋。
此外,我也积极参与学校社团和义工活动,提升自己的领导能力和团队合作能力。
我相信,通过不断地学习和努力,我依然具备进一步成长和发展的潜力。
”第四段我们可以列举解决方法和达成目标的计划:“为了克服我曾经的退步,我制定了一系列的解决方案和目标计划。
一种求解3-sat问题的新方法一、informationand ideas: the author's message (对文本信息的考察)包括以下题型:1文本细节的考查1)直接信息题(explicitmeaning),该类题型能够直接从文本中找到信息,题目中通常出现如下字眼"accordingto the passage," "states," "indicates,"等。
如:theauthors indicate that people value gift-giving because they feel it?2)暗含信息题(implicitmeaning),该类题型须要认知文本的暗含意思,题目中通常发生如下字眼"basedon the passage," "it can reasonably be inferred,""implies," 等。
例如:basedon the passage, the author's statement "" impliesthat?3)类比题(analogy),考察对文本内容特征的把握及应用,如"whichof the following situations is most analogous to the relationshipmentioned in line 5to 10?2文本论据的考查循证题(citingtextual evidence),要求为上一题的答案寻找论据或者为某个结论提供论据。
例如:whichchoice provides the best evidence for the answer to the previousquestion? (找寻上一题答案论据),或者inlines 46-50("prosecutionssens"),whatis the most likely reason jordan draws adistinction between twotypes of "parties"? (为某个结论提供更多论据)循证题是对文本论据的考察,在每个篇章中会出现两题,共10题。
Conversation用法总结1. 概述Conversation是一种人与机器之间进行对话的方式,它允许用户提出问题或发表陈述,并从机器中获取有关特定主题的信息。
在人工智能领域,Conversation被广泛应用于各种任务,如聊天机器人、智能助手和客服系统等。
通过理解和生成自然语言,Conversation使得机器能够模拟人类对话,为用户提供个性化的服务和支持。
2. Conversation的重要观点2.1 自然语言理解(Natural Language Understanding, NLU)自然语言理解是Conversation中的重要环节,它涉及将用户输入的自然语言文本转换为可理解和处理的形式。
NLU技术通常包括词法分析、句法分析、语义分析等子任务,旨在从文本中提取出关键信息,并确定用户意图和上下文。
2.2 对话管理(Dialog Management)对话管理是Conversation中的关键组成部分,它负责根据用户输入和系统状态来决定如何生成回复。
对话管理涉及到对上下文进行建模和维护,以便能够正确地响应用户,并采取适当的行动。
常用的对话管理方法包括基于规则、基于有限状态机和基于强化学习的方法。
2.3 自然语言生成(Natural Language Generation, NLG)自然语言生成是Conversation中的另一个重要环节,它负责将机器生成的信息转换为自然语言文本,以便向用户传达回复。
NLG技术通常涉及到文本生成、语音合成等任务,旨在产生流畅、连贯且符合语法规则的输出。
2.4 多轮对话(Multi-turn Conversation)多轮对话是Conversation中常见的场景之一,它涉及到用户和机器之间进行多次交互来完成一个任务。
在多轮对话中,对话管理起着至关重要的作用,需要能够正确地理解上下文、处理用户意图并生成合适的回复。
2.5 评估与优化(Evaluation and Optimization)评估与优化是Conversation系统开发过程中必不可少的一环。
有关初中科学精神的英语作文“The Importance of Scientific Spirit in Middle School”Science is an essential part of our lives, and it plays a crucial role in shaping our understanding of the world. In middle school, students are introduced to the wonders of science, and it is during this time that they begin to develop a scientific spirit. A scientific spirit encompasses a set of values and attitudes that are essential for success in science and beyond.One of the key aspects of a scientific spirit is curiosity. Curiosity drives us to ask questions, seek answers, and explore the unknown. In middle school science classes, students are encouraged to be curious and to ask questions about the natural world. This curiosity leads to a deeper understanding of scientific concepts and helps students develop critical thinking skills.Another important aspect of a scientific spirit is objectivity. Science is based on evidence and observation, and it is important for students to approach scientific inquiries with an open and objective mind. In middle school, students learn to design experiments, collect data, and analyze results. By doing so, they learn to evaluate evidence and draw conclusions based on facts rather than personal biases or beliefs.In addition to curiosity and objectivity, a scientific spirit also includes a sense of skepticism. Skepticism allows us to question assumptions, challenge conventional wisdom, and look for alternative explanations.In middle school, students are taught to think critically and to evaluate the validity of scientific claims. This skepticism helps them to develop a more nuanced understanding of science and to avoid accepting information at face value.Furthermore, a scientific spirit emphasizes the importance of collaboration and communication. Science is a collaborative endeavor, and scientists often work in teams to solve complex problems. In middle school, students learn to work together in groups, share ideas, and communicate their findings. This collaboration and communication skills are essential for success in any field.Finally, a scientific spirit requires a commitment to lifelong learning. Science is constantly evolving, and new discoveries are being made all the time. In middle school, students are exposed to the latest scientific research and are encouraged to stay up-to-date with the latest developments in their fields of interest. This commitment to lifelong learning helps students to stay engaged and passionate about science throughout their lives.A scientific spirit is essential for success in science and beyond. By developing curiosity, objectivity, skepticism, collaboration, communication, and a commitment to lifelong learning, middle school students can lay a solid foundation for a future in science or any other field. As educators, it is our responsibility to foster these values and attitudes in our students and to inspire them to become lifelong learners and critical thinkers.。
《计算机视觉》题集大题一:选择题1.下列哪项不属于计算机视觉的基本任务?A. 图像分类B. 目标检测C. 语音识别D. 语义分割2.在卷积神经网络(CNN)中,以下哪项操作不是卷积层的主要功能?A. 局部感知B. 权重共享C. 池化D. 特征提取3.下列哪个模型在图像分类任务中首次超过了人类的识别能力?A. AlexNetB. VGGNetC. ResNetD. GoogleNet4.以下哪个算法常用于图像中的特征点检测?A. SIFTB. K-meansC. SVMD. AdaBoost5.在目标检测任务中,IoU (Intersection over Union)主要用于衡量什么?A. 检测框与真实框的重叠程度B. 模型的检测速度C. 模型的准确率D. 模型的召回率6.下列哪项技术可以用于提高模型的泛化能力,减少过拟合?A. 数据增强B. 增加模型复杂度C. 减少训练数据量D. 使用更大的学习率7.在深度学习中,批归一化 (Batch Normalization)的主要作用是什么?A. 加速模型训练B. 提高模型精度C. 减少模型参数D. 防止梯度消失8.下列哪个激活函数常用于解决梯度消失问题?A. SigmoidB. TanhC. ReLUD. Softmax9.在进行图像语义分割时,常用的评估指标是?A. 准确率B. 召回率C. mIoU(mean Intersection over Union)D. F1分数10.下列哪个不是深度学习框架?A. TensorFlowB. PyTorchC. OpenCVD. Keras大题二:填空题1.计算机视觉中的“三大任务”包括图像分类、目标检测和______。
2.在深度学习模型中,为了防止梯度爆炸,常采用的技术是______。
3.在卷积神经网络中,池化层的主要作用是进行______。
4.YOLO算法是一种流行的______算法。
5.在进行图像增强时,常用的技术包括旋转、缩放、______和翻转等。
一、选择题1.在进行模型训练前,数据预处理的主要目的是什么?A.提高模型的准确率B.减少模型训练时间C.使数据集更符合实际业务需求D.以上都是(答案)2.下列哪项不是特征工程中的常见方法?A.数据归一化B.类别特征编码C.数据增强D.缺失值处理(答案)3.在深度学习中,为了防止过拟合,可以采取以下哪种策略?A.增加模型复杂度B.减少训练数据C.使用Dropout技术(答案)D.提高学习率4.下列哪个算法属于监督学习?A.K-means聚类B.主成分分析(PCA)C.支持向量机(SVM)(答案)D.DBSCAN5.在训练神经网络时,损失函数(loss function)的作用是?A.评估模型的预测误差(答案)B.决定模型的结构C.控制训练的速度D.决定数据的分割方式6.下列哪项技术常用于处理序列数据,如文本或时间序列?A.卷积神经网络(CNN)B.循环神经网络(RNN)(答案)C.生成对抗网络(GAN)D.深度信念网络(DBN)7.在模型评估阶段,准确率(Accuracy)高但召回率(Recall)低,可能表明模型存在什么问题?A.模型过于复杂B.类别不平衡问题(答案)C.训练数据不足D.过拟合8.以下哪种方法可以用来优化神经网络的超参数?A.梯度下降法B.网格搜索(答案)C.反向传播D.批量归一化9.在进行模型部署时,以下哪项不是常见的考虑因素?A.模型的推理速度B.模型的存储需求C.模型的训练时间(答案)D.模型的可解释性10.对于不平衡数据集,以下哪种策略可能有助于改善模型的性能?A.欠采样多数类(答案)B.过采样少数类C.增加数据集的大小D.以上都是。
中学英语课程与教学论智慧树知到课后章节答案2023年下湖北师范大学湖北师范大学第一章测试1.What does the functional view of language see language? ( )A:a communicative tool to build up and maintain social relations betweenpeopleB:a linguistic system made up of various subsystemsC:a linguistic system and a means for doing thingsD:a system of categories based on the communicative needs of the learner答案:a linguistic system and a means for doing things2.The interactional view of language believes that language is ________ ( )A:a communicative tool to build up and maintain social relations betweenpeopleB:a linguistic system made up of various subsystemsC:a linguistic system and a means for doing thingsD:a system of categories based on the communicative needs of the learner答案:a communicative tool to build up and maintain social relationsbetween people3.The structural view of language sees language as a linguistic system made upof various subsystems.()A:错 B:对答案:对4.The influential result of the behaviourism is the audio-lingual method.()A:对 B:错答案:对5.Teachers should reflect on their work only after they finish a certain periodof practice.()A:对 B:错答案:错6.What qualities are considered good qualities of a good teacher? ( )A:Hard working, disciplinedB:Kind, humorous, well informed C:Well prepared, dynamic D:Patient答案:Hard working, disciplined;Kind, humorous, well informed;Well prepared, dynamic;Patient7.In the past century, language teaching and learning practice has beeninfluenced by different views of language, they are ( )A:The functional view of languageB:The linguistic view of languageC:The interactional view of languageD:The structural view of language答案:The functional view of language;The interactional view of language;The structural view of language8.The second stage of the development of teachers’ professional competenceinvolves ( )A:practiceB:learningC:reflectionD:Training答案:practice;learning;reflection第二章测试1.What is the ultimate goal of foreign language teaching? ( )A:Enable students to speak standard English.B:Enable students to achieve fluency of English language structure.C:Enable students to use the foreign language in work or life.D:Enable students to achieve accuracy of English language structure.答案:Enable students to use the foreign language in work or life.2.What is the possible solution to bridge the gap between classroom languageand real-life language? ( )A:Task-based teaching and learning B:Engage——study——activateC:Presentation, practice and production D:Communicative language teaching答案:Communicative language teaching3.What is linguistic competence concerned with? ( )A:Knowledge of language itself, its form and meaningB:Strategies one employs when there is communication breakdown due to lack of resourcesC:Appropriate use of the language in social contextD:Ability to create coherent written text or conversation and the ability to understand them答案:Knowledge of language itself, its form and meaning4.CLT is the further development of TBLT.()A:对 B:错答案:错5.Pragmatic competence concerned with appropriate use of the language insocial context. ( )A:对 B:错答案:对6.Teachers need to address these sets of questions when design task ( )A:How is the task be carried out?B:What is objective of a task?C:In what situation is the task to be carried out?D:What is the content of the task?答案:How is the task be carried out?;What is objective of a task?;In what situation is the task to be carried out?;What is the content of the task?7.What are the main features of communicative competence? ( )A:Linguistic competence and pragmatic competenceB:Strategic competenceC:FluencyD:Discourse competence.答案:Linguistic competence and pragmatic competence;Strategic competence;Fluency;Discourse competence.8.Which ones are true about six criteria for evaluating how communicativeclassroom activities are? ( )A:The activity should be designed to control what language the studentsshould use.B:When students are doing the activity. They must focus on the form, not on the meaning.C:The activity should involves the students in performing a realcommunicative purpose rather than just practicing language for its own sake.D:The activity must be designed to be done by students working bythemselves rather than with the teacher.答案:The activity should involves the students in performing a realcommunicative purpose rather than just practicing language for its own sake.;The activity must be designed to be done by students working bythemselves rather than with the teacher.第三章测试1.在英语学科核心素养的四个要素中, 语言能力构成英语学科核心素养的基础要素;文化意识体现英语学科核心素养的价值取向;思维品质体现英语学科核心素养发展的心智特征, 学习能力构成英语学科核心素养发展的重要条件和保障。
NoisyChannel模型纠正单词拼写错误本⽂介绍 Stanford《From Languages to Information》课程中讲到的单词拼写错误纠正。
背后的数学原理主要是贝叶斯公式。
单词拼写错误纠正主要涉及到两个模型:⼀个是Nosiy Channel模型,它是贝叶斯公式中的似然函数;另⼀个模型是Language Model,它是贝叶斯公式中的先验概率。
⼀,问题描述在这句话中“. . . was called a “stellar and versatile acress whose combination of sass and glamour has defined her. . .”,有⼀个错误的单词:acress 这个错误单词 acress 对应的正确单词是哪个呢?是 actress?还是cress?还是 caress?……⼆,出现单词拼写错误的情形⼀种是 Non-word spelling errors,它是指:错误的单词不存在于词典中。
也就说,你键盘输⼊了⼀个单词,⽽这个单词根本没有被英⽂词典收录,在字典中查不到。
⽐如你将正确的单词graffe,多打了⼀个字符 i ,变成了 giraffe,⽽英⽂字典中根本没有 giraffe这个单词。
另⼀种是 real-word errors,⽐如:想输⼊there are,结果输⼊成了three are。
⽽错误单词 three 是存在于字典中的,关键问题是:怎么知道将 three 改成 there 呢?三,单词拼写错误的纠正步骤①⾸先检测出是哪个单词发⽣了拼写错误。
这可以通过查字典来实现,⽐如依次扫描每个单词,若该单词不在词典中(未被词典收录),则认为它是⼀个拼写错误的单词。
显然,词典越⼤,词典收录的单词越多,我们就越能正确检测出错误的单词。
②其次,是要从⼀组候选的正确单词中,选择⼀个“最准确”的单词,⽽这个“最准确”的单词,就是要找的结果(错误单词对应的正确单词)。
2021大数据知识竞赛考试题及答案1、以下哪项不属于大数据的特征?数据量大数据类型复杂单位处理数据的速度高数据价值密度高【正确答案】2、以下哪项不属于大数据流式处理典型业务应用场景?实时营销实时服务实时监控用户画像【正确答案】3、以下不属于Hadoop内核的组成部分的是HDFSMapReduceHbase【正确答案】YARN4、HDFS默认的当前工作目录是/user/$USER,的值需要在下列哪一个配置文件内说明?mapred-site.xmlcore-site.xml【正确答案】hdfs-site.xml以上均不是5、下列哪一项不属于HDFS相对于分布式系统而言特有的特性?高容错大文件存储大量的随机读应用【正确答案】高吞吐量6、下列存储HDFS某一时段NameNode内存元数据信息的是hdfs-site.xmlfsimage【正确答案】editsfstime7、以下哪个不是HDFS的守护进程?secondarynamenodedatanodemrappmaster/yarnchild【正确答案】namenode8、关于 SecondaryNameNode 哪项是正确的?它是 NameNode 的热备它是内存没有要求它的目的是帮助 NameNode 合并编辑日志,减少 NameNode 启动时间【正确答案】SecondaryNameNode 应与 NameNode 部署到一个节点9、以下哪一项不属于HDFS集群中的namenode职责维护HDFS集群的目录树结构维护HDFS集群的所有数据块的分布、副本数和负载均衡负责保存客户端上传的数据【正确答案】响应客户端的所有读写数据请求10、以下哪一项属于SecondaryNamenode的作用监控Namenode管理Datanode合并fsimage和editlogs【正确答案】支持Namenode HA11、下面哪个程序负责 HDFS 中实际数据的存储NameNodeJobtrackerDatanode【正确答案】secondaryNameNode12、关于HDFS集群中的DataNode的描述不正确的是DataNode之间不是独立的,相互之间会有通信和数据传输存储客户端上传的数据的数据块一个DataNode上存储的所有数据块可以有相同的【正确答案】响应客户端的所有读写数据请求,为客户端的存储和读取数据提供支撑13、如果我们现有一个hadoop集群,默认存储文件3份,并且大文件会按照128M 的数据块大小进行切割分散存储,在不修改默认配置的情况下存储200个每个200M的文本文件,请问最终会在集群中产生多少个数据块(包括副本)?200400004001200【正确答案】14、下列选项中,哪一项是存储HDFS某一时段NameNode内存元数据信息?hdfs-site.xmlfsimage【正确答案】editsfstime15、HBase底层依靠什么进行数据的存储HDFS【正确答案】HiveMemoryMapReduce16、下列选项中,哪个选项是用于处理海量数据的并行编程模式和大规模数据集的并行运算的软件架构?GFSMapReduce【正确答案】ChubbyBitTable17、Mapreduce擅长哪个领域的计算离线批处理【正确答案】DAG计算流式计算实时计算18、在MapReduce中哪一个阶段,把Mapper的输出数据归并整理后分发给Reducer处理Shuffle【正确答案】MapReduceSort19、关于MapReduce原理,下面说法错误的是分为Map和Reduce两个阶段Map阶段由一系列Map任务组成Reduce阶段由一系列Reduce任务组成Map阶段与Reduce阶段没有任何依赖关系【正确答案】20、下列哪个程序通常与NameNode 在同一个节点启动TaskTrackerDataNodeSecondaryNameNodeJobtracker【正确答案】21、MapReduce的Map函数产生很多的keyvalue<key,value>【正确答案】Hash22、下面关于Hive,说法错误的是Hive支持所有标准SQL语法【正确答案】Hive底层采用的计算引擎是MapReduceHive提供的HQL语法,与传统SQL很类似Hive Server可采用MySQL存储元数据信息23、下列哪项通常是Hadoop中MapReduce集群的最主要瓶颈CPU网络磁盘【正确答案】内存24、Hadoop框架的缺陷不包括MR编程框架的限制过多的磁盘操作,缺乏对分布式内存的支持无法高效低支持迭代式计算海量的数据存储【正确答案】25、YARN的调度算法不包括以下哪种FIFO SchedulerFair SchedulerCapacity SchedulerStack Scheduler【正确答案】26、YARN和MapReduce的关系是MapReduce是一个计算框架,可运行在YARN之上【正确答案】YARN是一个计算框架,可运行在MapReduce之上MapReduce和YARN无直接关系以上回答均不正确27、下列选项中,哪个是用来将Hadoop和关系型数据库中的数据相互转移的工具?ZookeeperSqoop【正确答案】HIVESpark28、Hadoop 大数据平台在整个数据挖掘的过程中,起到的作用是数据源处理数据清洗和装载【正确答案】数据展现CUBE生成29、以下哪一项是大数据的核心告知与许可预测【正确答案】匿名化规模化30、以下哪一项是用于处理海量数据的并行编程模式和大规模数据集的并行运算的软件架构。
CMODELS–SAT-based Disjunctive Answer Set SolverYuliya LierlerErlangen-N¨u rnberg Universit¨a tyuliya.lierler@informatik.uni-erlangen.deIntroductionDisjunctive logic programming under the stable model semantics[GL91]is a new methodology called answer set programming(ASP)for solving combinatorial search problems.This programming method uses answer set solvers,such as DLV[Lea05], GNT[Jea05],SMODELS[SS05],ASSAT[LZ02],CMODELS[Lie05a].Systems DLV and GNT are more general as they work with the class of disjunctive logic programs,while other systems cover only normal programs.DLV is uniquely designed tofind the an-swer sets for disjunctive logic programs.On the other hand,GNTfirst generates possi-ble stable model candidates and then tests the candidate on the minimality using system SMODELS as an inference engine for both tasks.Systems CMODELS and ASSAT use SAT solvers as search engines.They are based on the relationship between the com-pletion semantics[Cla78],loop formulas[LZ02]and answer set semantics for logic programs.Here we present the implementation of a SAT-based algorithm forfinding answer sets for disjunctive logic programs within CMODELS.The work is based on the definition of completion for disjunctive programs[LL03]and the generalisation of loop formulas[LZ02]to the case of disjunctive programs[LL03].We propose the necessary modifications to the SAT based ASSAT algorithm[LZ02]as well as to the generate and test algorithm from[GLM04]in order to adapt them to the case of disjunctive programs. We implement the algorithms in CMODELS and demonstrate the experimental results.1Syntax of CMODELSA Disjunctive program(DP)is a set of rules with expressions that have the formA←B,F(1) where A is the head of the rule and is a disjunction of atoms or symbol⊥,B is a conjunction of atoms,and F is a formula of the following formnot A1,...,not A m,not not A m+1,...,not not A nwhere A i are atoms.We call such rules disjunctive.If a head of a rule does not contain disjunction,we call such a rule normal.If the formula F of the rule(1)contains an expression of the form not not A i then the rule is nested,otherwise the rule is non-nested.If all rules of a DP are normal we call the program normal.Our implementation–system CMODELS–uses the program LPARSE--dlp-choice for grounding disjunctive logic programs.The input of CMODELS may include rules of three types.It allows(i)non-nested disjunctive rules,(ii)choice rules that have the form{A0,...A k}←A k+1,...,A l,not A l+1,...,not A m(2)where A i are atoms,and(iii)weight constraints of the formA0←L[A1=w1,...,A m=w m,not A m+1=w m+1,...,not A n=w n](3)where A0is an atom or symbol⊥;A1,...,A n are atoms;L(lower bound);and w1...w n (weights)are integers.The concept of an answer set for programs containing rules(2)and(3)was intro-duced in[NS00].The original rules given to the front end LPARSE--dlp-choice allow lower and upper bounds for choice rules and upper bounds for weight rules.They also allow use of literals(negated atoms)in place of atoms.LPARSE--dlp-choice translates all the rules to the forms specified above.In CMODELS,choice rules are translated into normal nested rules,and weight constraints are translated with the help of auxiliary variables into normal non-nested rules.[FL05]Note that CMODELS is thefirst answer set programming system that allows use of disjunctive and choice rules in the same program.2Details on the Modified Algorithms and the ImplementationThe implementation is based on definitions of completion,tightness and loop formula for DP introduced in[LL03].We also refer the reader to[LL03]for formal definitions of a set of atoms satisfying a program,answer set,reduct,and positive dependency graph of DP.The implementation exploits the relationship between completion seman-tics,loop formulas and answer set semantics for DP.For class of programs called tight models of completion and answer sets are the same.For nontight programs the dif-ference in semantics is due to the cycles(loops)in the program.Loop formulas serve a role of an extension to completion so that the semantics coincide again.Number of loop formulas is exponential and therefore precomputing all loop formulas at once is not feasible,and iterative approach is explored.The correctness of algorithms encoded in CMODELS follows from two theorems.Theorem for Tight Programs.[LL03]For any tight DPΠand any set X of atoms,X is an answer set forΠiff X satisfies program’s completion comp(Π).Theorem1.LetΠbe a DP,M be a model of its completion comp(Π),set of atoms M |=ΠM,such that M ⊂M.There must be a loop ofΠunder M\M ,s.t.M does not satisfy its loop formula.Deciding whether a model of the completion is an answer set of disjunctive program is co-NP-complete.Within this implementation of CMODELS we verify that a model of the completion is indeed an answer set by using the minimality requirement of an answer set.We invoke a SAT solver on formulaΠM∪M−∪¬M,where(i)ΠM denotes the reduct ofΠunder M,s.t.its rules are represented as propositional formulas with the comma understood as conjunction,and A←B as the material implication B⊃A;(ii)M−denotes the conjunction of negation of the atoms inΠthat do not belong to M;and(iii)¬M denotes the negation of the conjunction of atoms in M.If this formula is unsatisfied then M is indeed an answer set ofΠotherwise some model M ⊂M is returned.Note that M |=Π.We call this procedure minimality test.It is similar to the procedure introduced in[JNSY00].[KLP03]introduced a more sophisticated way of verifying whether a model is an answer set using SAT solvers by exploiting some modularity property of the program,that permits splitting verification step on the whole program into verification on its parts.It is a direction of future work to research the applicability of the approach to the case of nested programs.CMODELS’algorithm is enhanced to verify the tightness of DP atfirst.In case when a program is tight it performs a completion procedure on the program and uses a SAT solver for enumerating its answer sets,avoiding invocation of minimality test proce-dure.This way we allow efficient use of SAT solvers in ASP,by analysing program syntactically and identifying in advance disjunctive program involving lower computa-tional complexity.For nontight programs we adapt ASSAT algorithm[LZ02]to the case of disjunctive programs based on Theorem2.The modified algorithm follows—DP-assat-Proc:1Let T be the Completion ofΠ—Comp(Π)2Invoke SAT solver SAT-A tofind a model M of T.If there is no such model then terminate with failure.3Invoke the minimality test procedure on programΠ,and model M with SAT solver SAT-B tofind model M .If there is no such model then exit with an answer set M.If there is a model M then M is not an answer set ofΠ.4Build the subgraph G M\M of the positive dependency graph ofΠinduced by M\M .Look for loop L in G M\M ,s.t.M|=F L,where F L is a loop formula of L.5Let T be T∪F L,and go back to step2.The implementation also adapts another SAT-based answer set programming gen-erate and test algorithm from[GLM04]to the case of nontight disjunctive programs. State-of-the-art SAT solvers are enhanced by the ability of performing backjumping and learning within standard SAT Davis-Logemann-Loveland(DLL)procedure.Back-jumping and learning techniques are due to providing DLL procedure with a certain clause.We retrieve the necessary clause from some loop formula of a program that allows us to enhance SAT solver inner computation.The enhanced generate and test algorithm for DP—DP-generate-test-enhanced-Proc:1Compute completion ofΠ—Comp(Π)2Initiate SAT solver SAT-A with the completion Comp(Π).Invoke DLL tofind model M of Comp(Π).If there is no such model then terminate with failure.3,4The same as Step3,4of DP-assat-proc.5Calculate a clause Cl implied by F L such that M|=Cl.6Return control to the SAT-A procedure DLL by giving Cl as a clause to backjump and learn.Find the next model M of the completion.If there is no such model then terminate with failure.Go back to step3.instance dlv.5.02.23cmodels+zchaff gnt2 SAT0.01(23)0.14(5)SAT0.01(23)0.09(4)SAT0.01(33)0.09(5) qbf119.810.01(16)0.001qbf2 5.43823.98(19928)1466.30 qbf3 5.271779.28(28481)-qbf4 6.8310.55(137)-Fig.1.CMODELS using MCHAFF,ZCHAFF,SIMO vs.DLV,and GNT on2QBF benchmark3Experimental AnalysesDetails on the performance of system CMODELS in case of tight disjunctive programs can be found in[Lie05b].For experimental analysis of CMODELS’performance on non-tight programs we shall specify the algorithmic differences of SAT solvers’invocations. Algorithm DP-assat-Proc is implemented in CMODELS using SAT solver MCHAFF1in Step2.Algorithm DP-generate-test-enhanced-Proc is implemented in CMODELS with SAT solver SIMO2or ZCHAFF1invoked in place of SAT-A in the procedure.In case of DP-generate-test-enhanced-Proc implementation of Step6when control is given back to the SAT solver,SIMO and ZCHAFF behave differently.SIMO continues its work with the same search tree it obtained in previous computations,while ZCHAFF starts building a new search tree.In all cases ZCHAFF is used for minimality test procedure.Thefirst experiment that we demonstrate is2QBF benchmark.The problem isΣp2-hard.The encoding and the instances of the problem where obtained at the web-site of the University of Kentucky3.Figure1presents the results.The experiments were run on Pentium4,CPU3.00GHz.The columns3through7present the running times of the systems in seconds with30minutes cutoff time.Number in parentheses specifies how often CMODELS invoked the minimality test procedure during its run.In case of satisfiable instances of the problem we can see the payoff in using CMODELS in place of other disjunctive ASP solvers.The picture changes when unsatisfiable instances of the problem come into play.Implementation of DP-assat-Proc reaches time limit twice and in case of one instance reaches the memory limit.Implementation of DP-generate-test-enhanced-Proc shows better results but as a rule is slower than DLV running time by two orders of magnitude.If we pay attention to the number of minimality test proce-dure invocations,the slow performance is not surprising.The number of models of the completion is large in case of unsatisfiable instances qbf2,qbf3instances and hence all found models must be verified and denied by the minimality test procedure.The second experiment that we present is the Strategic Company benchmark.The problem isΣp2-hard.We used the encoding and the instances of the problem provided by the benchmark system for answer set programming–Asparagus4.Figure2presentsrunning times of systems obtained from Asparagus,machine AMD Athlon1.4GHz PC with512MB RAM and cutoff time15minutes.All given instances are satisfiable.In case of strategic company benchmark there is no clear winner in the performance,but GNT and DLV are in general faster.inst-gnt2cmod-s dlv.4cmodels cmod-s ance mchaff 5.23zchaff simo0.640.330.34125.4541.02-0.870.340.34105.3879.99404.720.51 1.20 1.49155.016.56-6.66 1.52 5.04135.118.0062.252.24 5.9914.27155.3188.14755.12。