Skip to content

@spec(name[, weight]) annotation  #2

@leouk

Description

@leouk

Nick, I wanted to suggest a new annotation. I thought to implement it in VDM_Toolkit but then wanted to share it here for thoughts/comments (or warnings!). :-)

A while ago I tried a visitor that would go over inv/pre/post etc and attempt to calculate some things. This largely works but can get clumsy/complicated - in fairness I wasn't as familiar with the LeafVisitors then.

For instance, the number of conjuncts (i.e. the number of proof goals that a specification part would entail) or disjuncts (i.e. the amount of assumption case analysis or consequence choices) to help identify the proof strategies needed when translating to Isabelle's proof scripts with ps2isa plugin.

Also, if the user "knew" about the complexity of certain constructs (e.g. iota, exists1 versus >=, + etc) in expressions, a (user-defined) weight could be given to the specification. This would then again help the proof strategy inference tool to know whether to try specific assisting tools (e.g., Pressburger or linear arithmetic decision procedures for >=, +, etc.) or not, or to suggest lemmas for the "heavier" operators/parts.

Can also be useful to "count" the specification "semantic" size (as opposed to the nominal LOC size).

What do you think? Is this (at least in the "simple" form of counting spec parts) doable in a reasonably simple visitor or am I kidding myself over the complexity of the annotation visitation side?

Best,
Leo

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions