Did you know ... | Search Documentation: |
Pack logicmoo_utils -- prolog/logicmoo/redo_locally.pl |
This module allows drastic changes to prolog data to happen very temporarily. (to be reset or temporarily changed.) @author Douglas R. Miles @license LGPL
Fact :- !,fail.
use locally_hide_each/3 if respecting Non-determism is important (slightly slower?)
Fact :- !,fail.
But Ensure Non-determism is respected (slightly slower?)
uses each_call_cleanup/3 instead of setup_call_cleanup/3
But Ensure Non-determism is respected (effect is undone between Redos)
uses each_call_cleanup/3 instead of setup_call_cleanup/3 (slightly slower?)
for example,
?- current_prolog_flag(xref,Was)
,
locally_each(set_prolog_flag(xref,true),
assertion(current_prolog_flag(xref,true));assertion(current_prolog_flag(xref,true)))
,
assertion(current_prolog_flag(xref,Was))
,fail.
===
?- current_prolog_flag(xref,Was)
,
locally(set_prolog_flag(xref,true),
assertion(current_prolog_flag(xref,true));assertion(current_prolog_flag(xref,true)))
,
assertion(current_prolog_flag(xref,Was))
,fail.
===
set_prolog_flag - Temporarily change prolog flag
op/3 - change op
$gvar=Value - set a global variable
Temporally (thread_local) Assert some :Effect
use locally_each/3 if respecting Non-determism is important (slightly slower?)
===
?- current_prolog_flag(xref,Was)
,
locally(set_prolog_flag(xref,true),
assertion(current_prolog_flag(xref,true)))
,
assertion(current_prolog_flag(xref,Was))
.
===
The following predicates are exported, but not or incorrectly documented.