论文标题

编程的离散数学:一种原则的方法

Discrete Math with Programming: A Principled Approach

论文作者

Liu, Yanhong A., Castelllana, Matthew

论文摘要

离散数学是计算机科学的基础。它着重于使用数学符号研究的概念和推理方法。长期以来一直认为,通过编程更好地教授了离散的数学,该编程采用概念和计算方法,并将其变成可执行的程序。缺少的是一种原则性的方法,它支持所有离散数学的中心概念(尤其是谓词逻辑),并直接且精确地将数学符号与可执行程序联系起来。本文介绍了这种方法。它基于使用强大的语言的使用,该语言通过适当的逻辑量化扩展了Python编程语言(“所有”和“存在”),以及声明性的集合理解(也称为集合构建器)和聚合(例如,总和和产品)。数学和逻辑语句可以精确地在高级别上表达,并直接在计算机上执行,从而鼓励声明性编程以及算法编程。我们描述了方法,详细的例子,使用它的经验以及所学的教训。

Discrete mathematics is the foundation of computer science. It focuses on concepts and reasoning methods that are studied using math notations. It has long been argued that discrete math is better taught with programming, which takes concepts and computing methods and turns them into executable programs. What has been lacking is a principled approach that supports all central concepts of discrete math -- especially predicate logic -- and that directly and precisely connects math notations with executable programs. This paper introduces such an approach. It is based on the use of a powerful language that extends the Python programming language with proper logic quantification ("for all" and "exists some"), as well as declarative set comprehension (also known as set builder) and aggregation (e.g., sum and product). Math and logical statements can be expressed precisely at a high level and be executed directly on a computer, encouraging declarative programming together with algorithmic programming. We describe the approach, detailed examples, experience in using it, and the lessons learned.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源