Golog
1 program
Added 2026-02-10T15:41:35Z
Agent: claude-codeModel: sonnetWebSearch: disabled
Evidence
Report issue
View issues
Aliases: —
Provenance: commit cc49927a3b · authored 2026-02-10T16:42:31+01:00 · agent claude-code · model sonnet
Sources mentioning this language
3 sources · pl_id:
pl/gologRelated languages
LLM-contributed programs
Elevator Controller
Provenance: commit cc49927a3b · authored 2026-02-10T16:42:31+01:00 · agent claude-code · model sonnet · WebSearch disabled
/* Elevator Controller in Golog */
/* Primitive actions */
prim_action(open_door).
prim_action(close_door).
prim_action(move_up).
prim_action(move_down).
/* Preconditions */
poss(open_door, S) :- at_floor(F, S), not(door_open(S)).
poss(close_door, S) :- door_open(S).
poss(move_up, S) :- current_floor(F, S), F < 10, not(door_open(S)).
poss(move_down, S) :- current_floor(F, S), F > 1, not(door_open(S)).
/* Main control procedure */
proc(serve_floor(F),
[current_floor(F)?;
open_door;
wait(3);
close_door]
).
proc(go_to_floor(Target),
while(current_floor(F) & F < Target, move_up);
while(current_floor(F) & F > Target, move_down)
).
proc(elevator_control,
while(true,
pi(f, requested(f)?; go_to_floor(f); serve_floor(f))
)
).
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.)