Consider the puzzle: given a number, remove $k$ digits such that the resulting number is as large as possible. Various techniques were employed to derive a linear-time solution to the puzzle: predicate logic was used to justify the structure of a greedy algorithm, a dependently-typed proof assistant was used to give a constructive proof of the greedy condition, and equational reasoning was used to calculate the greedy step as well as the final, linear-time optimisation.
翻译:考虑谜题 : 给一个数字, 移除美元位数, 以便得出尽可能多的数字 。 使用了各种技术来为谜题找到线性时间解决方案 : 使用上游逻辑来说明贪婪算法结构的合理性, 使用依赖型样的证明助理来提供贪婪状况的建设性证据, 使用方程推理来计算贪婪步骤以及最终线性时间优化 。