I have a graph and need to, for every single node, enumerate all reachable nodes.
So essentially a verified implementation of this:
axiomatization f :: "('a × 'a) list ⇒ ('a × 'a) list" where
f_prop: "set (f rel) = (set rel)⇧+"
(An alternative would be a function that finds all reachable nodes from one single node, I'm just kind of assuming it's going to be less efficient if I need to call it for all nodes.)
Is efficiency really a criteria for you?
Less efficient is rarely a good design criterion for proof writing
Easier to write proofs is much more important
To add to that: Usually, when you want a verified efficient implemtation, you start from a simple abstract definition, and refine it down to more efficient code, e.g. via the Refinement framework in the AFP.
Efficiency is only a tiny bit important but tbh a simple factor of up to n won't matter. Enumerating all nodes from an initial node would be enough for me.
Last updated: Dec 21 2024 at 16:20 UTC