Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rla/766fd80ea320fb764085a0842347186e to your computer and use it in GitHub Desktop.
Save rla/766fd80ea320fb764085a0842347186e to your computer and use it in GitHub Desktop.
Prolog gensym example (broken)
:- use_module(library(gensym)).
:- dynamic student/3.
do_stuff:-
gensym(student, S1),
gensym(student, S2),
assertz(student(S1, john, doe)),
assertz(student(S2, jane, doe)).
show_id_of_john :-
student(ID, john, doe), write(ID).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment