简体   繁体   English

Isabelle / HOL中的错误消息

[英]Error message in Isabelle/HOL

When applying the wrong tactic or the wrong deduction rule, the error message is usually too general: 当应用错误的策略或错误的扣除规则时,错误消息通常过于笼统:

Failed to apply initial proof method⌂

I am using Isabelle to teach natural deduction. 我正在使用伊莎贝尔教自然演绎。 When Isabelle complains, some students change the rule/tactic arbitrary without reflecting on the possible causes of the error. 当Isabelle抱怨时,一些学生会改变规则/策略,而不会反映错误的可能原因。 A more detailed error message could be part of the learning process of Isabelle, I think. 我想,更详细的错误信息可能是Isabelle学习过程的一部分。

How to make those error messages student friendly? 如何使这些错误消息学生友好? Does that require editing the source code or can it be managed by defining more expressive tactics of natural deduction? 这是否需要编辑源代码,还是可以通过定义更具表现力的自然演绎策略来管理?

Tactics in Isabelle can be thought of as chainable non-deterministic transformations of the goal state. 伊莎贝尔的战术可以被认为是目标状态的可链接的非确定性变换。 That means that the question of what specifically caused a tactic to fail is difficult to answer in general, and there is no mechanism to track such information in Isabelle's tactic system. 这意味着一般来说难以回答特定导致战术失败的问题,并且在伊莎贝尔的战术体系中没有机制来跟踪这些信息。 However, one could relatively easily modify existing tactics such that they can optionally output some tracing information. 但是,人们可以相对容易地修改现有策略,以便他们可以选择输出一些跟踪信息。

However, I have no idea what this information should be. 但是,我不知道这些信息应该是什么。 There are simple tactics such as rule where the reason why applying it fails is always that the rule that it is given cannot be unified with the goal (and possibly chained facts), and there are similarly simple tactics like intro , drule , frule , erule , and elim . 有一些简单的策略,例如rule ,其中应用它失败的原因始终是它给出的规则不能与目标(以及可能链接的事实)统一,并且有类似简单的策略,如introdrulefruleeruleelim Such unification-related problems can be debugged quite well sometimes using declare [[unify_trace_failure]] , which prints some tracing information every time a unification fails. 使用declare [[unify_trace_failure]]可以很好地调试这种与统一相关的问题,每次统一失败时都会打印一些跟踪信息。

With simp and auto , the situation is much less clear because of how many different things these methods can do. 有了simpauto ,由于这些方法可以做多少不同的事情,情况就不太清楚了。 Essentially, when the proof method could not be applied at all, it means that 'none of the things that simp and auto can do worked for this goal'. 基本上,当证明方法根本无法应用时,它意味着“没有任何simpauto的东西可以为这个目标起作用”。 For simp , this includes simplification, splitting, linear arithmetic, and probably a lot more things that I forgot. 对于simp ,这包括简化,拆分,线性算术,以及我忘记的更多事情。 For auto , it additionally includes classical reasoning with a certain search depth. 对于auto ,它还包括具有特定搜索深度的经典推理。 One cannot really say easily what specific thing went wrong when these methods fail. 当这些方法失败时,人们不能轻易说出具体的问题。

Some specialised tactics do print more specific error messages if something goes wrong, eg sat and smt sometimes print a special error message when they have found a counterexample to the goal, but I cannot even imagine what more helpful output for something like simp or auto would look like. 如果出现问题,一些专门的策略会打印出更具体的错误信息,例如satsmt有时会在找到目标的反例时打印一条特殊的错误信息,但我甚至无法想象对于像simpauto这样的东西会有什么更有帮助的输出看起来像。 If you have an idea, please do tell me. 如果您有任何想法,请告诉我。

I think this problem cannot really be solved with error messages; 我认为这个问题不能用错误信息真正解决; one must simply get to know the system and the tactics one uses better and understand what they do and when they fail. 一个人必须简单地了解一个人更好地使用的系统和策略,并了解他们做什么以及何时失败。 Perhaps it would be good to have a kind of catalogue of commonly-used tactics that mentions these things. 也许最好有一种常用战术的目录来提及这些事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM