Overlog
1 program
Added 2026-03-06T10:00:00Z
Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled
Evidence
Report issue
View issues
Aliases: OverLog, P2 Overlog
Provenance: commit d49bd6cca9 · authored 2026-03-06T02:10:23+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)
Related languages
LLM-contributed programs
Shortest Path Routing
Provenance: commit d49bd6cca9 · authored 2026-03-06T02:10:23+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
/* Overlog: Shortest Path Routing
* Classic declarative networking example from the P2 system.
* Based on: B.T. Loo et al., "Declarative Networking", CACM 2009.
*/
/* Table declarations */
materialize(link, infinity, infinity, keys(1,2)).
materialize(path, infinity, infinity, keys(1,2,3)).
materialize(bestPath, infinity, infinity, keys(1,2)).
/* Base case: a direct link is a path */
path(@Src, Dst, Cost) :-
link(@Src, Dst, Cost).
/* Inductive case: extend a path through an intermediate node */
path(@Src, Dst, Cost) :-
link(@Src, Next, Cost1),
path(@Next, Dst, Cost2),
Cost := Cost1 + Cost2.
/* Keep only the shortest (minimum cost) path to each destination */
bestPath(@Src, Dst, min<Cost>) :-
path(@Src, Dst, Cost).