Translate C/C++ programs to equivalent Dafny code while preserving semantics and ensuring verification. Use when users ask to convert, translate, or port C/C++ code to Dafny, or when they need to formally verify C/C++ algorithms using Dafny's verification capabilities. Handles functions, structs, pointers, arrays, memory management, and ensures the generated Dafny code is well-typed, executable, verifiable, and can successfully run.
90
86%
Does it follow best practices?
Impact
96%
1.00xAverage score across 3 eval scenarios
Passed
No known issues
Loop invariants and verification annotations
array<int> type mapping
100%
100%
method for imperative code
100%
100%
requires preconditions
100%
100%
ensures postconditions
100%
100%
loop bounds invariant
100%
100%
loop progress invariant
100%
100%
modifies clause
100%
100%
preservation invariant in max
100%
100%
helper spec function
100%
100%
Struct translation and memory management
struct as class or datatype
100%
100%
distance as function
100%
100%
reads clause on function
100%
100%
modifies clause on mutating method
100%
100%
no malloc in Dafny
100%
100%
no NULL
100%
100%
ensures on mutating method
100%
100%
ensures on create_point
100%
100%
requires on scale_point
0%
0%
Type mapping and sorting verification
unsigned int to nat
100%
100%
float to real
100%
100%
explicit as conversion
100%
100%
multiset permutation postcondition
100%
100%
sorted postcondition
100%
100%
outer loop invariant
100%
100%
inner loop invariant
100%
100%
requires for division
100%
100%
modifies clause
100%
100%
0f00a4f
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.