推理编程_答案集编程的知识表示和推理

推理编程

Read about the difference between declarative and imperative programming and learn from code examples (Answer Set Programming, Python and C).

了解声明式和命令式编程之间的区别,并从代码示例(答案集编程,Python和C)中学习。

介绍 (Introduction)

The amount of computational problems seems to be unlimited in both industry and science. There is a huge demand for new insights from the vast amount of available data. To obtain this knowledge, dedicated people use all kinds of programming languages for designing and implementing algorithms.

在工业和科学领域,计算问题的数量似乎都是无限的。 从大量可用数据中获得对新见解的巨大需求。 为了获得这些知识,敬业的人们使用各种编程语言来设计和实现算法。

However, many of the current real-world problems are complex (combinatorial) search problems with which we try to automate and optimize processes as well as support people in their decisions. This does not involve encoding of algorithms but encoding given knowledge. In other words, given knowledge about all the rules and constraints to be considered to what is counted as a solution. Instead of writing statements describing the control flow of a computation, declarative programming expresses its logic. What do we want to achieve, not statements about how we can achieve it.

但是,当前许多现实世界中的问题都是复杂的(组合)搜索问题,我们试图通过这些问题来自动化和优化流程,并支持人们的决策。 这不涉及算法的编码,而是编码给定的知识 。 换句话说,已知关于所有规则和约束的知识,可以考虑将其视为解决方案。 声明性编程不是编写描述计算控制流程的语句,而是表达其逻辑。 我们想要实现什么 ,而不是关于如何实现的声明。

This is called declarative programming.

这称为声明式编程。

为什么要进行声明式编程? (Why declarative programming?)

Using a promising declarative programming paradigm, namely Answer Set Programming (ASP, sometimes also Answer Set Prolog), offers unexpected advantages over the popular imperative programming approach, for example:

使用有希望的声明式编程范例,即答案集编程(ASP,有时也称为答案集Prolog),与流行的命令式编程方法相比,具有出乎意料的优势,例如:

  • Short solutions (as measured by lines of code)

    简短的解决方案(按代码行衡量)
  • Transparency (including readability)

    透明度(包括可读性)
  • Reliability

    可靠性

and many more. Once you have broken the problem down into its smallest pieces and written down all the necessary knowledge, you will not only solve the computational challenge. A big advantage is that you have digitized the knowledge and can use it for further problems or make it available in other ways.

还有很多。 将问题分解为最小的部分并写下所有必要的知识后,您不仅会解决计算难题。 一个很大的好处是您已经数字化了知识,可以将其用于其他问题或以其他方式使用。

E

Ë

Furthermore, it strengthens the cooperation between ‘business people’ and programmers. The integration of artificial intelligence is supported and acceptance at all levels will increase. This is a fundamental process that can only be achieved in cooperation with all departments of a company.

此外,它加强了“商人”与程序员之间的合作。 支持人工智能的集成,并且在各个级别的接受度都会增加。 这是一个基本过程,只有与公司所有部门合作才能实现。

什么是ASP?如何运作? (What is ASP and how does it work?)

An answer set program consists of given knowledge formulated as facts, rules (head(X) :- body(X).) or constraints. The program is loaded by a solver and returns a “stable model”. This so called answer set consists of all facts that can be derived using the given rules and constraints. A finite amount of stable models are generated as solutions, of which one is finally selected.Note: grounding and solving the problems are not within the scope of this article.

答案集程序包括由事实,规则( head(X) :- body(X). )或约束条件组成的给定知识。 该程序由求解器加载并返回“稳定模型”。 所谓的答案集包括可以使用给定的规则和约束导出的所有事实。 生成有限数量的稳定

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值