SociaLite

1 program Added 2026-02-27T12:25:45Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: enabled Evidence Report issue View issues
Aliases: —
Provenance: commit 303fce8f9c · authored 2026-02-27T13:26:32+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

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

Related languages

Clite (0.27)F-lite (0.27)mLite (0.27)Kite (0.21)GoLite (0.21)

LLM-contributed programs

Shortest Paths in Co-authorship Graph

Provenance: commit 303fce8f9c · authored 2026-02-27T13:26:32+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch enabled
code.py · added: 2026-02-27T12:25:45Z
N = 1274502

print "reading authorId.txt"
`IdToName(int id:0..$N, String n) indexby n.
 IdToName(id, n) :- l=$read("data/authorId.txt"),
                (n,s2)=$split(l,"\t"), id=$toInt(s2).`

Lam = 102025
Knuth = 67123
Dijkstra = 376

Src = Lam

print "reading coauthor.txt"
# Edge table has two columns representing edges of the co-authorship graph.
# The columns are (src-author, target-author, co-authored paper count).
# The graph is an undirected graph. So if A and B are co-authors with 2 papers,
# then the Edge table stores (A,B,2) and (B,A,2).
`Edge(int n:0..$N, (int t, int cnt)) multiset.
 Edge(s,t,cnt) :- l=$read("data/coauthor.txt"), (s1,s2,s3)=$split(l, "\t"),
               s=$toInt(s1), t=$toInt(s2), cnt=$toInt(s3).`

print "reading paperCount.txt"
# PaperCnt table has two columns representing
# author and his paper count.
`PaperCnt(int n:0..$N, int cnt).
 PaperCnt(n,cnt) :- l=$read("data/paperCount.txt"), (s1,s2)=$split(l, "\t"),
                    n=$toInt(s1), cnt=$toInt(s2).`

print "running shortest-paths"
`Path(int n:0..$N, int dist, int prev).
 Path(n, $min(d), prev) :- n=$Src, d=0, prev=-1 ;
                        :- Path(s, d1, prev1), Edge(s, n, _), d=d1+1, prev=s.`

def findPathTo(to, src=Src):
    path = []
    while True:
        path.append(to)
        t, dist, prev = `Path($to, dist, prev)`.next()
        if prev==src:
            path.append(src)
            break
        to = prev
    path.reverse()
    return path

def translatePath(path):
    translated = []
    for i in path:
        _, name = `IdToName($i, name)`.next()
        translated.append(name)
    return translated

path = findPathTo(Knuth)
print translatePath(path)

path = findPathTo(Dijkstra)
print translatePath(path)

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 SociaLite (mapped to pl/socialite). 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/SociaLite/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← social-networks-query-language SockZ →