NV

1 program Added 2026-03-13T06:35:48Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: enabled Evidence Report issue View issues
Aliases: NV network verification language
Provenance: commit 7d28de480b · authored 2026-03-13T07:36:22+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

CVL (0.47)NNL (0.39)JFlex (0.38)Z (0.37)NED (0.36)

LLM-contributed programs

Simple Routing Protocol

Provenance: commit 7d28de480b · authored 2026-03-13T07:36:22+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch enabled
code.nv · added: 2026-03-13T06:35:48Z
(*Routing via a Simple example protocol. *)
type simple_route = {pref:int; length:int; nexthop: tnode}

type attribute = option[simple_route]

let nodes = 5
let edges = {
    0=1; (* '=' is used for bidirectional links *)
    0=2; 
    1=3;
    2=3;
    3-4; (* '-' is used for undirectional links *)
    4-3;
}

(* 
       2
      / \
 4 - 3   0
      \ /
       1
*)

let init (u : tnode) = 
  match u with
  | 0n -> Some {pref=100; length=0; nexthop=0n}
  | _ -> None

let trans e x =
  match x with
  | None -> None
  | Some r ->
     (match e with
      | 0n~1n -> 
        Some {length = r.length+1; pref = 0; nexthop=0n;}
      | a~b -> 
        if a >n b then None (* Drop routes from "right" to "left"*)
        else Some {r with length = r.length+1; nexthop=a;})

let isBetter x y =
  match (x,y) with
  | (_, None) -> true 
  | (None, _) -> false
  | (Some b1, Some b2) ->
    if b1.pref > b2.pref then true
    else if b2.pref > b1.pref then false
    else if b1.length < b2.length then true
    else if b2.length < b1.length then false
    else if b1.nexthop <n b2.nexthop then true
    else false

let merge (u: tnode) x y =
  if isBetter x y then x else y


let sol = solution {init = init; trans = trans; merge = merge}

(* Does every node have a route when the network has converged to a stable state? *)
let reachable x =
  match x with
  | None -> false
  | Some _ -> true

(* Assert that every node is reachable *)
assert foldNodes (fun u v acc -> acc && reachable v) sol true

Contribute — propose a file extension

Tell us where to find evidence about NV (mapped to pl/nv). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/NV/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Nuwora nvdl →