Wysteria

1 program Added 2026-03-13T12:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: enabled Evidence Report issue View issues
Aliases: —
Provenance: commit def0d24f90 · authored 2026-03-13T00:47:48+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

Aria (0.23)Reia (0.14)Woma (0.14)Wybe (0.14)MaterialX (0.14)

LLM-contributed programs

Millionaires Problem

Provenance: commit def0d24f90 · authored 2026-03-13T00:47:48+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch enabled
code.wy · added: 2026-03-13T12:00:00Z
(* the arguments to f are, a party set and a wire bundle that contains a nat for each party in that set *)
let f = \ (x:ps{true}) . \ (y:W x nat) .
  (* tmp2 is the value returned from the secure computation, why do we have this? Rule [T-Let2] binds x with ambient mode, perhaps b     ecause we are in Top currently? Yes. See typechk.ml, line 663 *)
  let tmp2 @ par(x) = 
  let tmp @ sec(x) =  (* start a secure block *)
  let a = wfold x [y;  (* fold function, main a record with current richest principal and their salary *)
 	               { #f:!Dummy, #g:0 }; (* assume every one has > 0 salary *)
	               \ (a:{#f:ps{true}, #g:nat}) . \(b:ps{true}) . \(c:nat) . (* ps is a single party, so can we add singleton in the refinement? *)
                       if a.#g > c then (* accumulator is better, so leave as is *)
			 a
		       else
			 {#f:b, #g:c} (* we have a new richest principal *)
	              ]
     in
     a.#f
    in 
    tmp
  in
  (* return a wire bundle with each principal mapped to the result *)
  wire x:tmp2
in

let all = {!Alice, !Bob, !Charlie} in
let w1 = wire {!Alice}:47 in
let w2 = wire {!Bob}:12 in
let w3 = wire {!Charlie}:55 in

let w7 = w1 ++ w2 in
let w8 = w7 ++ w3 in

let check_effects @ par(all) = (f all) w8
in

(* this wcopy lifts the resulst from par(all) mode to Top, we could do better with Top, also see the comment above *)
wcopy as all from check_effects

(*let all = {!Alice, !Bob, !Charlie, !Dave, !Evelyn, !Fred} in
let w1 = wire {!Alice}:2 in
let w2 = wire {!Bob}:3 in
let w3 = wire {!Charlie}:5 in
let w4 = wire {!Dave}:8 in
let w5 = wire {!Evelyn}:10 in
let w6 = wire {!Fred}:20 in

let w7 = w1 ++ w2 in
let w8 = w7 ++ w3 in
let w9 = w8 ++ w4 in
let w10 = w9 ++ w5 in
let w11 = w10 ++ w6 in

let check_effects @ par(all) = (f all) w11
in

wcopy as all from check_effects
*)

Contribute — propose a file extension

Tell us where to find evidence about Wysteria (mapped to pl/wysteria). 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/Wysteria/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← WYSIWISC Wyvern →