Cortex.Wire.Planner.Construction


On this page
  1. Overview
  2. Context
  3. Theorem Split
  4. Runtime-Style Node Namespacing
  5. Relation Endpoint Closure
  6. Anchor Membership
  7. Constructed Planned Delta
Imports
import Cortex.Wire.Planner import Mathlib.Data.List.Basic

Overview

Runtime-shaped construction for Wire rewrite admission.

Context

Cortex.Wire.Planner names the proof contract established by executable planning. This module moves one step closer to the runtime: it defines a concrete namespaced-node model, constructs a proof-side planned delta from the relation-level planner model, and proves that the constructed delta supplies the bulk of RuntimePlannerConstruction.

The theorem surface remains denotational. The constructed graph topology is a non-extractable Graph representative for the finite planned relation; correctness is stated as denote topology = plannedFinalRelation ..., not raw AST equality. The executable runtime computes its own topology and must establish denotational equality to this representative.

Theorem Split

The page first records relation endpoint-closure lemmas needed to realize planned relations as graphs. It then defines runtime-style namespaced node ids and finally constructs planned deltas whose topology, diff sets, definitions, entry/exit sets, and costs are definitionally tied to the planner model.

namespace Cortex.Wireopen Cortex.Graph

Runtime-Style Node Namespacing

RuntimeNodeId models executable node ids as namespace segments.

The Haskell runtime serializes the same shape as colon-delimited Text. Keeping segments structured in Lean makes delimiter-freedom explicit: a local inserted id is a single non-empty segment containing no reserved delimiter, and namespacing appends that segment below the anchor path. Fixed-anchor injectivity is the only namespace theorem carried by the policy; disjointness across different anchors is established by per-rewrite freshness against the current topology.

structure RuntimeNodeId where

Namespace path segments.

segments : List String deriving DecidableEq, Reprnamespace RuntimeNodeId

Runtime namespace delimiter mirrored from the Haskell NodeId encoding.

def namespaceDelimiter : Char := ':'

segmentAllowed segment mirrors the executable local-node syntax check.

def segmentAllowed (segment : String) : Prop := segment.isEmpty = false segment.contains namespaceDelimiter = false

A local inserted node id is one non-empty segment with no namespace delimiter.

def localAllowed (node : RuntimeNodeId) : Prop := segment, node.segments = [segment] segmentAllowed segment

Namespace a local inserted node under an anchor.

def namespaceNode (anchor localNode : RuntimeNodeId) : RuntimeNodeId := { segments := anchor.segments ++ localNode.segments }

Fixed-anchor namespacing is injective.

theorem namespaceNode_injective (anchor : RuntimeNodeId) : Function.Injective (namespaceNode anchor) := anchor:RuntimeNodeIdFunction.Injective anchor.namespaceNode intro left anchor:RuntimeNodeIdleft:RuntimeNodeIdright:RuntimeNodeIdanchor.namespaceNode left = anchor.namespaceNode right left = right anchor:RuntimeNodeIdleft:RuntimeNodeIdright:RuntimeNodeIdhNamespaced:anchor.namespaceNode left = anchor.namespaceNode rightleft = right cases left with anchor:RuntimeNodeIdright:RuntimeNodeIdleftSegments:List StringhNamespaced:anchor.namespaceNode { segments := leftSegments } = anchor.namespaceNode right{ segments := leftSegments } = right cases right with anchor:RuntimeNodeIdleftSegments:List StringrightSegments:List StringhNamespaced:anchor.namespaceNode { segments := leftSegments } = anchor.namespaceNode { segments := rightSegments }{ segments := leftSegments } = { segments := rightSegments } cases anchor with leftSegments:List StringrightSegments:List StringanchorSegments:List StringhNamespaced:{ segments := anchorSegments }.namespaceNode { segments := leftSegments } = { segments := anchorSegments }.namespaceNode { segments := rightSegments }{ segments := leftSegments } = { segments := rightSegments } leftSegments:List StringrightSegments:List StringanchorSegments:List StringhNamespaced:{ segments := anchorSegments }.namespaceNode { segments := leftSegments } = { segments := anchorSegments }.namespaceNode { segments := rightSegments }hSegments:anchorSegments ++ leftSegments = anchorSegments ++ rightSegments{ segments := leftSegments } = { segments := rightSegments } leftSegments:List StringrightSegments:List StringanchorSegments:List StringhNamespaced:{ segments := anchorSegments }.namespaceNode { segments := leftSegments } = { segments := anchorSegments }.namespaceNode { segments := rightSegments }hSegments:anchorSegments ++ leftSegments = anchorSegments ++ rightSegmentshLocalSegments:leftSegments = rightSegments{ segments := leftSegments } = { segments := rightSegments } leftSegments:List StringanchorSegments:List StringhNamespaced:{ segments := anchorSegments }.namespaceNode { segments := leftSegments } = { segments := anchorSegments }.namespaceNode { segments := leftSegments }hSegments:anchorSegments ++ leftSegments = anchorSegments ++ leftSegments{ segments := leftSegments } = { segments := leftSegments } All goals completed! 🐙

The concrete runtime namespace policy for structured node ids.

def namespacePolicy : RuntimeNamespacePolicy RuntimeNodeId := { namespaceNode := namespaceNode localAllowed := localAllowed namespaceNode_injective := namespaceNode_injective }end RuntimeNodeId

Relation Endpoint Closure

section EndpointClosurevariable {node : Type}variable [DecidableEq node]

Relation overlay preserves endpoint closure.

theorem relation_edgeEndpoints_overlay {left right : Relation node} (hLeft : Relation.EdgeEndpointsInVertices left) (hRight : Relation.EdgeEndpointsInVertices right) : Relation.EdgeEndpointsInVertices (Relation.overlay left right) := node:Typeinst✝:DecidableEq nodeleft:Relation noderight:Relation nodehLeft:left.EdgeEndpointsInVerticeshRight:right.EdgeEndpointsInVertices(left.overlay right).EdgeEndpointsInVertices intro edge node:Typeinst✝:DecidableEq nodeleft:Relation noderight:Relation nodehLeft:left.EdgeEndpointsInVerticeshRight:right.EdgeEndpointsInVerticesedge:node × nodehEdge:edge (left.overlay right).edgesedge.1 (left.overlay right).vertices edge.2 (left.overlay right).vertices node:Typeinst✝:DecidableEq nodeleft:Relation noderight:Relation nodehLeft:left.EdgeEndpointsInVerticeshRight:right.EdgeEndpointsInVerticesedge:node × nodehEdge:edge left.edges edge right.edges(edge.1 left.vertices edge.1 right.vertices) (edge.2 left.vertices edge.2 right.vertices) node:Typeinst✝:DecidableEq nodeleft:Relation noderight:Relation nodehLeft:left.EdgeEndpointsInVerticeshRight:right.EdgeEndpointsInVerticesedge:node × nodehEdge:edge left.edges(edge.1 left.vertices edge.1 right.vertices) (edge.2 left.vertices edge.2 right.vertices)node:Typeinst✝:DecidableEq nodeleft:Relation noderight:Relation nodehLeft:left.EdgeEndpointsInVerticeshRight:right.EdgeEndpointsInVerticesedge:node × nodehEdge:edge right.edges(edge.1 left.vertices edge.1 right.vertices) (edge.2 left.vertices edge.2 right.vertices) node:Typeinst✝:DecidableEq nodeleft:Relation noderight:Relation nodehLeft:left.EdgeEndpointsInVerticeshRight:right.EdgeEndpointsInVerticesedge:node × nodehEdge:edge left.edges(edge.1 left.vertices edge.1 right.vertices) (edge.2 left.vertices edge.2 right.vertices) All goals completed! 🐙 node:Typeinst✝:DecidableEq nodeleft:Relation noderight:Relation nodehLeft:left.EdgeEndpointsInVerticeshRight:right.EdgeEndpointsInVerticesedge:node × nodehEdge:edge right.edges(edge.1 left.vertices edge.1 right.vertices) (edge.2 left.vertices edge.2 right.vertices) All goals completed! 🐙

Relation connect preserves endpoint closure.

theorem relation_edgeEndpoints_connect {left right : Relation node} (hLeft : Relation.EdgeEndpointsInVertices left) (hRight : Relation.EdgeEndpointsInVertices right) : Relation.EdgeEndpointsInVertices (Relation.connect left right) := node:Typeinst✝:DecidableEq nodeleft:Relation noderight:Relation nodehLeft:left.EdgeEndpointsInVerticeshRight:right.EdgeEndpointsInVertices(left.connect right).EdgeEndpointsInVertices intro edge node:Typeinst✝:DecidableEq nodeleft:Relation noderight:Relation nodehLeft:left.EdgeEndpointsInVerticeshRight:right.EdgeEndpointsInVerticesedge:node × nodehEdge:edge (left.connect right).edgesedge.1 (left.connect right).vertices edge.2 (left.connect right).vertices node:Typeinst✝:DecidableEq nodeleft:Relation noderight:Relation nodehLeft:left.EdgeEndpointsInVerticeshRight:right.EdgeEndpointsInVerticesedge:node × nodehEdge:(edge left.edges edge right.edges) edge.1 left.vertices edge.2 right.vertices(edge.1 left.vertices edge.1 right.vertices) (edge.2 left.vertices edge.2 right.vertices) node:Typeinst✝:DecidableEq nodeleft:Relation noderight:Relation nodehLeft:left.EdgeEndpointsInVerticeshRight:right.EdgeEndpointsInVerticesedge:node × nodehOldEdge:edge left.edges edge right.edges(edge.1 left.vertices edge.1 right.vertices) (edge.2 left.vertices edge.2 right.vertices)node:Typeinst✝:DecidableEq nodeleft:Relation noderight:Relation nodehLeft:left.EdgeEndpointsInVerticeshRight:right.EdgeEndpointsInVerticesedge:node × nodehCross:edge.1 left.vertices edge.2 right.vertices(edge.1 left.vertices edge.1 right.vertices) (edge.2 left.vertices edge.2 right.vertices) node:Typeinst✝:DecidableEq nodeleft:Relation noderight:Relation nodehLeft:left.EdgeEndpointsInVerticeshRight:right.EdgeEndpointsInVerticesedge:node × nodehOldEdge:edge left.edges edge right.edges(edge.1 left.vertices edge.1 right.vertices) (edge.2 left.vertices edge.2 right.vertices) node:Typeinst✝:DecidableEq nodeleft:Relation noderight:Relation nodehLeft:left.EdgeEndpointsInVerticeshRight:right.EdgeEndpointsInVerticesedge:node × nodehEdge:edge left.edges(edge.1 left.vertices edge.1 right.vertices) (edge.2 left.vertices edge.2 right.vertices)node:Typeinst✝:DecidableEq nodeleft:Relation noderight:Relation nodehLeft:left.EdgeEndpointsInVerticeshRight:right.EdgeEndpointsInVerticesedge:node × nodehEdge:edge right.edges(edge.1 left.vertices edge.1 right.vertices) (edge.2 left.vertices edge.2 right.vertices) node:Typeinst✝:DecidableEq nodeleft:Relation noderight:Relation nodehLeft:left.EdgeEndpointsInVerticeshRight:right.EdgeEndpointsInVerticesedge:node × nodehEdge:edge left.edges(edge.1 left.vertices edge.1 right.vertices) (edge.2 left.vertices edge.2 right.vertices) All goals completed! 🐙 node:Typeinst✝:DecidableEq nodeleft:Relation noderight:Relation nodehLeft:left.EdgeEndpointsInVerticeshRight:right.EdgeEndpointsInVerticesedge:node × nodehEdge:edge right.edges(edge.1 left.vertices edge.1 right.vertices) (edge.2 left.vertices edge.2 right.vertices) All goals completed! 🐙 node:Typeinst✝:DecidableEq nodeleft:Relation noderight:Relation nodehLeft:left.EdgeEndpointsInVerticeshRight:right.EdgeEndpointsInVerticesedge:node × nodehCross:edge.1 left.vertices edge.2 right.vertices(edge.1 left.vertices edge.1 right.vertices) (edge.2 left.vertices edge.2 right.vertices) All goals completed! 🐙

Denotations of graph expressions are endpoint-closed relations.

theorem denote_edgeEndpointsInVertices (g : Graph node) : Relation.EdgeEndpointsInVertices (denote g) := node:Typeinst✝:DecidableEq nodeg:Graph node(denote g).EdgeEndpointsInVertices induction g with node:Typeinst✝:DecidableEq node(denote Graph.empty).EdgeEndpointsInVertices intro edge node:Typeinst✝:DecidableEq nodeedge:node × nodehEdge:edge (denote Graph.empty).edgesedge.1 (denote Graph.empty).vertices edge.2 (denote Graph.empty).vertices All goals completed! 🐙 node:Typeinst✝:DecidableEq nodevertex:node(denote (Graph.vertex vertex)).EdgeEndpointsInVertices intro edge node:Typeinst✝:DecidableEq nodevertex:nodeedge:node × nodehEdge:edge (denote (Graph.vertex vertex)).edgesedge.1 (denote (Graph.vertex vertex)).vertices edge.2 (denote (Graph.vertex vertex)).vertices All goals completed! 🐙 node:Typeinst✝:DecidableEq nodeleft:Graph noderight:Graph nodeleft_ih:(denote left).EdgeEndpointsInVerticesright_ih:(denote right).EdgeEndpointsInVertices(denote (left.overlay right)).EdgeEndpointsInVertices node:Typeinst✝:DecidableEq nodeleft:Graph noderight:Graph nodeleft_ih:(denote left).EdgeEndpointsInVerticesright_ih:(denote right).EdgeEndpointsInVertices((denote left).overlay (denote right)).EdgeEndpointsInVertices All goals completed! 🐙 node:Typeinst✝:DecidableEq nodeleft:Graph noderight:Graph nodeleft_ih:(denote left).EdgeEndpointsInVerticesright_ih:(denote right).EdgeEndpointsInVertices(denote (left.connect right)).EdgeEndpointsInVertices node:Typeinst✝:DecidableEq nodeleft:Graph noderight:Graph nodeleft_ih:(denote left).EdgeEndpointsInVerticesright_ih:(denote right).EdgeEndpointsInVertices((denote left).connect (denote right)).EdgeEndpointsInVertices All goals completed! 🐙

Removing one vertex and its incident edges preserves endpoint closure.

theorem relation_edgeEndpoints_removeVertex {relation : Relation node} {vertex : node} (hRelation : Relation.EdgeEndpointsInVertices relation) : Relation.EdgeEndpointsInVertices (removeVertexFromRelation relation vertex) := node:Typeinst✝:DecidableEq noderelation:Relation nodevertex:nodehRelation:relation.EdgeEndpointsInVertices(removeVertexFromRelation relation vertex).EdgeEndpointsInVertices intro edge node:Typeinst✝:DecidableEq noderelation:Relation nodevertex:nodehRelation:relation.EdgeEndpointsInVerticesedge:node × nodehEdge:edge (removeVertexFromRelation relation vertex).edgesedge.1 (removeVertexFromRelation relation vertex).vertices edge.2 (removeVertexFromRelation relation vertex).vertices node:Typeinst✝:DecidableEq noderelation:Relation nodevertex:nodehRelation:relation.EdgeEndpointsInVerticesedge:node × nodehEdge:edge relation.edges edge.1 vertex edge.2 vertex(edge.1 vertex edge.1 relation.vertices) edge.2 vertex edge.2 relation.vertices node:Typeinst✝:DecidableEq noderelation:Relation nodevertex:nodehRelation:relation.EdgeEndpointsInVerticesedge:node × nodehOldEdge:edge relation.edgeshSourceNe:edge.1 vertexhTargetNe:edge.2 vertex(edge.1 vertex edge.1 relation.vertices) edge.2 vertex edge.2 relation.vertices All goals completed! 🐙

Removing outgoing edges preserves endpoint closure.

theorem relation_edgeEndpoints_removeOutgoing {relation : Relation node} {vertex : node} (hRelation : Relation.EdgeEndpointsInVertices relation) : Relation.EdgeEndpointsInVertices (removeOutgoingFromRelation relation vertex) := node:Typeinst✝:DecidableEq noderelation:Relation nodevertex:nodehRelation:relation.EdgeEndpointsInVertices(removeOutgoingFromRelation relation vertex).EdgeEndpointsInVertices intro edge node:Typeinst✝:DecidableEq noderelation:Relation nodevertex:nodehRelation:relation.EdgeEndpointsInVerticesedge:node × nodehEdge:edge (removeOutgoingFromRelation relation vertex).edgesedge.1 (removeOutgoingFromRelation relation vertex).vertices edge.2 (removeOutgoingFromRelation relation vertex).vertices node:Typeinst✝:DecidableEq noderelation:Relation nodevertex:nodehRelation:relation.EdgeEndpointsInVerticesedge:node × nodehEdge:edge relation.edges edge.1 vertexedge.1 relation.vertices edge.2 relation.vertices All goals completed! 🐙

Adding edges while also adding their endpoints preserves endpoint closure.

theorem relation_edgeEndpoints_addEdges {relation : Relation node} {edges : Finset (node × node)} (hRelation : Relation.EdgeEndpointsInVertices relation) : Relation.EdgeEndpointsInVertices (addEdgesToRelation relation edges) := node:Typeinst✝:DecidableEq noderelation:Relation nodeedges:Finset (node × node)hRelation:relation.EdgeEndpointsInVertices(addEdgesToRelation relation edges).EdgeEndpointsInVertices intro edge node:Typeinst✝:DecidableEq noderelation:Relation nodeedges:Finset (node × node)hRelation:relation.EdgeEndpointsInVerticesedge:node × nodehEdge:edge (addEdgesToRelation relation edges).edgesedge.1 (addEdgesToRelation relation edges).vertices edge.2 (addEdgesToRelation relation edges).vertices node:Typeinst✝:DecidableEq noderelation:Relation nodeedges:Finset (node × node)hRelation:relation.EdgeEndpointsInVerticesedge:node × nodehEdge:edge relation.edges edge edges((edge.1 relation.vertices edge.1 Finset.image Prod.fst edges) edge.1 Finset.image Prod.snd edges) ((edge.2 relation.vertices edge.2 Finset.image Prod.fst edges) edge.2 Finset.image Prod.snd edges) node:Typeinst✝:DecidableEq noderelation:Relation nodeedges:Finset (node × node)hRelation:relation.EdgeEndpointsInVerticesedge:node × nodehOldEdge:edge relation.edges((edge.1 relation.vertices edge.1 Finset.image Prod.fst edges) edge.1 Finset.image Prod.snd edges) ((edge.2 relation.vertices edge.2 Finset.image Prod.fst edges) edge.2 Finset.image Prod.snd edges)node:Typeinst✝:DecidableEq noderelation:Relation nodeedges:Finset (node × node)hRelation:relation.EdgeEndpointsInVerticesedge:node × nodehAddedEdge:edge edges((edge.1 relation.vertices edge.1 Finset.image Prod.fst edges) edge.1 Finset.image Prod.snd edges) ((edge.2 relation.vertices edge.2 Finset.image Prod.fst edges) edge.2 Finset.image Prod.snd edges) node:Typeinst✝:DecidableEq noderelation:Relation nodeedges:Finset (node × node)hRelation:relation.EdgeEndpointsInVerticesedge:node × nodehOldEdge:edge relation.edges((edge.1 relation.vertices edge.1 Finset.image Prod.fst edges) edge.1 Finset.image Prod.snd edges) ((edge.2 relation.vertices edge.2 Finset.image Prod.fst edges) edge.2 Finset.image Prod.snd edges) All goals completed! 🐙 node:Typeinst✝:DecidableEq noderelation:Relation nodeedges:Finset (node × node)hRelation:relation.EdgeEndpointsInVerticesedge:node × nodehAddedEdge:edge edges((edge.1 relation.vertices edge.1 Finset.image Prod.fst edges) edge.1 Finset.image Prod.snd edges) ((edge.2 relation.vertices edge.2 Finset.image Prod.fst edges) edge.2 Finset.image Prod.snd edges) All goals completed! 🐙

The relation-level planner construction always produces an endpoint-closed relation.

theorem plannedFinalRelation_edgeEndpointsInVertices (context : Graph node) (rewrite : GraphRewrite node) : Relation.EdgeEndpointsInVertices (plannedFinalRelation context rewrite) := node:Typeinst✝:DecidableEq nodecontext:Graph noderewrite:GraphRewrite node(plannedFinalRelation context rewrite).EdgeEndpointsInVertices cases rewrite with node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodemode:ExpansionModespec:SubgraphSpec node(plannedFinalRelation context (GraphRewrite.expandNode anchor mode spec)).EdgeEndpointsInVertices cases mode with node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec node(plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).EdgeEndpointsInVertices node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec node(addEdgesToRelation (addEdgesToRelation ((removeVertexFromRelation (denote context) anchor).overlay (denote spec.topology)) (predecessorsOf (denote context) anchor ×ˢ spec.entryNodes)) (spec.exitNodes ×ˢ successorsOf (denote context) anchor)).EdgeEndpointsInVertices All goals completed! 🐙 node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec node(plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).EdgeEndpointsInVertices node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec node(addEdgesToRelation (addEdgesToRelation ((removeOutgoingFromRelation (denote context) anchor).overlay (denote spec.topology)) ({anchor} ×ˢ spec.entryNodes)) (spec.exitNodes ×ˢ successorsOf (denote context) anchor)).EdgeEndpointsInVertices All goals completed! 🐙 node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec node(plannedFinalRelation context (GraphRewrite.appendAfter anchor spec)).EdgeEndpointsInVertices node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec node(addEdgesToRelation (addEdgesToRelation ((removeOutgoingFromRelation (denote context) anchor).overlay (denote spec.topology)) ({anchor} ×ˢ spec.entryNodes)) (spec.exitNodes ×ˢ successorsOf (denote context) anchor)).EdgeEndpointsInVertices All goals completed! 🐙end EndpointClosure

Anchor Membership

section AnchorMembershipvariable {node : Type}variable [DecidableEq node]

Acyclic source topologies have no direct self-loop at the rewrite anchor.

theorem anchor_noSelfLoop_of_acyclic {context : Graph node} {anchor : node} (hSourceAcyclic : Acyclic context) : (anchor, anchor) (denote context).edges := node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodehSourceAcyclic:Acyclic context(anchor, anchor) (denote context).edges node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodehSourceAcyclic:Acyclic contexthLoop:(anchor, anchor) (denote context).edgesFalse All goals completed! 🐙

Without a self-loop, an anchor is not its own direct predecessor.

theorem anchor_not_mem_predecessorsOf_of_noSelfLoop {relation : Relation node} {anchor : node} (hNoSelfLoop : (anchor, anchor) relation.edges) : anchor predecessorsOf relation anchor := node:Typeinst✝:DecidableEq noderelation:Relation nodeanchor:nodehNoSelfLoop:(anchor, anchor) relation.edgesanchor predecessorsOf relation anchor node:Typeinst✝:DecidableEq noderelation:Relation nodeanchor:nodehNoSelfLoop:(anchor, anchor) relation.edgeshPred:anchor predecessorsOf relation anchorFalse node:Typeinst✝:DecidableEq noderelation:Relation nodeanchor:nodehNoSelfLoop:(anchor, anchor) relation.edgeshPred: a, (a relation.edges a.2 = anchor) a.1 = anchorFalse node:Typeinst✝:DecidableEq noderelation:Relation nodeanchor:nodehNoSelfLoop:(anchor, anchor) relation.edgesedge:node × nodehEdge:edge relation.edges edge.2 = anchorhSource:edge.1 = anchorFalse node:Typeinst✝:DecidableEq noderelation:Relation nodeanchor:nodehNoSelfLoop:(anchor, anchor) relation.edgessource:nodetarget:nodehEdge:(source, target) relation.edges (source, target).2 = anchorhSource:(source, target).1 = anchorFalse node:Typeinst✝:DecidableEq noderelation:Relation nodeanchor:nodehNoSelfLoop:(anchor, anchor) relation.edgessource:nodetarget:nodehEdge:(source, target) relation.edges (source, target).2 = anchorhSource:source = anchorFalse node:Typeinst✝:DecidableEq noderelation:Relation nodeanchor:nodehNoSelfLoop:(anchor, anchor) relation.edgestarget:nodehEdge:(anchor, target) relation.edges (anchor, target).2 = anchorFalse node:Typeinst✝:DecidableEq noderelation:Relation nodeanchor:nodehNoSelfLoop:(anchor, anchor) relation.edgestarget:nodehEdge:(anchor, target) relation.edges target = anchorFalse node:Typeinst✝:DecidableEq noderelation:Relation nodeanchor:nodehNoSelfLoop:(anchor, anchor) relation.edgestarget:nodehEdge:(anchor, anchor) relation.edges anchor = anchorFalse All goals completed! 🐙

Without a self-loop, an anchor is not its own direct successor.

theorem anchor_not_mem_successorsOf_of_noSelfLoop {relation : Relation node} {anchor : node} (hNoSelfLoop : (anchor, anchor) relation.edges) : anchor successorsOf relation anchor := node:Typeinst✝:DecidableEq noderelation:Relation nodeanchor:nodehNoSelfLoop:(anchor, anchor) relation.edgesanchor successorsOf relation anchor node:Typeinst✝:DecidableEq noderelation:Relation nodeanchor:nodehNoSelfLoop:(anchor, anchor) relation.edgeshSucc:anchor successorsOf relation anchorFalse node:Typeinst✝:DecidableEq noderelation:Relation nodeanchor:nodehNoSelfLoop:(anchor, anchor) relation.edgeshSucc: a, (a relation.edges a.1 = anchor) a.2 = anchorFalse node:Typeinst✝:DecidableEq noderelation:Relation nodeanchor:nodehNoSelfLoop:(anchor, anchor) relation.edgesedge:node × nodehEdge:edge relation.edges edge.1 = anchorhTarget:edge.2 = anchorFalse node:Typeinst✝:DecidableEq noderelation:Relation nodeanchor:nodehNoSelfLoop:(anchor, anchor) relation.edgessource:nodetarget:nodehEdge:(source, target) relation.edges (source, target).1 = anchorhTarget:(source, target).2 = anchorFalse node:Typeinst✝:DecidableEq noderelation:Relation nodeanchor:nodehNoSelfLoop:(anchor, anchor) relation.edgessource:nodetarget:nodehEdge:(source, target) relation.edges (source, target).1 = anchorhTarget:target = anchorFalse node:Typeinst✝:DecidableEq noderelation:Relation nodeanchor:nodehNoSelfLoop:(anchor, anchor) relation.edgessource:nodehEdge:(source, anchor) relation.edges (source, anchor).1 = anchorFalse node:Typeinst✝:DecidableEq noderelation:Relation nodeanchor:nodehNoSelfLoop:(anchor, anchor) relation.edgessource:nodehEdge:(source, anchor) relation.edges source = anchorFalse node:Typeinst✝:DecidableEq noderelation:Relation nodeanchor:nodehNoSelfLoop:(anchor, anchor) relation.edgessource:nodehEdge:(anchor, anchor) relation.edges anchor = anchorFalse All goals completed! 🐙

Direct predecessors of a denoted graph node are vertices of the denoted graph.

theorem predecessorsOf_mem_vertices {context : Graph node} {target predecessor : node} (hPredecessor : predecessor predecessorsOf (denote context) target) : predecessor (denote context).vertices := node:Typeinst✝:DecidableEq nodecontext:Graph nodetarget:nodepredecessor:nodehPredecessor:predecessor predecessorsOf (denote context) targetpredecessor (denote context).vertices node:Typeinst✝:DecidableEq nodecontext:Graph nodetarget:nodepredecessor:nodehPredecessor: a, (a (denote context).edges a.2 = target) a.1 = predecessorpredecessor (denote context).vertices node:Typeinst✝:DecidableEq nodecontext:Graph nodetarget:nodepredecessor:nodeedge:node × nodehEdge:edge (denote context).edges edge.2 = targethSource:edge.1 = predecessorpredecessor (denote context).vertices node:Typeinst✝:DecidableEq nodecontext:Graph nodetarget✝:nodepredecessor:nodesource:nodetarget:nodehEdge:(source, target) (denote context).edges (source, target).2 = target✝hSource:(source, target).1 = predecessorpredecessor (denote context).vertices node:Typeinst✝:DecidableEq nodecontext:Graph nodetarget✝:nodepredecessor:nodesource:nodetarget:nodehEdge:(source, target) (denote context).edges (source, target).2 = target✝hSource:source = predecessorpredecessor (denote context).vertices node:Typeinst✝:DecidableEq nodecontext:Graph nodetarget✝:nodepredecessor:nodetarget:nodehEdge:(predecessor, target) (denote context).edges (predecessor, target).2 = target✝predecessor (denote context).vertices All goals completed! 🐙

Direct successors of a denoted graph node are vertices of the denoted graph.

theorem successorsOf_mem_vertices {context : Graph node} {target successor : node} (hSuccessor : successor successorsOf (denote context) target) : successor (denote context).vertices := node:Typeinst✝:DecidableEq nodecontext:Graph nodetarget:nodesuccessor:nodehSuccessor:successor successorsOf (denote context) targetsuccessor (denote context).vertices node:Typeinst✝:DecidableEq nodecontext:Graph nodetarget:nodesuccessor:nodehSuccessor: a, (a (denote context).edges a.1 = target) a.2 = successorsuccessor (denote context).vertices node:Typeinst✝:DecidableEq nodecontext:Graph nodetarget:nodesuccessor:nodeedge:node × nodehEdge:edge (denote context).edges edge.1 = targethTarget:edge.2 = successorsuccessor (denote context).vertices node:Typeinst✝:DecidableEq nodecontext:Graph nodetarget✝:nodesuccessor:nodesource:nodetarget:nodehEdge:(source, target) (denote context).edges (source, target).1 = target✝hTarget:(source, target).2 = successorsuccessor (denote context).vertices node:Typeinst✝:DecidableEq nodecontext:Graph nodetarget✝:nodesuccessor:nodesource:nodetarget:nodehEdge:(source, target) (denote context).edges (source, target).1 = target✝hTarget:target = successorsuccessor (denote context).vertices node:Typeinst✝:DecidableEq nodecontext:Graph nodetarget:nodesuccessor:nodesource:nodehEdge:(source, successor) (denote context).edges (source, successor).1 = targetsuccessor (denote context).vertices All goals completed! 🐙

Replacement rewrites have exactly old-minus-anchor plus inserted final vertices.

theorem plannedFinalRelation_vertices_replace {context : Graph node} {anchor : node} {spec : SubgraphSpec node} (hNoSelfLoop : (anchor, anchor) (denote context).edges) (hEntryInside : NodesInside spec.entryNodes spec.topology) (hExitInside : NodesInside spec.exitNodes spec.topology) : (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices = (denote context).vertices.erase anchor (denote spec.topology).vertices := node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topology(plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices = (denote context).vertices.erase anchor (denote spec.topology).vertices node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topology (a : node), a (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices a (denote context).vertices.erase anchor (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝node (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices node (denote context).vertices.erase anchor (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝node (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices node (denote context).vertices.erase anchor (denote spec.topology).verticesnode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝node (denote context).vertices.erase anchor (denote spec.topology).vertices node (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝node (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices node (denote context).vertices.erase anchor (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hFinal:node (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).verticesnode (denote context).vertices.erase anchor (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hFinal:((((node anchor node (denote context).vertices node (denote spec.topology).vertices) a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.1 = node) a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.2 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = nodenode anchor node (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hBaseOrInserted:node anchor node (denote context).vertices node (denote spec.topology).verticesnode anchor node (denote context).vertices node (denote spec.topology).verticesnode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hEntrySource: a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.1 = nodenode anchor node (denote context).vertices node (denote spec.topology).verticesnode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hEntryTarget: a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.2 = nodenode anchor node (denote context).vertices node (denote spec.topology).verticesnode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hExitSource: a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = nodenode anchor node (denote context).vertices node (denote spec.topology).verticesnode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hExitTarget: a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = nodenode anchor node (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hBaseOrInserted:node anchor node (denote context).vertices node (denote spec.topology).verticesnode anchor node (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hBase:node anchor node (denote context).verticesnode anchor node (denote context).vertices node (denote spec.topology).verticesnode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hInserted:node (denote spec.topology).verticesnode anchor node (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hBase:node anchor node (denote context).verticesnode anchor node (denote context).vertices node (denote spec.topology).vertices All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hInserted:node (denote spec.topology).verticesnode anchor node (denote context).vertices node (denote spec.topology).vertices All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hEntrySource: a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.1 = nodenode anchor node (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝edge:node✝ × node✝hEdge:edge.1 predecessorsOf (denote context) anchor edge.2 spec.entryNodeshSource:edge.1 = nodenode anchor node (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝source:node_entry:nodehEdge:(source, _entry).1 predecessorsOf (denote context) anchor (source, _entry).2 spec.entryNodeshSource:(source, _entry).1 = nodenode anchor node (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝source:node_entry:nodehEdge:(source, _entry).1 predecessorsOf (denote context) anchor (source, _entry).2 spec.entryNodeshSource:source = nodenode anchor node (denote context).vertices node (denote spec.topology).vertices have hPredecessor : node predecessorsOf (denote context) anchor := node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topology(plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices = (denote context).vertices.erase anchor (denote spec.topology).vertices All goals completed! 🐙 have hNodeNeAnchor : node anchor := node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topology(plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices = (denote context).vertices.erase anchor (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝source:node_entry:nodehEdge:(source, _entry).1 predecessorsOf (denote context) anchor (source, _entry).2 spec.entryNodeshSource:source = nodehPredecessor:node predecessorsOf (denote context) anchorhNodeEq:node = anchorFalse node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝source:node_entry:nodehEdge:(source, _entry).1 predecessorsOf (denote context) anchor (source, _entry).2 spec.entryNodeshSource:source = nodehPredecessor:anchor predecessorsOf (denote context) anchorhNodeEq:node = anchorFalse All goals completed! 🐙 All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hEntryTarget: a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.2 = nodenode anchor node (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝edge:node✝ × node✝hEdge:edge.1 predecessorsOf (denote context) anchor edge.2 spec.entryNodeshEntry:edge.2 = nodenode anchor node (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝_source:nodeentry:nodehEdge:(_source, entry).1 predecessorsOf (denote context) anchor (_source, entry).2 spec.entryNodeshEntry:(_source, entry).2 = nodenode anchor node (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝_source:nodeentry:nodehEdge:(_source, entry).1 predecessorsOf (denote context) anchor (_source, entry).2 spec.entryNodeshEntry:entry = nodenode anchor node (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝_source:nodeentry:nodehEdge:(_source, entry).1 predecessorsOf (denote context) anchor (_source, entry).2 spec.entryNodeshEntry:entry = nodeentry anchor entry (denote context).vertices entry (denote spec.topology).vertices All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hExitSource: a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = nodenode anchor node (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝edge:node✝ × node✝hEdge:edge.1 spec.exitNodes edge.2 successorsOf (denote context) anchorhExit:edge.1 = nodenode anchor node (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝exit:node_successor:nodehEdge:(exit, _successor).1 spec.exitNodes (exit, _successor).2 successorsOf (denote context) anchorhExit:(exit, _successor).1 = nodenode anchor node (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝exit:node_successor:nodehEdge:(exit, _successor).1 spec.exitNodes (exit, _successor).2 successorsOf (denote context) anchorhExit:exit = nodenode anchor node (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝exit:node_successor:nodehEdge:(exit, _successor).1 spec.exitNodes (exit, _successor).2 successorsOf (denote context) anchorhExit:exit = nodeexit anchor exit (denote context).vertices exit (denote spec.topology).vertices All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hExitTarget: a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = nodenode anchor node (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝edge:node✝ × node✝hEdge:edge.1 spec.exitNodes edge.2 successorsOf (denote context) anchorhSuccessor:edge.2 = nodenode anchor node (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝_exit:nodesuccessor:nodehEdge:(_exit, successor).1 spec.exitNodes (_exit, successor).2 successorsOf (denote context) anchorhSuccessor:(_exit, successor).2 = nodenode anchor node (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝_exit:nodesuccessor:nodehEdge:(_exit, successor).1 spec.exitNodes (_exit, successor).2 successorsOf (denote context) anchorhSuccessor:successor = nodenode anchor node (denote context).vertices node (denote spec.topology).vertices have hSuccessorMem : node successorsOf (denote context) anchor := node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topology(plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices = (denote context).vertices.erase anchor (denote spec.topology).vertices All goals completed! 🐙 have hNodeNeAnchor : node anchor := node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topology(plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices = (denote context).vertices.erase anchor (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝_exit:nodesuccessor:nodehEdge:(_exit, successor).1 spec.exitNodes (_exit, successor).2 successorsOf (denote context) anchorhSuccessor:successor = nodehSuccessorMem:node successorsOf (denote context) anchorhNodeEq:node = anchorFalse node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝_exit:nodesuccessor:nodehEdge:(_exit, successor).1 spec.exitNodes (_exit, successor).2 successorsOf (denote context) anchorhSuccessor:successor = nodehSuccessorMem:anchor successorsOf (denote context) anchorhNodeEq:node = anchorFalse All goals completed! 🐙 All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝node (denote context).vertices.erase anchor (denote spec.topology).vertices node (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hUnion:node (denote context).vertices.erase anchor (denote spec.topology).verticesnode (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hUnion:node anchor node (denote context).vertices node (denote spec.topology).vertices((((node anchor node (denote context).vertices node (denote spec.topology).vertices) a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.1 = node) a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.2 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = node node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hBase:node anchor node (denote context).vertices((((node anchor node (denote context).vertices node (denote spec.topology).vertices) a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.1 = node) a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.2 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = nodenode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hInserted:node (denote spec.topology).vertices((((node anchor node (denote context).vertices node (denote spec.topology).vertices) a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.1 = node) a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.2 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = node node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hBase:node anchor node (denote context).vertices((((node anchor node (denote context).vertices node (denote spec.topology).vertices) a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.1 = node) a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.2 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = node All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehNoSelfLoop:(anchor, anchor) (denote context).edgeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hInserted:node (denote spec.topology).vertices((((node anchor node (denote context).vertices node (denote spec.topology).vertices) a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.1 = node) a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.2 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = node All goals completed! 🐙

Retained-envelope rewrites have old plus inserted final vertices.

theorem plannedFinalRelation_vertices_retain {context : Graph node} {anchor : node} {spec : SubgraphSpec node} (hAnchorInTopology : anchor (denote context).vertices) (hEntryInside : NodesInside spec.entryNodes spec.topology) (hExitInside : NodesInside spec.exitNodes spec.topology) : (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).vertices = (denote context).vertices (denote spec.topology).vertices := node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topology(plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).vertices = (denote context).vertices (denote spec.topology).vertices node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topology (a : node), a (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).vertices a (denote context).vertices (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝node (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).vertices node (denote context).vertices (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝node (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).vertices node (denote context).vertices (denote spec.topology).verticesnode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝node (denote context).vertices (denote spec.topology).vertices node (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝node (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).vertices node (denote context).vertices (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hFinal:node (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).verticesnode (denote context).vertices (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hFinal:((((node (denote context).vertices node (denote spec.topology).vertices) a, (a.1 = anchor a.2 spec.entryNodes) a.1 = node) a, (a.1 = anchor a.2 spec.entryNodes) a.2 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hBaseOrInserted:node (denote context).vertices node (denote spec.topology).verticesnode (denote context).vertices node (denote spec.topology).verticesnode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hEntrySource: a, (a.1 = anchor a.2 spec.entryNodes) a.1 = nodenode (denote context).vertices node (denote spec.topology).verticesnode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hEntryTarget: a, (a.1 = anchor a.2 spec.entryNodes) a.2 = nodenode (denote context).vertices node (denote spec.topology).verticesnode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hExitSource: a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = nodenode (denote context).vertices node (denote spec.topology).verticesnode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hExitTarget: a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hBaseOrInserted:node (denote context).vertices node (denote spec.topology).verticesnode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hBase:node (denote context).verticesnode (denote context).vertices node (denote spec.topology).verticesnode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hInserted:node (denote spec.topology).verticesnode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hBase:node (denote context).verticesnode (denote context).vertices node (denote spec.topology).vertices All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hInserted:node (denote spec.topology).verticesnode (denote context).vertices node (denote spec.topology).vertices All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hEntrySource: a, (a.1 = anchor a.2 spec.entryNodes) a.1 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝edge:node✝ × node✝hEdge:edge.1 = anchor edge.2 spec.entryNodeshSource:edge.1 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝source:node_entry:nodehEdge:(source, _entry).1 = anchor (source, _entry).2 spec.entryNodeshSource:(source, _entry).1 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝source:node_entry:nodehEdge:(source, _entry).1 = anchor (source, _entry).2 spec.entryNodeshSource:source = nodenode (denote context).vertices node (denote spec.topology).vertices have hSourceAnchor : source = anchor := node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topology(plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).vertices = (denote context).vertices (denote spec.topology).vertices All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝source:node_entry:nodehEdge:(source, _entry).1 = anchor (source, _entry).2 spec.entryNodeshSource:source = nodehSourceAnchor:source = anchorsource (denote context).vertices source (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝source:node_entry:nodehEdge:(source, _entry).1 = anchor (source, _entry).2 spec.entryNodeshSource:source = nodehSourceAnchor:source = anchoranchor (denote context).vertices anchor (denote spec.topology).vertices All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hEntryTarget: a, (a.1 = anchor a.2 spec.entryNodes) a.2 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝edge:node✝ × node✝hEdge:edge.1 = anchor edge.2 spec.entryNodeshEntry:edge.2 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝_source:nodeentry:nodehEdge:(_source, entry).1 = anchor (_source, entry).2 spec.entryNodeshEntry:(_source, entry).2 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝_source:nodeentry:nodehEdge:(_source, entry).1 = anchor (_source, entry).2 spec.entryNodeshEntry:entry = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝_source:nodeentry:nodehEdge:(_source, entry).1 = anchor (_source, entry).2 spec.entryNodeshEntry:entry = nodeentry (denote context).vertices entry (denote spec.topology).vertices All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hExitSource: a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝edge:node✝ × node✝hEdge:edge.1 spec.exitNodes edge.2 successorsOf (denote context) anchorhExit:edge.1 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝exit:node_successor:nodehEdge:(exit, _successor).1 spec.exitNodes (exit, _successor).2 successorsOf (denote context) anchorhExit:(exit, _successor).1 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝exit:node_successor:nodehEdge:(exit, _successor).1 spec.exitNodes (exit, _successor).2 successorsOf (denote context) anchorhExit:exit = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝exit:node_successor:nodehEdge:(exit, _successor).1 spec.exitNodes (exit, _successor).2 successorsOf (denote context) anchorhExit:exit = nodeexit (denote context).vertices exit (denote spec.topology).vertices All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hExitTarget: a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝edge:node✝ × node✝hEdge:edge.1 spec.exitNodes edge.2 successorsOf (denote context) anchorhSuccessor:edge.2 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝_exit:nodesuccessor:nodehEdge:(_exit, successor).1 spec.exitNodes (_exit, successor).2 successorsOf (denote context) anchorhSuccessor:(_exit, successor).2 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝_exit:nodesuccessor:nodehEdge:(_exit, successor).1 spec.exitNodes (_exit, successor).2 successorsOf (denote context) anchorhSuccessor:successor = nodenode (denote context).vertices node (denote spec.topology).vertices have hSuccessorMem : node successorsOf (denote context) anchor := node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topology(plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).vertices = (denote context).vertices (denote spec.topology).vertices All goals completed! 🐙 All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝node (denote context).vertices (denote spec.topology).vertices node (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hUnion:node (denote context).vertices (denote spec.topology).verticesnode (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hUnion:node (denote context).vertices node (denote spec.topology).vertices((((node (denote context).vertices node (denote spec.topology).vertices) a, (a.1 = anchor a.2 spec.entryNodes) a.1 = node) a, (a.1 = anchor a.2 spec.entryNodes) a.2 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = node node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hBase:node (denote context).vertices((((node (denote context).vertices node (denote spec.topology).vertices) a, (a.1 = anchor a.2 spec.entryNodes) a.1 = node) a, (a.1 = anchor a.2 spec.entryNodes) a.2 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = nodenode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hInserted:node (denote spec.topology).vertices((((node (denote context).vertices node (denote spec.topology).vertices) a, (a.1 = anchor a.2 spec.entryNodes) a.1 = node) a, (a.1 = anchor a.2 spec.entryNodes) a.2 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = node node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hBase:node (denote context).vertices((((node (denote context).vertices node (denote spec.topology).vertices) a, (a.1 = anchor a.2 spec.entryNodes) a.1 = node) a, (a.1 = anchor a.2 spec.entryNodes) a.2 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = node All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hInserted:node (denote spec.topology).vertices((((node (denote context).vertices node (denote spec.topology).vertices) a, (a.1 = anchor a.2 spec.entryNodes) a.1 = node) a, (a.1 = anchor a.2 spec.entryNodes) a.2 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = node All goals completed! 🐙

Append-after rewrites have old plus inserted final vertices.

theorem plannedFinalRelation_vertices_append {context : Graph node} {anchor : node} {spec : SubgraphSpec node} (hAnchorInTopology : anchor (denote context).vertices) (hEntryInside : NodesInside spec.entryNodes spec.topology) (hExitInside : NodesInside spec.exitNodes spec.topology) : (plannedFinalRelation context (GraphRewrite.appendAfter anchor spec)).vertices = (denote context).vertices (denote spec.topology).vertices := node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topology(plannedFinalRelation context (GraphRewrite.appendAfter anchor spec)).vertices = (denote context).vertices (denote spec.topology).vertices node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topology (a : node), a (plannedFinalRelation context (GraphRewrite.appendAfter anchor spec)).vertices a (denote context).vertices (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝node (plannedFinalRelation context (GraphRewrite.appendAfter anchor spec)).vertices node (denote context).vertices (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝node (plannedFinalRelation context (GraphRewrite.appendAfter anchor spec)).vertices node (denote context).vertices (denote spec.topology).verticesnode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝node (denote context).vertices (denote spec.topology).vertices node (plannedFinalRelation context (GraphRewrite.appendAfter anchor spec)).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝node (plannedFinalRelation context (GraphRewrite.appendAfter anchor spec)).vertices node (denote context).vertices (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hFinal:node (plannedFinalRelation context (GraphRewrite.appendAfter anchor spec)).verticesnode (denote context).vertices (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hFinal:((((node (denote context).vertices node (denote spec.topology).vertices) a, (a.1 = anchor a.2 spec.entryNodes) a.1 = node) a, (a.1 = anchor a.2 spec.entryNodes) a.2 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hBaseOrInserted:node (denote context).vertices node (denote spec.topology).verticesnode (denote context).vertices node (denote spec.topology).verticesnode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hEntrySource: a, (a.1 = anchor a.2 spec.entryNodes) a.1 = nodenode (denote context).vertices node (denote spec.topology).verticesnode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hEntryTarget: a, (a.1 = anchor a.2 spec.entryNodes) a.2 = nodenode (denote context).vertices node (denote spec.topology).verticesnode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hExitSource: a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = nodenode (denote context).vertices node (denote spec.topology).verticesnode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hExitTarget: a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hBaseOrInserted:node (denote context).vertices node (denote spec.topology).verticesnode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hBase:node (denote context).verticesnode (denote context).vertices node (denote spec.topology).verticesnode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hInserted:node (denote spec.topology).verticesnode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hBase:node (denote context).verticesnode (denote context).vertices node (denote spec.topology).vertices All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hInserted:node (denote spec.topology).verticesnode (denote context).vertices node (denote spec.topology).vertices All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hEntrySource: a, (a.1 = anchor a.2 spec.entryNodes) a.1 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝edge:node✝ × node✝hEdge:edge.1 = anchor edge.2 spec.entryNodeshSource:edge.1 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝source:node_entry:nodehEdge:(source, _entry).1 = anchor (source, _entry).2 spec.entryNodeshSource:(source, _entry).1 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝source:node_entry:nodehEdge:(source, _entry).1 = anchor (source, _entry).2 spec.entryNodeshSource:source = nodenode (denote context).vertices node (denote spec.topology).vertices have hSourceAnchor : source = anchor := node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topology(plannedFinalRelation context (GraphRewrite.appendAfter anchor spec)).vertices = (denote context).vertices (denote spec.topology).vertices All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝source:node_entry:nodehEdge:(source, _entry).1 = anchor (source, _entry).2 spec.entryNodeshSource:source = nodehSourceAnchor:source = anchorsource (denote context).vertices source (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝source:node_entry:nodehEdge:(source, _entry).1 = anchor (source, _entry).2 spec.entryNodeshSource:source = nodehSourceAnchor:source = anchoranchor (denote context).vertices anchor (denote spec.topology).vertices All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hEntryTarget: a, (a.1 = anchor a.2 spec.entryNodes) a.2 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝edge:node✝ × node✝hEdge:edge.1 = anchor edge.2 spec.entryNodeshEntry:edge.2 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝_source:nodeentry:nodehEdge:(_source, entry).1 = anchor (_source, entry).2 spec.entryNodeshEntry:(_source, entry).2 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝_source:nodeentry:nodehEdge:(_source, entry).1 = anchor (_source, entry).2 spec.entryNodeshEntry:entry = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝_source:nodeentry:nodehEdge:(_source, entry).1 = anchor (_source, entry).2 spec.entryNodeshEntry:entry = nodeentry (denote context).vertices entry (denote spec.topology).vertices All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hExitSource: a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝edge:node✝ × node✝hEdge:edge.1 spec.exitNodes edge.2 successorsOf (denote context) anchorhExit:edge.1 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝exit:node_successor:nodehEdge:(exit, _successor).1 spec.exitNodes (exit, _successor).2 successorsOf (denote context) anchorhExit:(exit, _successor).1 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝exit:node_successor:nodehEdge:(exit, _successor).1 spec.exitNodes (exit, _successor).2 successorsOf (denote context) anchorhExit:exit = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝exit:node_successor:nodehEdge:(exit, _successor).1 spec.exitNodes (exit, _successor).2 successorsOf (denote context) anchorhExit:exit = nodeexit (denote context).vertices exit (denote spec.topology).vertices All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hExitTarget: a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝edge:node✝ × node✝hEdge:edge.1 spec.exitNodes edge.2 successorsOf (denote context) anchorhSuccessor:edge.2 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝_exit:nodesuccessor:nodehEdge:(_exit, successor).1 spec.exitNodes (_exit, successor).2 successorsOf (denote context) anchorhSuccessor:(_exit, successor).2 = nodenode (denote context).vertices node (denote spec.topology).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝_exit:nodesuccessor:nodehEdge:(_exit, successor).1 spec.exitNodes (_exit, successor).2 successorsOf (denote context) anchorhSuccessor:successor = nodenode (denote context).vertices node (denote spec.topology).vertices have hSuccessorMem : node successorsOf (denote context) anchor := node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topology(plannedFinalRelation context (GraphRewrite.appendAfter anchor spec)).vertices = (denote context).vertices (denote spec.topology).vertices All goals completed! 🐙 All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝node (denote context).vertices (denote spec.topology).vertices node (plannedFinalRelation context (GraphRewrite.appendAfter anchor spec)).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hUnion:node (denote context).vertices (denote spec.topology).verticesnode (plannedFinalRelation context (GraphRewrite.appendAfter anchor spec)).vertices node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hUnion:node (denote context).vertices node (denote spec.topology).vertices((((node (denote context).vertices node (denote spec.topology).vertices) a, (a.1 = anchor a.2 spec.entryNodes) a.1 = node) a, (a.1 = anchor a.2 spec.entryNodes) a.2 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = node node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hBase:node (denote context).vertices((((node (denote context).vertices node (denote spec.topology).vertices) a, (a.1 = anchor a.2 spec.entryNodes) a.1 = node) a, (a.1 = anchor a.2 spec.entryNodes) a.2 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = nodenode✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hInserted:node (denote spec.topology).vertices((((node (denote context).vertices node (denote spec.topology).vertices) a, (a.1 = anchor a.2 spec.entryNodes) a.1 = node) a, (a.1 = anchor a.2 spec.entryNodes) a.2 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = node node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hBase:node (denote context).vertices((((node (denote context).vertices node (denote spec.topology).vertices) a, (a.1 = anchor a.2 spec.entryNodes) a.1 = node) a, (a.1 = anchor a.2 spec.entryNodes) a.2 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = node All goals completed! 🐙 node✝:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorInTopology:anchor (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologynode:node✝hInserted:node (denote spec.topology).vertices((((node (denote context).vertices node (denote spec.topology).vertices) a, (a.1 = anchor a.2 spec.entryNodes) a.1 = node) a, (a.1 = anchor a.2 spec.entryNodes) a.2 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = node) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = node All goals completed! 🐙

A replacement rewrite removes the anchor when the old topology has no anchor self-loop.

theorem anchor_not_mem_plannedFinalRelation_replace {context : Graph node} {anchor : node} {spec : SubgraphSpec node} (hAnchorIn : anchor (denote context).vertices) (hNoSelfLoop : (anchor, anchor) (denote context).edges) (hFresh : mappedNode, mappedNode (denote spec.topology).vertices mappedNode (denote context).vertices) (hEntryInside : NodesInside spec.entryNodes spec.topology) (hExitInside : NodesInside spec.exitNodes spec.topology) : anchor (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices := node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyanchor (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyhFinal:anchor (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).verticesFalse node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyhFinal:((((anchor anchor anchor (denote context).vertices anchor (denote spec.topology).vertices) a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.1 = anchor) a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.2 = anchor) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = anchor) a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = anchorFalse node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyhBaseOrInserted:anchor anchor anchor (denote context).vertices anchor (denote spec.topology).verticesFalsenode:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyhEntrySource: a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.1 = anchorFalsenode:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyhEntryTarget: a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.2 = anchorFalsenode:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyhExitSource: a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = anchorFalsenode:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyhExitTarget: a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = anchorFalse node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyhBaseOrInserted:anchor anchor anchor (denote context).vertices anchor (denote spec.topology).verticesFalse node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyhBase:anchor anchor anchor (denote context).verticesFalsenode:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyhInserted:anchor (denote spec.topology).verticesFalse node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyhBase:anchor anchor anchor (denote context).verticesFalse All goals completed! 🐙 node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyhInserted:anchor (denote spec.topology).verticesFalse All goals completed! 🐙 node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyhEntrySource: a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.1 = anchorFalse node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyedge:node × nodehEdge:edge.1 predecessorsOf (denote context) anchor edge.2 spec.entryNodeshSource:edge.1 = anchorFalse node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologysource:node_entry:nodehEdge:(source, _entry).1 predecessorsOf (denote context) anchor (source, _entry).2 spec.entryNodeshSource:(source, _entry).1 = anchorFalse node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologysource:node_entry:nodehEdge:(source, _entry).1 predecessorsOf (denote context) anchor (source, _entry).2 spec.entryNodeshSource:source = anchorFalse have hPred : anchor predecessorsOf (denote context) anchor := node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyanchor (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices All goals completed! 🐙 All goals completed! 🐙 node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyhEntryTarget: a, (a.1 predecessorsOf (denote context) anchor a.2 spec.entryNodes) a.2 = anchorFalse node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyedge:node × nodehEdge:edge.1 predecessorsOf (denote context) anchor edge.2 spec.entryNodeshEntry:edge.2 = anchorFalse node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topology_source:nodeentry:nodehEdge:(_source, entry).1 predecessorsOf (denote context) anchor (_source, entry).2 spec.entryNodeshEntry:(_source, entry).2 = anchorFalse node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topology_source:nodeentry:nodehEdge:(_source, entry).1 predecessorsOf (denote context) anchor (_source, entry).2 spec.entryNodeshEntry:entry = anchorFalse have hEntryOld : entry (denote context).vertices := node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyanchor (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topology_source:nodeentry:nodehEdge:(_source, entry).1 predecessorsOf (denote context) anchor (_source, entry).2 spec.entryNodeshEntry:entry = anchoranchor (denote context).vertices All goals completed! 🐙 All goals completed! 🐙 node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyhExitSource: a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.1 = anchorFalse node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyedge:node × nodehEdge:edge.1 spec.exitNodes edge.2 successorsOf (denote context) anchorhExit:edge.1 = anchorFalse node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyexit:node_successor:nodehEdge:(exit, _successor).1 spec.exitNodes (exit, _successor).2 successorsOf (denote context) anchorhExit:(exit, _successor).1 = anchorFalse node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyexit:node_successor:nodehEdge:(exit, _successor).1 spec.exitNodes (exit, _successor).2 successorsOf (denote context) anchorhExit:exit = anchorFalse have hExitOld : exit (denote context).vertices := node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyanchor (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyexit:node_successor:nodehEdge:(exit, _successor).1 spec.exitNodes (exit, _successor).2 successorsOf (denote context) anchorhExit:exit = anchoranchor (denote context).vertices All goals completed! 🐙 All goals completed! 🐙 node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyhExitTarget: a, (a.1 spec.exitNodes a.2 successorsOf (denote context) anchor) a.2 = anchorFalse node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyedge:node × nodehEdge:edge.1 spec.exitNodes edge.2 successorsOf (denote context) anchorhSuccessor:edge.2 = anchorFalse node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topology_exit:nodesuccessor:nodehEdge:(_exit, successor).1 spec.exitNodes (_exit, successor).2 successorsOf (denote context) anchorhSuccessor:(_exit, successor).2 = anchorFalse node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topology_exit:nodesuccessor:nodehEdge:(_exit, successor).1 spec.exitNodes (_exit, successor).2 successorsOf (denote context) anchorhSuccessor:successor = anchorFalse have hSucc : anchor successorsOf (denote context) anchor := node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticeshNoSelfLoop:(anchor, anchor) (denote context).edgeshFresh: mappedNode (denote spec.topology).vertices, mappedNode (denote context).verticeshEntryInside:NodesInside spec.entryNodes spec.topologyhExitInside:NodesInside spec.exitNodes spec.topologyanchor (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices All goals completed! 🐙 All goals completed! 🐙

A retained-envelope rewrite keeps the anchor in the planned final relation.

theorem anchor_mem_plannedFinalRelation_retain {context : Graph node} {anchor : node} {spec : SubgraphSpec node} (hAnchorIn : anchor (denote context).vertices) : anchor (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).vertices := node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticesanchor (plannedFinalRelation context (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).vertices node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).vertices((((anchor (denote context).vertices anchor (denote spec.topology).vertices) anchor Finset.image Prod.fst ({anchor} ×ˢ spec.entryNodes)) anchor Finset.image Prod.snd ({anchor} ×ˢ spec.entryNodes)) anchor Finset.image Prod.fst (spec.exitNodes ×ˢ successorsOf (denote context) anchor)) anchor Finset.image Prod.snd (spec.exitNodes ×ˢ successorsOf (denote context) anchor) All goals completed! 🐙

An append-after rewrite keeps the anchor in the planned final relation.

theorem anchor_mem_plannedFinalRelation_append {context : Graph node} {anchor : node} {spec : SubgraphSpec node} (hAnchorIn : anchor (denote context).vertices) : anchor (plannedFinalRelation context (GraphRewrite.appendAfter anchor spec)).vertices := node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).verticesanchor (plannedFinalRelation context (GraphRewrite.appendAfter anchor spec)).vertices node:Typeinst✝:DecidableEq nodecontext:Graph nodeanchor:nodespec:SubgraphSpec nodehAnchorIn:anchor (denote context).vertices((((anchor (denote context).vertices anchor (denote spec.topology).vertices) anchor Finset.image Prod.fst ({anchor} ×ˢ spec.entryNodes)) anchor Finset.image Prod.snd ({anchor} ×ˢ spec.entryNodes)) anchor Finset.image Prod.fst (spec.exitNodes ×ˢ successorsOf (denote context) anchor)) anchor Finset.image Prod.snd (spec.exitNodes ×ˢ successorsOf (denote context) anchor) All goals completed! 🐙end AnchorMembership

Constructed Planned Delta

section ConstructedDeltavariable {node : Type}variable [DecidableEq node]

Relation computed by the runtime-shaped planner after namespacing.

def constructedFinalRelation (policy : RuntimeNamespacePolicy node) (context : PlanningContext node) (rawRewrite : GraphRewrite node) : Relation node := plannedFinalRelation context.topology (runtimePlannerRewrite policy rawRewrite)

Graph representative for the constructed final relation.

noncomputable def constructedFinalTopology (policy : RuntimeNamespacePolicy node) (context : PlanningContext node) (rawRewrite : GraphRewrite node) : Graph node := graphOfRelation (constructedFinalRelation policy context rawRewrite)

The constructed final topology denotes the relation-level planner output.

theorem denote_constructedFinalTopology (policy : RuntimeNamespacePolicy node) (context : PlanningContext node) (rawRewrite : GraphRewrite node) : denote (constructedFinalTopology policy context rawRewrite) = constructedFinalRelation policy context rawRewrite := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodedenote (constructedFinalTopology policy context rawRewrite) = constructedFinalRelation policy context rawRewrite node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodedenote (graphOfRelation (plannedFinalRelation context.topology (runtimePlannerRewrite policy rawRewrite))) = plannedFinalRelation context.topology (runtimePlannerRewrite policy rawRewrite) All goals completed! 🐙

Planned delta obtained by the runtime-shaped construction equations.

noncomputable def constructedPlannedRewriteDelta (policy : RuntimeNamespacePolicy node) (context : PlanningContext node) (rawRewrite : GraphRewrite node) (insertedDepth : Nat) : PlannedRewriteDelta node := let rewrite := runtimePlannerRewrite policy rawRewrite let finalRelation := constructedFinalRelation policy context rawRewrite let oldRelation := denote context.topology let newNodes := relationAddedNodes oldRelation finalRelation let addedEdges := relationAddedEdges oldRelation finalRelation { topology := constructedFinalTopology policy context rawRewrite definitions := plannedFinalDefinitions context rewrite newNodes := newNodes removedNodes := relationRemovedNodes oldRelation finalRelation addedEdges := addedEdges entryNodes := rewrite.spec.entryNodes exitNodes := rewrite.spec.exitNodes anchorNode := rawRewrite.anchor anchorDisposition := rewrite.anchorDisposition cost := { addedNodes := newNodes.card addedEdges := addedEdges.card addedDepth := match rewrite.anchorDisposition with | RewriteAnchorDisposition.removed => insertedDepth - 1 | RewriteAnchorDisposition.retained => insertedDepth frontierDelta := rewrite.spec.entryNodes.card - 1 rewriteOps := 1 } }

Constructed planned deltas preserve the Wire registry boundary from explicit admission of their relation-diff vertices and edges.

theorem constructedPlannedRewriteDelta_preserves_registryBoundary {executor config contract authority : Type} [DecidableEq contract] [DecidableEq (StagedExecutorNode executor config authority)] (registry : ExecutorRegistry executor config contract authority) {policy : RuntimeNamespacePolicy (StagedExecutorNode executor config authority)} {context : PlanningContext (StagedExecutorNode executor config authority)} {rawRewrite : GraphRewrite (StagedExecutorNode executor config authority)} {insertedDepth : Nat} (hBoundary : registryBoundary registry context.topology) (hDelta : RegistryBoundaryDeltaAdmitted registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth)) : registryBoundary registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology := executor:Typeconfig:Typecontract:Typeauthority:Typeinst✝¹:DecidableEq contractinst✝:DecidableEq (StagedExecutorNode executor config authority)registry:ExecutorRegistry executor config contract authoritypolicy:RuntimeNamespacePolicy (StagedExecutorNode executor config authority)context:PlanningContext (StagedExecutorNode executor config authority)rawRewrite:GraphRewrite (StagedExecutorNode executor config authority)insertedDepth:hBoundary:registryBoundary registry context.topologyhDelta:RegistryBoundaryDeltaAdmitted registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth)registryBoundary registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology executor:Typeconfig:Typecontract:Typeauthority:Typeinst✝¹:DecidableEq contractinst✝:DecidableEq (StagedExecutorNode executor config authority)registry:ExecutorRegistry executor config contract authoritypolicy:RuntimeNamespacePolicy (StagedExecutorNode executor config authority)context:PlanningContext (StagedExecutorNode executor config authority)rawRewrite:GraphRewrite (StagedExecutorNode executor config authority)insertedDepth:hBoundary:registryBoundary registry context.topologyhDelta:RegistryBoundaryDeltaAdmitted registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth)TopologyDiffMatches context (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth) executor:Typeconfig:Typecontract:Typeauthority:Typeinst✝¹:DecidableEq contractinst✝:DecidableEq (StagedExecutorNode executor config authority)registry:ExecutorRegistry executor config contract authoritypolicy:RuntimeNamespacePolicy (StagedExecutorNode executor config authority)context:PlanningContext (StagedExecutorNode executor config authority)rawRewrite:GraphRewrite (StagedExecutorNode executor config authority)insertedDepth:hBoundary:registryBoundary registry context.topologyhDelta:RegistryBoundaryDeltaAdmitted registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth)(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).newNodes = relationAddedNodes (denote context.topology) (denote (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology)executor:Typeconfig:Typecontract:Typeauthority:Typeinst✝¹:DecidableEq contractinst✝:DecidableEq (StagedExecutorNode executor config authority)registry:ExecutorRegistry executor config contract authoritypolicy:RuntimeNamespacePolicy (StagedExecutorNode executor config authority)context:PlanningContext (StagedExecutorNode executor config authority)rawRewrite:GraphRewrite (StagedExecutorNode executor config authority)insertedDepth:hBoundary:registryBoundary registry context.topologyhDelta:RegistryBoundaryDeltaAdmitted registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth)(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).removedNodes = relationRemovedNodes (denote context.topology) (denote (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology)executor:Typeconfig:Typecontract:Typeauthority:Typeinst✝¹:DecidableEq contractinst✝:DecidableEq (StagedExecutorNode executor config authority)registry:ExecutorRegistry executor config contract authoritypolicy:RuntimeNamespacePolicy (StagedExecutorNode executor config authority)context:PlanningContext (StagedExecutorNode executor config authority)rawRewrite:GraphRewrite (StagedExecutorNode executor config authority)insertedDepth:hBoundary:registryBoundary registry context.topologyhDelta:RegistryBoundaryDeltaAdmitted registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth)(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).addedEdges = relationAddedEdges (denote context.topology) (denote (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology) executor:Typeconfig:Typecontract:Typeauthority:Typeinst✝¹:DecidableEq contractinst✝:DecidableEq (StagedExecutorNode executor config authority)registry:ExecutorRegistry executor config contract authoritypolicy:RuntimeNamespacePolicy (StagedExecutorNode executor config authority)context:PlanningContext (StagedExecutorNode executor config authority)rawRewrite:GraphRewrite (StagedExecutorNode executor config authority)insertedDepth:hBoundary:registryBoundary registry context.topologyhDelta:RegistryBoundaryDeltaAdmitted registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth)(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).newNodes = relationAddedNodes (denote context.topology) (denote (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology) All goals completed! 🐙 executor:Typeconfig:Typecontract:Typeauthority:Typeinst✝¹:DecidableEq contractinst✝:DecidableEq (StagedExecutorNode executor config authority)registry:ExecutorRegistry executor config contract authoritypolicy:RuntimeNamespacePolicy (StagedExecutorNode executor config authority)context:PlanningContext (StagedExecutorNode executor config authority)rawRewrite:GraphRewrite (StagedExecutorNode executor config authority)insertedDepth:hBoundary:registryBoundary registry context.topologyhDelta:RegistryBoundaryDeltaAdmitted registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth)(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).removedNodes = relationRemovedNodes (denote context.topology) (denote (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology) All goals completed! 🐙 executor:Typeconfig:Typecontract:Typeauthority:Typeinst✝¹:DecidableEq contractinst✝:DecidableEq (StagedExecutorNode executor config authority)registry:ExecutorRegistry executor config contract authoritypolicy:RuntimeNamespacePolicy (StagedExecutorNode executor config authority)context:PlanningContext (StagedExecutorNode executor config authority)rawRewrite:GraphRewrite (StagedExecutorNode executor config authority)insertedDepth:hBoundary:registryBoundary registry context.topologyhDelta:RegistryBoundaryDeltaAdmitted registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth)(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).addedEdges = relationAddedEdges (denote context.topology) (denote (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology) All goals completed! 🐙

Constructed planned deltas provide the contractPreserved witness needed when the contract predicate is exactly registryBoundary registry.

theorem constructedPlannedRewriteDelta_registryBoundaryContractPreserved {executor config contract authority : Type} [DecidableEq contract] [DecidableEq (StagedExecutorNode executor config authority)] (registry : ExecutorRegistry executor config contract authority) {policy : RuntimeNamespacePolicy (StagedExecutorNode executor config authority)} {context : PlanningContext (StagedExecutorNode executor config authority)} {rawRewrite : GraphRewrite (StagedExecutorNode executor config authority)} {insertedDepth : Nat} (hDelta : RegistryBoundaryDeltaAdmitted registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth)) : g, denote g = denote context.topology registryBoundary registry g registryBoundary registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology := executor:Typeconfig:Typecontract:Typeauthority:Typeinst✝¹:DecidableEq contractinst✝:DecidableEq (StagedExecutorNode executor config authority)registry:ExecutorRegistry executor config contract authoritypolicy:RuntimeNamespacePolicy (StagedExecutorNode executor config authority)context:PlanningContext (StagedExecutorNode executor config authority)rawRewrite:GraphRewrite (StagedExecutorNode executor config authority)insertedDepth:hDelta:RegistryBoundaryDeltaAdmitted registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth) (g : Graph (StagedExecutorNode executor config authority)), denote g = denote context.topology registryBoundary registry g registryBoundary registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology intro g executor:Typeconfig:Typecontract:Typeauthority:Typeinst✝¹:DecidableEq contractinst✝:DecidableEq (StagedExecutorNode executor config authority)registry:ExecutorRegistry executor config contract authoritypolicy:RuntimeNamespacePolicy (StagedExecutorNode executor config authority)context:PlanningContext (StagedExecutorNode executor config authority)rawRewrite:GraphRewrite (StagedExecutorNode executor config authority)insertedDepth:hDelta:RegistryBoundaryDeltaAdmitted registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth)g:Graph (StagedExecutorNode executor config authority)hGraphEq:denote g = denote context.topologyregistryBoundary registry g registryBoundary registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology executor:Typeconfig:Typecontract:Typeauthority:Typeinst✝¹:DecidableEq contractinst✝:DecidableEq (StagedExecutorNode executor config authority)registry:ExecutorRegistry executor config contract authoritypolicy:RuntimeNamespacePolicy (StagedExecutorNode executor config authority)context:PlanningContext (StagedExecutorNode executor config authority)rawRewrite:GraphRewrite (StagedExecutorNode executor config authority)insertedDepth:hDelta:RegistryBoundaryDeltaAdmitted registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth)g:Graph (StagedExecutorNode executor config authority)hGraphEq:denote g = denote context.topologyhBoundary:registryBoundary registry gregistryBoundary registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology executor:Typeconfig:Typecontract:Typeauthority:Typeinst✝¹:DecidableEq contractinst✝:DecidableEq (StagedExecutorNode executor config authority)registry:ExecutorRegistry executor config contract authoritypolicy:RuntimeNamespacePolicy (StagedExecutorNode executor config authority)context:PlanningContext (StagedExecutorNode executor config authority)rawRewrite:GraphRewrite (StagedExecutorNode executor config authority)insertedDepth:hDelta:RegistryBoundaryDeltaAdmitted registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth)g:Graph (StagedExecutorNode executor config authority)hGraphEq:denote g = denote context.topologyhBoundary:registryBoundary registry ghContextBoundary:registryBoundary registry context.topologyregistryBoundary registry (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology All goals completed! 🐙

The constructed delta records anchor identity and derives anchor membership facts.

theorem constructedPlannedRewriteDelta_anchorMatches {policy : RuntimeNamespacePolicy node} {context : PlanningContext node} {rawRewrite : GraphRewrite node} {insertedDepth : Nat} (hDiscipline : NamespaceDiscipline policy.localAllowed (policy.namespaceNode rawRewrite.anchor) context rawRewrite.spec) (hAnchorInTopology : rawRewrite.anchor (denote context.topology).vertices) (hSourceAcyclic : Acyclic context.topology) (hRawSubgraphValid : rawRewrite.spec.Valid) : RuntimeAnchorMatches policy rawRewrite (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth) := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode rawRewrite.anchor) context rawRewrite.spechAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshSourceAcyclic:Acyclic context.topologyhRawSubgraphValid:rawRewrite.spec.ValidRuntimeAnchorMatches policy rawRewrite (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth) node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode rawRewrite.anchor) context rawRewrite.spechAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshSourceAcyclic:Acyclic context.topologyhRawSubgraphValid:rawRewrite.spec.ValidhAnchorNoSelfLoop:(rawRewrite.anchor, rawRewrite.anchor) (denote context.topology).edgesRuntimeAnchorMatches policy rawRewrite (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth) have hNamespacedValid : (runtimePlannerRewrite policy rawRewrite).spec.Valid := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode rawRewrite.anchor) context rawRewrite.spechAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshSourceAcyclic:Acyclic context.topologyhRawSubgraphValid:rawRewrite.spec.ValidRuntimeAnchorMatches policy rawRewrite (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth) node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode rawRewrite.anchor) context rawRewrite.spechAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshSourceAcyclic:Acyclic context.topologyhRawSubgraphValid:rawRewrite.spec.ValidhAnchorNoSelfLoop:(rawRewrite.anchor, rawRewrite.anchor) (denote context.topology).edges(namespaceSubgraphSpec (policy.namespaceNode rawRewrite.anchor) rawRewrite.spec).Valid All goals completed! 🐙 have hFresh : mappedNode, mappedNode (denote (runtimePlannerRewrite policy rawRewrite).spec.topology).vertices mappedNode (denote context.topology).vertices := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode rawRewrite.anchor) context rawRewrite.spechAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshSourceAcyclic:Acyclic context.topologyhRawSubgraphValid:rawRewrite.spec.ValidRuntimeAnchorMatches policy rawRewrite (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth) node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode rawRewrite.anchor) context rawRewrite.spechAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshSourceAcyclic:Acyclic context.topologyhRawSubgraphValid:rawRewrite.spec.ValidhAnchorNoSelfLoop:(rawRewrite.anchor, rawRewrite.anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy rawRewrite).spec.Valid mappedNode (denote (namespaceSubgraphSpec (policy.namespaceNode rawRewrite.anchor) rawRewrite.spec).topology).vertices, mappedNode (denote context.topology).vertices All goals completed! 🐙 refine { anchorNode_eq := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode rawRewrite.anchor) context rawRewrite.spechAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshSourceAcyclic:Acyclic context.topologyhRawSubgraphValid:rawRewrite.spec.ValidhAnchorNoSelfLoop:(rawRewrite.anchor, rawRewrite.anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy rawRewrite).spec.ValidhFresh: mappedNode (denote (runtimePlannerRewrite policy rawRewrite).spec.topology).vertices, mappedNode (denote context.topology).vertices(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).anchorNode = rawRewrite.anchor All goals completed! 🐙 anchorDisposition_eq := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode rawRewrite.anchor) context rawRewrite.spechAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshSourceAcyclic:Acyclic context.topologyhRawSubgraphValid:rawRewrite.spec.ValidhAnchorNoSelfLoop:(rawRewrite.anchor, rawRewrite.anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy rawRewrite).spec.ValidhFresh: mappedNode (denote (runtimePlannerRewrite policy rawRewrite).spec.topology).vertices, mappedNode (denote context.topology).vertices(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).anchorDisposition = (runtimePlannerRewrite policy rawRewrite).anchorDisposition All goals completed! 🐙 removed_absent := ?_ retained_present := ?_ } node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode rawRewrite.anchor) context rawRewrite.spechAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshSourceAcyclic:Acyclic context.topologyhRawSubgraphValid:rawRewrite.spec.ValidhAnchorNoSelfLoop:(rawRewrite.anchor, rawRewrite.anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy rawRewrite).spec.ValidhFresh: mappedNode (denote (runtimePlannerRewrite policy rawRewrite).spec.topology).vertices, mappedNode (denote context.topology).vertices(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).anchorDisposition = RewriteAnchorDisposition.removed (runtimePlannerRewrite policy rawRewrite).anchor (denote (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology).vertices node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode rawRewrite.anchor) context rawRewrite.spechAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshSourceAcyclic:Acyclic context.topologyhRawSubgraphValid:rawRewrite.spec.ValidhAnchorNoSelfLoop:(rawRewrite.anchor, rawRewrite.anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy rawRewrite).spec.ValidhFresh: mappedNode (denote (runtimePlannerRewrite policy rawRewrite).spec.topology).vertices, mappedNode (denote context.topology).verticeshRemoved:(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).anchorDisposition = RewriteAnchorDisposition.removed(runtimePlannerRewrite policy rawRewrite).anchor (denote (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology).vertices node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode rawRewrite.anchor) context rawRewrite.spechAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshSourceAcyclic:Acyclic context.topologyhRawSubgraphValid:rawRewrite.spec.ValidhAnchorNoSelfLoop:(rawRewrite.anchor, rawRewrite.anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy rawRewrite).spec.ValidhFresh: mappedNode (denote (runtimePlannerRewrite policy rawRewrite).spec.topology).vertices, mappedNode (denote context.topology).verticeshRemoved:(runtimePlannerRewrite policy rawRewrite).anchorDisposition = RewriteAnchorDisposition.removed(runtimePlannerRewrite policy rawRewrite).anchor (denote (constructedFinalTopology policy context rawRewrite)).vertices node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode rawRewrite.anchor) context rawRewrite.spechAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshSourceAcyclic:Acyclic context.topologyhRawSubgraphValid:rawRewrite.spec.ValidhAnchorNoSelfLoop:(rawRewrite.anchor, rawRewrite.anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy rawRewrite).spec.ValidhFresh: mappedNode (denote (runtimePlannerRewrite policy rawRewrite).spec.topology).vertices, mappedNode (denote context.topology).verticeshRemoved:(runtimePlannerRewrite policy rawRewrite).anchorDisposition = RewriteAnchorDisposition.removed(runtimePlannerRewrite policy rawRewrite).anchor (constructedFinalRelation policy context rawRewrite).vertices cases rawRewrite with node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext nodeinsertedDepth:hSourceAcyclic:Acyclic context.topologyanchor:nodemode:ExpansionModespec:SubgraphSpec nodehDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode (GraphRewrite.expandNode anchor mode spec).anchor) context (GraphRewrite.expandNode anchor mode spec).spechAnchorInTopology:(GraphRewrite.expandNode anchor mode spec).anchor (denote context.topology).verticeshRawSubgraphValid:(GraphRewrite.expandNode anchor mode spec).spec.ValidhAnchorNoSelfLoop:((GraphRewrite.expandNode anchor mode spec).anchor, (GraphRewrite.expandNode anchor mode spec).anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor mode spec)).spec.ValidhFresh: mappedNode (denote (runtimePlannerRewrite policy (GraphRewrite.expandNode anchor mode spec)).spec.topology).vertices, mappedNode (denote context.topology).verticeshRemoved:(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor mode spec)).anchorDisposition = RewriteAnchorDisposition.removed(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor mode spec)).anchor (constructedFinalRelation policy context (GraphRewrite.expandNode anchor mode spec)).vertices cases mode with node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext nodeinsertedDepth:hSourceAcyclic:Acyclic context.topologyanchor:nodespec:SubgraphSpec nodehDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec).anchor) context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec).spechAnchorInTopology:(GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec).anchor (denote context.topology).verticeshRawSubgraphValid:(GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec).spec.ValidhAnchorNoSelfLoop:((GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec).anchor, (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec).anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).spec.ValidhFresh: mappedNode (denote (runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).spec.topology).vertices, mappedNode (denote context.topology).verticeshRemoved:(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).anchorDisposition = RewriteAnchorDisposition.removed(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).anchor (constructedFinalRelation policy context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext nodeinsertedDepth:hSourceAcyclic:Acyclic context.topologyanchor:nodespec:SubgraphSpec nodehDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec).anchor) context (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec).spechAnchorInTopology:(GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec).anchor (denote context.topology).verticeshRawSubgraphValid:(GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec).spec.ValidhAnchorNoSelfLoop:((GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec).anchor, (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec).anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).spec.ValidhFresh: mappedNode (denote (runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).spec.topology).vertices, mappedNode (denote context.topology).verticeshRemoved:(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).anchorDisposition = RewriteAnchorDisposition.removed(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).anchor (constructedFinalRelation policy context (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).vertices All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext nodeinsertedDepth:hSourceAcyclic:Acyclic context.topologyanchor:nodespec:SubgraphSpec nodehDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode (GraphRewrite.appendAfter anchor spec).anchor) context (GraphRewrite.appendAfter anchor spec).spechAnchorInTopology:(GraphRewrite.appendAfter anchor spec).anchor (denote context.topology).verticeshRawSubgraphValid:(GraphRewrite.appendAfter anchor spec).spec.ValidhAnchorNoSelfLoop:((GraphRewrite.appendAfter anchor spec).anchor, (GraphRewrite.appendAfter anchor spec).anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy (GraphRewrite.appendAfter anchor spec)).spec.ValidhFresh: mappedNode (denote (runtimePlannerRewrite policy (GraphRewrite.appendAfter anchor spec)).spec.topology).vertices, mappedNode (denote context.topology).verticeshRemoved:(runtimePlannerRewrite policy (GraphRewrite.appendAfter anchor spec)).anchorDisposition = RewriteAnchorDisposition.removed(runtimePlannerRewrite policy (GraphRewrite.appendAfter anchor spec)).anchor (constructedFinalRelation policy context (GraphRewrite.appendAfter anchor spec)).vertices All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode rawRewrite.anchor) context rawRewrite.spechAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshSourceAcyclic:Acyclic context.topologyhRawSubgraphValid:rawRewrite.spec.ValidhAnchorNoSelfLoop:(rawRewrite.anchor, rawRewrite.anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy rawRewrite).spec.ValidhFresh: mappedNode (denote (runtimePlannerRewrite policy rawRewrite).spec.topology).vertices, mappedNode (denote context.topology).vertices(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).anchorDisposition = RewriteAnchorDisposition.retained (runtimePlannerRewrite policy rawRewrite).anchor (denote (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology).vertices node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode rawRewrite.anchor) context rawRewrite.spechAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshSourceAcyclic:Acyclic context.topologyhRawSubgraphValid:rawRewrite.spec.ValidhAnchorNoSelfLoop:(rawRewrite.anchor, rawRewrite.anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy rawRewrite).spec.ValidhFresh: mappedNode (denote (runtimePlannerRewrite policy rawRewrite).spec.topology).vertices, mappedNode (denote context.topology).verticeshRetained:(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).anchorDisposition = RewriteAnchorDisposition.retained(runtimePlannerRewrite policy rawRewrite).anchor (denote (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology).vertices node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode rawRewrite.anchor) context rawRewrite.spechAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshSourceAcyclic:Acyclic context.topologyhRawSubgraphValid:rawRewrite.spec.ValidhAnchorNoSelfLoop:(rawRewrite.anchor, rawRewrite.anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy rawRewrite).spec.ValidhFresh: mappedNode (denote (runtimePlannerRewrite policy rawRewrite).spec.topology).vertices, mappedNode (denote context.topology).verticeshRetained:(runtimePlannerRewrite policy rawRewrite).anchorDisposition = RewriteAnchorDisposition.retained(runtimePlannerRewrite policy rawRewrite).anchor (denote (constructedFinalTopology policy context rawRewrite)).vertices node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode rawRewrite.anchor) context rawRewrite.spechAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshSourceAcyclic:Acyclic context.topologyhRawSubgraphValid:rawRewrite.spec.ValidhAnchorNoSelfLoop:(rawRewrite.anchor, rawRewrite.anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy rawRewrite).spec.ValidhFresh: mappedNode (denote (runtimePlannerRewrite policy rawRewrite).spec.topology).vertices, mappedNode (denote context.topology).verticeshRetained:(runtimePlannerRewrite policy rawRewrite).anchorDisposition = RewriteAnchorDisposition.retained(runtimePlannerRewrite policy rawRewrite).anchor (constructedFinalRelation policy context rawRewrite).vertices cases rawRewrite with node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext nodeinsertedDepth:hSourceAcyclic:Acyclic context.topologyanchor:nodemode:ExpansionModespec:SubgraphSpec nodehDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode (GraphRewrite.expandNode anchor mode spec).anchor) context (GraphRewrite.expandNode anchor mode spec).spechAnchorInTopology:(GraphRewrite.expandNode anchor mode spec).anchor (denote context.topology).verticeshRawSubgraphValid:(GraphRewrite.expandNode anchor mode spec).spec.ValidhAnchorNoSelfLoop:((GraphRewrite.expandNode anchor mode spec).anchor, (GraphRewrite.expandNode anchor mode spec).anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor mode spec)).spec.ValidhFresh: mappedNode (denote (runtimePlannerRewrite policy (GraphRewrite.expandNode anchor mode spec)).spec.topology).vertices, mappedNode (denote context.topology).verticeshRetained:(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor mode spec)).anchorDisposition = RewriteAnchorDisposition.retained(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor mode spec)).anchor (constructedFinalRelation policy context (GraphRewrite.expandNode anchor mode spec)).vertices cases mode with node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext nodeinsertedDepth:hSourceAcyclic:Acyclic context.topologyanchor:nodespec:SubgraphSpec nodehDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec).anchor) context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec).spechAnchorInTopology:(GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec).anchor (denote context.topology).verticeshRawSubgraphValid:(GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec).spec.ValidhAnchorNoSelfLoop:((GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec).anchor, (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec).anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).spec.ValidhFresh: mappedNode (denote (runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).spec.topology).vertices, mappedNode (denote context.topology).verticeshRetained:(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).anchorDisposition = RewriteAnchorDisposition.retained(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).anchor (constructedFinalRelation policy context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext nodeinsertedDepth:hSourceAcyclic:Acyclic context.topologyanchor:nodespec:SubgraphSpec nodehDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec).anchor) context (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec).spechAnchorInTopology:(GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec).anchor (denote context.topology).verticeshRawSubgraphValid:(GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec).spec.ValidhAnchorNoSelfLoop:((GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec).anchor, (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec).anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).spec.ValidhFresh: mappedNode (denote (runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).spec.topology).vertices, mappedNode (denote context.topology).verticeshRetained:(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).anchorDisposition = RewriteAnchorDisposition.retained(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).anchor (constructedFinalRelation policy context (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).vertices All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext nodeinsertedDepth:hSourceAcyclic:Acyclic context.topologyanchor:nodespec:SubgraphSpec nodehDiscipline:NamespaceDiscipline policy.localAllowed (policy.namespaceNode (GraphRewrite.appendAfter anchor spec).anchor) context (GraphRewrite.appendAfter anchor spec).spechAnchorInTopology:(GraphRewrite.appendAfter anchor spec).anchor (denote context.topology).verticeshRawSubgraphValid:(GraphRewrite.appendAfter anchor spec).spec.ValidhAnchorNoSelfLoop:((GraphRewrite.appendAfter anchor spec).anchor, (GraphRewrite.appendAfter anchor spec).anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy (GraphRewrite.appendAfter anchor spec)).spec.ValidhFresh: mappedNode (denote (runtimePlannerRewrite policy (GraphRewrite.appendAfter anchor spec)).spec.topology).vertices, mappedNode (denote context.topology).verticeshRetained:(runtimePlannerRewrite policy (GraphRewrite.appendAfter anchor spec)).anchorDisposition = RewriteAnchorDisposition.retained(runtimePlannerRewrite policy (GraphRewrite.appendAfter anchor spec)).anchor (constructedFinalRelation policy context (GraphRewrite.appendAfter anchor spec)).vertices All goals completed! 🐙

SourcePlanningContextValid is the invariant carried by materialized planner inputs.

structure SourcePlanningContextValid (context : PlanningContext node) : Prop where

The current materialized topology is already a DAG.

sourceAcyclic : Acyclic context.topology

Current stage definitions exactly cover the materialized topology.

definitionsCover : DefinitionCoverage context.topology context.definitions

Source context validity turns anchor membership into anchor-definition membership.

theorem SourcePlanningContextValid.anchorHasDefinition {context : PlanningContext node} {anchor : node} (hSource : SourcePlanningContextValid context) (hAnchorInTopology : anchor (denote context.topology).vertices) : anchor context.definitions := node:Typeinst✝:DecidableEq nodecontext:PlanningContext nodeanchor:nodehSource:SourcePlanningContextValid contexthAnchorInTopology:anchor (denote context.topology).verticesanchor context.definitions node:Typeinst✝:DecidableEq nodecontext:PlanningContext nodeanchor:nodehSource:SourcePlanningContextValid contexthAnchorInTopology:anchor (denote context.topology).verticesanchor (denote context.topology).vertices All goals completed! 🐙

Concrete construction derives final definition coverage from source and subgraph coverage.

theorem constructedPlannedRewriteDelta_finalDefinitionsCover {policy : RuntimeNamespacePolicy node} {context : PlanningContext node} {rawRewrite : GraphRewrite node} {insertedDepth : Nat} (hSource : SourcePlanningContextValid context) (hAnchorInTopology : rawRewrite.anchor (denote context.topology).vertices) (hRawSubgraphValid : rawRewrite.spec.Valid) : DefinitionCoverage (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hSource:SourcePlanningContextValid contexthAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshRawSubgraphValid:rawRewrite.spec.ValidDefinitionCoverage (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hSource:SourcePlanningContextValid contexthAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshRawSubgraphValid:rawRewrite.spec.ValidhAnchorNoSelfLoop:(rawRewrite.anchor, rawRewrite.anchor) (denote context.topology).edgesDefinitionCoverage (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions have hNamespacedValid : (runtimePlannerRewrite policy rawRewrite).spec.Valid := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hSource:SourcePlanningContextValid contexthAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshRawSubgraphValid:rawRewrite.spec.ValidDefinitionCoverage (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hSource:SourcePlanningContextValid contexthAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshRawSubgraphValid:rawRewrite.spec.ValidhAnchorNoSelfLoop:(rawRewrite.anchor, rawRewrite.anchor) (denote context.topology).edges(namespaceSubgraphSpec (policy.namespaceNode rawRewrite.anchor) rawRewrite.spec).Valid All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hSource:SourcePlanningContextValid contexthAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshRawSubgraphValid:rawRewrite.spec.ValidhAnchorNoSelfLoop:(rawRewrite.anchor, rawRewrite.anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy rawRewrite).spec.Valid(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions = (denote (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology).vertices node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hSource:SourcePlanningContextValid contexthAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshRawSubgraphValid:rawRewrite.spec.ValidhAnchorNoSelfLoop:(rawRewrite.anchor, rawRewrite.anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy rawRewrite).spec.ValidplannedFinalDefinitions context (runtimePlannerRewrite policy rawRewrite) = (denote (constructedFinalTopology policy context rawRewrite)).vertices node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hSource:SourcePlanningContextValid contexthAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshRawSubgraphValid:rawRewrite.spec.ValidhAnchorNoSelfLoop:(rawRewrite.anchor, rawRewrite.anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy rawRewrite).spec.ValidplannedFinalDefinitions context (runtimePlannerRewrite policy rawRewrite) = (constructedFinalRelation policy context rawRewrite).vertices cases rawRewrite with node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext nodeinsertedDepth:hSource:SourcePlanningContextValid contextanchor:nodemode:ExpansionModespec:SubgraphSpec nodehAnchorInTopology:(GraphRewrite.expandNode anchor mode spec).anchor (denote context.topology).verticeshRawSubgraphValid:(GraphRewrite.expandNode anchor mode spec).spec.ValidhAnchorNoSelfLoop:((GraphRewrite.expandNode anchor mode spec).anchor, (GraphRewrite.expandNode anchor mode spec).anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor mode spec)).spec.ValidplannedFinalDefinitions context (runtimePlannerRewrite policy (GraphRewrite.expandNode anchor mode spec)) = (constructedFinalRelation policy context (GraphRewrite.expandNode anchor mode spec)).vertices cases mode with node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext nodeinsertedDepth:hSource:SourcePlanningContextValid contextanchor:nodespec:SubgraphSpec nodehAnchorInTopology:(GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec).anchor (denote context.topology).verticeshRawSubgraphValid:(GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec).spec.ValidhAnchorNoSelfLoop:((GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec).anchor, (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec).anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).spec.ValidplannedFinalDefinitions context (runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)) = (constructedFinalRelation policy context (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).vertices have hNamespacedDefinitions : DefinitionCoverage (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).topology (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).definitions := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hSource:SourcePlanningContextValid contexthAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshRawSubgraphValid:rawRewrite.spec.ValidDefinitionCoverage (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions All goals completed! 🐙 have hNamespacedEntries : NodesInside (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).entryNodes (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).topology := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hSource:SourcePlanningContextValid contexthAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshRawSubgraphValid:rawRewrite.spec.ValidDefinitionCoverage (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions All goals completed! 🐙 have hNamespacedExits : NodesInside (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).exitNodes (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).topology := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hSource:SourcePlanningContextValid contexthAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshRawSubgraphValid:rawRewrite.spec.ValidDefinitionCoverage (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions All goals completed! 🐙 have hNoSelfLoop : (anchor, anchor) (denote context.topology).edges := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hSource:SourcePlanningContextValid contexthAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshRawSubgraphValid:rawRewrite.spec.ValidDefinitionCoverage (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext nodeinsertedDepth:hSource:SourcePlanningContextValid contextanchor:nodespec:SubgraphSpec nodehAnchorInTopology:(GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec).anchor (denote context.topology).verticeshRawSubgraphValid:(GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec).spec.ValidhAnchorNoSelfLoop:((GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec).anchor, (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec).anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.replaceNode spec)).spec.ValidhNamespacedDefinitions:DefinitionCoverage (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).topology (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).definitionshNamespacedEntries:NodesInside (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).entryNodes (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).topologyhNamespacedExits:NodesInside (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).exitNodes (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).topologyhNoSelfLoop:(anchor, anchor) (denote context.topology).edgescontext.definitions.erase anchor (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).definitions = (plannedFinalRelation context.topology (GraphRewrite.expandNode anchor ExpansionMode.replaceNode (namespaceSubgraphSpec (policy.namespaceNode anchor) spec))).vertices All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext nodeinsertedDepth:hSource:SourcePlanningContextValid contextanchor:nodespec:SubgraphSpec nodehAnchorInTopology:(GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec).anchor (denote context.topology).verticeshRawSubgraphValid:(GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec).spec.ValidhAnchorNoSelfLoop:((GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec).anchor, (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec).anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).spec.ValidplannedFinalDefinitions context (runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)) = (constructedFinalRelation policy context (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).vertices have hNamespacedDefinitions : DefinitionCoverage (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).topology (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).definitions := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hSource:SourcePlanningContextValid contexthAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshRawSubgraphValid:rawRewrite.spec.ValidDefinitionCoverage (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions All goals completed! 🐙 have hNamespacedEntries : NodesInside (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).entryNodes (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).topology := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hSource:SourcePlanningContextValid contexthAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshRawSubgraphValid:rawRewrite.spec.ValidDefinitionCoverage (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions All goals completed! 🐙 have hNamespacedExits : NodesInside (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).exitNodes (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).topology := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hSource:SourcePlanningContextValid contexthAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshRawSubgraphValid:rawRewrite.spec.ValidDefinitionCoverage (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions All goals completed! 🐙 have hAnchorIn : anchor (denote context.topology).vertices := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hSource:SourcePlanningContextValid contexthAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshRawSubgraphValid:rawRewrite.spec.ValidDefinitionCoverage (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext nodeinsertedDepth:hSource:SourcePlanningContextValid contextanchor:nodespec:SubgraphSpec nodehAnchorInTopology:(GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec).anchor (denote context.topology).verticeshRawSubgraphValid:(GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec).spec.ValidhAnchorNoSelfLoop:((GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec).anchor, (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec).anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope spec)).spec.ValidhNamespacedDefinitions:DefinitionCoverage (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).topology (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).definitionshNamespacedEntries:NodesInside (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).entryNodes (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).topologyhNamespacedExits:NodesInside (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).exitNodes (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).topologyhAnchorIn:anchor (denote context.topology).verticescontext.definitions (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).definitions = (plannedFinalRelation context.topology (GraphRewrite.expandNode anchor ExpansionMode.retainNodeAsEnvelope (namespaceSubgraphSpec (policy.namespaceNode anchor) spec))).vertices All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext nodeinsertedDepth:hSource:SourcePlanningContextValid contextanchor:nodespec:SubgraphSpec nodehAnchorInTopology:(GraphRewrite.appendAfter anchor spec).anchor (denote context.topology).verticeshRawSubgraphValid:(GraphRewrite.appendAfter anchor spec).spec.ValidhAnchorNoSelfLoop:((GraphRewrite.appendAfter anchor spec).anchor, (GraphRewrite.appendAfter anchor spec).anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy (GraphRewrite.appendAfter anchor spec)).spec.ValidplannedFinalDefinitions context (runtimePlannerRewrite policy (GraphRewrite.appendAfter anchor spec)) = (constructedFinalRelation policy context (GraphRewrite.appendAfter anchor spec)).vertices have hNamespacedDefinitions : DefinitionCoverage (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).topology (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).definitions := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hSource:SourcePlanningContextValid contexthAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshRawSubgraphValid:rawRewrite.spec.ValidDefinitionCoverage (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions All goals completed! 🐙 have hNamespacedEntries : NodesInside (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).entryNodes (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).topology := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hSource:SourcePlanningContextValid contexthAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshRawSubgraphValid:rawRewrite.spec.ValidDefinitionCoverage (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions All goals completed! 🐙 have hNamespacedExits : NodesInside (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).exitNodes (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).topology := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hSource:SourcePlanningContextValid contexthAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshRawSubgraphValid:rawRewrite.spec.ValidDefinitionCoverage (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions All goals completed! 🐙 have hAnchorIn : anchor (denote context.topology).vertices := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hSource:SourcePlanningContextValid contexthAnchorInTopology:rawRewrite.anchor (denote context.topology).verticeshRawSubgraphValid:rawRewrite.spec.ValidDefinitionCoverage (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext nodeinsertedDepth:hSource:SourcePlanningContextValid contextanchor:nodespec:SubgraphSpec nodehAnchorInTopology:(GraphRewrite.appendAfter anchor spec).anchor (denote context.topology).verticeshRawSubgraphValid:(GraphRewrite.appendAfter anchor spec).spec.ValidhAnchorNoSelfLoop:((GraphRewrite.appendAfter anchor spec).anchor, (GraphRewrite.appendAfter anchor spec).anchor) (denote context.topology).edgeshNamespacedValid:(runtimePlannerRewrite policy (GraphRewrite.appendAfter anchor spec)).spec.ValidhNamespacedDefinitions:DefinitionCoverage (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).topology (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).definitionshNamespacedEntries:NodesInside (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).entryNodes (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).topologyhNamespacedExits:NodesInside (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).exitNodes (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).topologyhAnchorIn:anchor (denote context.topology).verticescontext.definitions (namespaceSubgraphSpec (policy.namespaceNode anchor) spec).definitions = (plannedFinalRelation context.topology (GraphRewrite.appendAfter anchor (namespaceSubgraphSpec (policy.namespaceNode anchor) spec))).vertices All goals completed! 🐙

Runtime validation inputs not computed by the pure construction equations.

structure RuntimeConstructionValidation (policy : RuntimeNamespacePolicy node) (context : PlanningContext node) (rawRewrite : GraphRewrite node) (insertedDepth : Nat) : Prop where

The runtime namespace validator accepted local syntax and freshness.

namespaceDiscipline : NamespaceDiscipline policy.localAllowed (policy.namespaceNode rawRewrite.anchor) context rawRewrite.spec

The raw anchor exists in the current topology.

anchorInTopology : rawRewrite.anchor (denote context.topology).vertices

The raw anchor has a current definition.

anchorHasDefinition : rawRewrite.anchor context.definitions

The current topology is already a DAG before planning starts.

sourceAcyclic : Acyclic context.topology

The raw inserted subgraph passed runtime subgraph validation.

rawSubgraphValid : rawRewrite.spec.Valid

Runtime longest-path computation agrees with the proof-side inserted-depth witness.

insertedDepthMatches : LongestInsertedPathNodeCount (runtimePlannerRewrite policy rawRewrite).spec insertedDepth

The final definition domain exactly covers final topology vertices.

finalDefinitionsCover : DefinitionCoverage (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions

The runtime validated the final topology as acyclic.

finalAcyclic : Acyclic (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology

Runtime-shaped inputs from which construction validation is derived.

The remaining explicit fields correspond to executable checks: namespace validation, source anchor membership, raw subgraph validation, longest-path cost computation, and final DAG validation. Source definition coverage derives anchor definition membership and final definition coverage.

structure RuntimeConstructionInputs (policy : RuntimeNamespacePolicy node) (context : PlanningContext node) (rawRewrite : GraphRewrite node) (insertedDepth : Nat) : Prop where

The current materialized topology and definition domain are valid.

sourceValid : SourcePlanningContextValid context

The runtime namespace validator accepted local syntax and freshness.

namespaceDiscipline : NamespaceDiscipline policy.localAllowed (policy.namespaceNode rawRewrite.anchor) context rawRewrite.spec

The raw anchor exists in the current topology.

anchorInTopology : rawRewrite.anchor (denote context.topology).vertices

The raw inserted subgraph passed runtime subgraph validation.

rawSubgraphValid : rawRewrite.spec.Valid

Runtime longest-path computation agrees with the proof-side inserted-depth witness.

insertedDepthMatches : LongestInsertedPathNodeCount (runtimePlannerRewrite policy rawRewrite).spec insertedDepth

The runtime validated the final topology as acyclic.

finalAcyclic : Acyclic (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology

Runtime-shaped inputs derive the older construction-validation bundle.

theorem RuntimeConstructionInputs.toValidation {policy : RuntimeNamespacePolicy node} {context : PlanningContext node} {rawRewrite : GraphRewrite node} {insertedDepth : Nat} (hInputs : RuntimeConstructionInputs policy context rawRewrite insertedDepth) : RuntimeConstructionValidation policy context rawRewrite insertedDepth := { namespaceDiscipline := hInputs.namespaceDiscipline anchorInTopology := hInputs.anchorInTopology anchorHasDefinition := hInputs.sourceValid.anchorHasDefinition hInputs.anchorInTopology sourceAcyclic := hInputs.sourceValid.sourceAcyclic rawSubgraphValid := hInputs.rawSubgraphValid insertedDepthMatches := hInputs.insertedDepthMatches finalDefinitionsCover := constructedPlannedRewriteDelta_finalDefinitionsCover hInputs.sourceValid hInputs.anchorInTopology hInputs.rawSubgraphValid finalAcyclic := hInputs.finalAcyclic }

Runtime-shaped inputs carry the source-valid invariant to the next planner context.

theorem RuntimeConstructionInputs.toNextSourceValid {policy : RuntimeNamespacePolicy node} {context : PlanningContext node} {rawRewrite : GraphRewrite node} {insertedDepth : Nat} (hInputs : RuntimeConstructionInputs policy context rawRewrite insertedDepth) : SourcePlanningContextValid { topology := (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology definitions := (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions } := { sourceAcyclic := hInputs.finalAcyclic definitionsCover := constructedPlannedRewriteDelta_finalDefinitionsCover (insertedDepth := insertedDepth) hInputs.sourceValid hInputs.anchorInTopology hInputs.rawSubgraphValid }

The concrete construction equations establish RuntimePlannerConstruction.

theorem constructedPlannedRewriteDelta_runtimePlannerConstruction {policy : RuntimeNamespacePolicy node} {context : PlanningContext node} {rawRewrite : GraphRewrite node} {insertedDepth : Nat} (hValidation : RuntimeConstructionValidation policy context rawRewrite insertedDepth) : RuntimePlannerConstruction policy context rawRewrite (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth) := node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepthRuntimePlannerConstruction policy context rawRewrite (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth) node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepthRuntimeDeltaMatches policy context rawRewrite (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth)node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepthRuntimeCostMatches policy rawRewrite (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth) node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepthRuntimeDeltaMatches policy context rawRewrite (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth) node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepthdenote (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology = plannedFinalRelation context.topology (runtimePlannerRewrite policy rawRewrite)node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).entryNodes = (runtimePlannerRewrite policy rawRewrite).spec.entryNodesnode:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).exitNodes = (runtimePlannerRewrite policy rawRewrite).spec.exitNodesnode:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).newNodes = relationAddedNodes (denote context.topology) (denote (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology)node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).removedNodes = relationRemovedNodes (denote context.topology) (denote (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology)node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).addedEdges = relationAddedEdges (denote context.topology) (denote (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology)node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions = plannedFinalDefinitions context (runtimePlannerRewrite policy rawRewrite) node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepthdenote (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology = plannedFinalRelation context.topology (runtimePlannerRewrite policy rawRewrite) All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).entryNodes = (runtimePlannerRewrite policy rawRewrite).spec.entryNodes All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).exitNodes = (runtimePlannerRewrite policy rawRewrite).spec.exitNodes All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).newNodes = relationAddedNodes (denote context.topology) (denote (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology) All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).removedNodes = relationRemovedNodes (denote context.topology) (denote (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology) All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).addedEdges = relationAddedEdges (denote context.topology) (denote (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology) All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).definitions = plannedFinalDefinitions context (runtimePlannerRewrite policy rawRewrite) All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepthRuntimeCostMatches policy rawRewrite (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth) node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).cost.addedNodes = (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).newNodes.cardnode:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).cost.addedEdges = (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).addedEdges.cardnode:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth insertedDepth_1, LongestInsertedPathNodeCount (runtimePlannerRewrite policy rawRewrite).spec insertedDepth_1 (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).cost.addedDepth = match (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).anchorDisposition with | RewriteAnchorDisposition.removed => insertedDepth_1 - 1 | RewriteAnchorDisposition.retained => insertedDepth_1node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth entryList, RuntimeNodeListMatches entryList (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).entryNodes (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).cost.frontierDelta = entryList.length - 1node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).cost.rewriteOps = 1 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).cost.addedNodes = (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).newNodes.card All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).cost.addedEdges = (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).addedEdges.card All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth insertedDepth_1, LongestInsertedPathNodeCount (runtimePlannerRewrite policy rawRewrite).spec insertedDepth_1 (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).cost.addedDepth = match (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).anchorDisposition with | RewriteAnchorDisposition.removed => insertedDepth_1 - 1 | RewriteAnchorDisposition.retained => insertedDepth_1 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).cost.addedDepth = match (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).anchorDisposition with | RewriteAnchorDisposition.removed => insertedDepth - 1 | RewriteAnchorDisposition.retained => insertedDepth All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth entryList, RuntimeNodeListMatches entryList (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).entryNodes (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).cost.frontierDelta = entryList.length - 1 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepthentryNodes:Finset node := (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).entryNodes entryList, RuntimeNodeListMatches entryList (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).entryNodes (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).cost.frontierDelta = entryList.length - 1 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepthentryNodes:Finset node := (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).entryNodesRuntimeNodeListMatches entryNodes.toList (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).entryNodesnode:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepthentryNodes:Finset node := (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).entryNodes(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).cost.frontierDelta = entryNodes.toList.length - 1 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepthentryNodes:Finset node := (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).entryNodesRuntimeNodeListMatches entryNodes.toList (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).entryNodes All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepthentryNodes:Finset node := (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).entryNodes(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).cost.frontierDelta = entryNodes.toList.length - 1 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepthentryNodes:Finset node := (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).entryNodeshEntryCard:entryNodes.card = entryNodes.toList.length(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).cost.frontierDelta = entryNodes.toList.length - 1 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepthentryNodes:Finset node := (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).entryNodeshEntryCard:entryNodes.card = entryNodes.toList.lengthentryNodes.card - 1 = entryNodes.toList.length - 1 All goals completed! 🐙 node:Typeinst✝:DecidableEq nodepolicy:RuntimeNamespacePolicy nodecontext:PlanningContext noderawRewrite:GraphRewrite nodeinsertedDepth:hValidation:RuntimeConstructionValidation policy context rawRewrite insertedDepth(constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).cost.rewriteOps = 1 All goals completed! 🐙

Concrete construction plus budget admission gives an abstract admissible rewrite.

theorem constructedPlannedRewriteDelta_admissible {policy : RuntimeNamespacePolicy node} {context : PlanningContext node} {rawRewrite : GraphRewrite node} {insertedDepth : Nat} {budget remaining : RewriteBudget} {contractOk : Graph node Prop} (hValidation : RuntimeConstructionValidation policy context rawRewrite insertedDepth) (hAdmitted : AdmittedRewriteDelta budget (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth) remaining) (hContracts : g, denote g = denote context.topology contractOk g contractOk (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology) : admissible ((constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).toRewrite context.topology (plannedRewriteSafety_of_checks (runtimePlannerConstruction_planGraphRewriteChecks (constructedPlannedRewriteDelta_runtimePlannerConstruction hValidation)) hContracts)) context.topology budget := runtimePlannerConstruction_admissible (constructedPlannedRewriteDelta_runtimePlannerConstruction hValidation) hAdmitted hContracts

Runtime-shaped construction inputs plus budget admission give an admissible rewrite.

theorem constructedPlannedRewriteDelta_admissible_of_inputs {policy : RuntimeNamespacePolicy node} {context : PlanningContext node} {rawRewrite : GraphRewrite node} {insertedDepth : Nat} {budget remaining : RewriteBudget} {contractOk : Graph node Prop} (hInputs : RuntimeConstructionInputs policy context rawRewrite insertedDepth) (hAdmitted : AdmittedRewriteDelta budget (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth) remaining) (hContracts : g, denote g = denote context.topology contractOk g contractOk (constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).topology) : admissible ((constructedPlannedRewriteDelta policy context rawRewrite insertedDepth).toRewrite context.topology (plannedRewriteSafety_of_checks (runtimePlannerConstruction_planGraphRewriteChecks (constructedPlannedRewriteDelta_runtimePlannerConstruction hInputs.toValidation)) hContracts)) context.topology budget := constructedPlannedRewriteDelta_admissible hInputs.toValidation hAdmitted hContractsend ConstructedDeltaend Cortex.Wire