Use swipl in terminal to execute a prolog file.
Try the comand:
consult("nameofFile").
consult("sumi").
Calling the function "esumi":
esumi(V,grafo([1,2,3],[a(1,2), a(1,3)])).
Codes developed for the discipline "Applied logic to computing". - 2018.2
PrologMIT