From 32a4ea3a9448222b791f27abf48cb087ed4ed664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Thu, 19 Jun 2014 15:04:48 +0100 Subject: [PATCH] patch by J santos to make ORP work again. --- pl/yapor.yap | 60 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/pl/yapor.yap b/pl/yapor.yap index 87f6ec851..4c0cae37a 100644 --- a/pl/yapor.yap +++ b/pl/yapor.yap @@ -1,34 +1,50 @@ -/** - @file yapor.yap +:- system_module( '$_utils', [callable/1, + current_op/3, + nb_current/2, + nth_instance/3, + nth_instance/4, + op/3, + prolog/0, + recordaifnot/3, + recordzifnot/3, + simple/1, + subsumes_term/2], ['$getval_exception'/3]). - @defgroup yapor Or-parallelism in YAP +:- use_system_module( '$_boot', ['$live'/0]). - Support for or-parallelism through parallel_findall/3 and - friends. +:- use_system_module( '$_errors', ['$do_error'/2]). - @{ - - */ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% %% +%% The YapTab/YapOr/OPTYap systems %% +%% %% +%% YapTab extends the Yap Prolog engine to support sequential tabling %% +%% YapOr extends the Yap Prolog engine to support or-parallelism %% +%% OPTYap extends the Yap Prolog engine to support or-parallel tabling %% +%% %% +%% %% +%% Yap Prolog was developed at University of Porto, Portugal %% +%% %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -:- system_module( yapor, [], []). +:- meta_predicate + parallel(0), + parallel_findall(?,0,?), + parallel_findfirst(?,0,?), + parallel_once(0). -/** or_statistics(Key, List) is det - Report the main statistics on parallel execution, where _Key_ must take one of these values: - - - total_memory: a list wwhere the first element is _BytesInUse_ and the - second is _BytesAllocated_. - - - or_frames - - query_goal_solution_frames - - query_goal_answer_frames - -*/ -or_statistics(_,_) :- + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% or_statistics/0 %% +%% opt_statistics/0 %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +or_statistics :- current_output(Stream), or_statistics(Stream). -opt_statistics(_) :- +opt_statistics :- current_output(Stream), opt_statistics(Stream).