Skip to content

Instantly share code, notes, and snippets.

@moustaki
Created July 6, 2010 17:20
Show Gist options
  • Save moustaki/465648 to your computer and use it in GitHub Desktop.
Save moustaki/465648 to your computer and use it in GitHub Desktop.
:- use_module(library('http/http_open')).
prove((A, B)) :-
A, B.
prove((A; B)) :-
A; B.
prove(H) :-
clause(H, B), !,
prove(B).
prove(Head) :- load(Head), Head.
% todo: fail silently
load(A) :-
http_open(A, S, []),
tmp_file('/tmp', Tmp),
open(Tmp, write, S2, []),
copy_stream_data(S, S2),
close(S),
close(S2),
consult(Tmp).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment