Yggdrasil

1 program Added 2026-03-13T10:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: YGGDRASIL
Provenance: commit a2f578b442 · authored 2026-03-13T04:57:04+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

2 sources · pl_id: pl/yggdrasil
LLM (this repo) · 1Pldb

Related languages

Basil (0.27)ParaSail (0.16)FOIL (0.12)Fril (0.12)Rail (0.12)

LLM-contributed programs

File System Invariant Verification

Provenance: commit a2f578b442 · authored 2026-03-13T04:57:04+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.py · added: 2026-03-13T10:00:00Z
# Simple file system specification using Yggdrasil
# Yggdrasil: A Machine-Checked Construction of File Systems
# From: https://github.com/uw-unsat/yggdrasil

from z3 import *

# Disk model: array of blocks
BlockSize = 512
NumBlocks = 1024

def make_disk():
    return Array('disk', BitVecSort(32), BitVecSort(8 * BlockSize))

def disk_read(disk, blkno):
    return disk[blkno]

def disk_write(disk, blkno, data):
    return Store(disk, blkno, data)

# File system invariant: superblock is valid
def fs_invariant(disk):
    sb = disk_read(disk, BitVecVal(0, 32))  # superblock at block 0
    magic = Extract(31, 0, sb)  # first 4 bytes are magic number
    return magic == BitVecVal(0xDEADBEEF, 32)

# Verify that writes preserve the invariant
def verify_write_preserves_invariant():
    disk = make_disk()
    blkno = BitVec('blkno', 32)
    data = BitVec('data', 8 * BlockSize)

    s = Solver()
    # Assume invariant holds before write
    s.add(fs_invariant(disk))
    # Write to non-superblock location
    s.add(UGT(blkno, BitVecVal(0, 32)))
    new_disk = disk_write(disk, blkno, data)
    # Check invariant still holds
    s.add(Not(fs_invariant(new_disk)))

    result = s.check()
    if result == unsat:
        print("Verified: writes to non-superblock preserve fs invariant")
    else:
        print("Counterexample found:", s.model())

if __name__ == '__main__':
    verify_write_preserves_invariant()

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Contribute — propose a file extension

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