Prolog "geler"
/**
* Warranty & Liability
* To the extent permitted by applicable law and unless explicitly
* otherwise agreed upon, XLOG Technologies AG makes no warranties
* regarding the provided information. XLOG Technologies AG assumes
* no liability that any problems might be solved with the information
* provided by XLOG Technologies AG.
*
* Rights & License
* All industrial property rights regarding the information - copyright
* and patent rights in particular - are the sole property of XLOG
* Technologies AG. If the company was not the originator of some
* excerpts, XLOG Technologies AG has at least obtained the right to
* reproduce, change and translate the information.
*
* Reproduction is restricted to the whole unaltered document. Reproduction
* of the information is only allowed for non-commercial uses. Selling,
* giving away or letting of the execution of the library is prohibited.
* The library can be distributed as part of your applications and libraries
* for execution provided this comment remains unchanged.
*
* Restrictions
* Only to be distributed with programs that add significant and primary
* functionality to the library. Not to be distributed with additional
* software intended to replace any components of the library.
*
* Trademarks
* Jekejeke is a registered trademark of XLOG Technologies AG.
*/
:- multifile(runner_case/5).
:- discontiguous(runner_case/5).
:- multifile(runner_pred/5).
:- discontiguous(runner_pred/5).
:- multifile(runner_file/3).
runner_file(events, geler, 'XLOG 4.3 geler').
/****************************************************************/
/* Portray extras */
/****************************************************************/
/* portray_term(S, T) */
runner_pred(portray_term,2, events, geler, 'XLOG 4.3.1').
runner_case(portray_term,2, events, geler, 'XLOG 4.3.1, XLOG 1') :-
X = '$ATTR'(V,_), portray_term(X, T),
V == T.
/****************************************************************/
/* Geler extras */
/****************************************************************/
/* unify(S, T) */
runner_pred(unify,2, events, geler, 'XLOG 4.3.2').
runner_case(unify,2, events, geler, 'XLOG 4.3.2, XLOG 1') :-
\+ unify(f(X,X,X),f(_,b,f(_))).
runner_case(unify,2, events, geler, 'XLOG 4.3.2, XLOG 2') :-
unify(f(g(_),Y), f(_,g(Y))),
Y == g(Y).
/* dif(S, T) */
runner_pred(dif,2, events, geler, 'XLOG 4.3.3').
runner_case(dif,2, events, geler, 'XLOG 4.3.3, XLOG 1') :-
dif(f(X,X,X),f(Y,b,f(_))), Y = '$ATTR'(_,L),
var(L).
runner_case(dif,2, events, geler, 'XLOG 4.3.3, XLOG 2') :-
dif(f(g(_),Y), f(_,g(Y))), Y = '$ATTR'(_,L),
compound(L).
runner_case(dif,2, events, geler, 'XLOG 4.3.3, XLOG 3') :-
dif(f(X,X,X),f(Y,b,Z)), \+ unify(f(Z,Y,X),f(b,b,b)).
runner_case(dif,2, events, geler, 'XLOG 4.3.3, XLOG 4') :-
dif(f(X,X,X),f(Y,b,Z)), unify(f(Z,Y,X),f(b,b,a)).
runner_case(dif,2, events, geler, 'XLOG 4.3.3, XLOG 5') :-
unify(X,Y), dif(f(X,X),f(Y,Z)), \+ unify(Y,Z).
/* freeze(T, G) */
runner_pred(freeze,2, events, geler, 'XLOG 4.3.4').
runner_case(freeze,2, events, geler, 'XLOG 4.3.4, XLOG 1') :-
freeze(X, (deref(X,Y), Z is Y+1)), unify(X,2),
Z == 3.
runner_case(freeze,2, events, geler, 'XLOG 4.3.4, XLOG 2') :-
unify(T, X), freeze(X, (deref(X,Y), Z is Y+1)), unify(T,2),
Z == 3.
runner_case(freeze,2, events, geler, 'XLOG 4.3.4, XLOG 3') :-
freeze(X, (deref(X,Y), Z is Y+1)), unify(T, X), unify(T,2),
Z == 3.
/* when(C, G) */
runner_pred(when,2, events, geler, 'XLOG 4.3.5').
runner_case(when,2, events, geler, 'XLOG 4.3.5, XLOG 1') :-
unify(T, X), when(nonvar(X), (deref(X,Y), Z is Y+1)), unify(T,2),
Z == 3.
runner_case(when,2, events, geler, 'XLOG 4.3.5, XLOG 2') :-
when((nonvar(X),nonvar(Y)), (deref(X,Z), deref(Y,T), W = (Z,T))),
unify(X,a), unify(Y,b),
W == (a,b).
runner_case(when,2, events, geler, 'XLOG 4.3.5, XLOG 3') :-
when((nonvar(X);nonvar(Y)), (deref(X,Z), deref(Y,T), W = (Z,T))),
unify(Y,a), deref(X,V),
W == (V,a).
runner_case(when,2, events, geler, 'XLOG 4.3.5, XLOG 4') :-
when(ground(h(X,g(_,X))), true), X = '$ATTR'(_,L),
compound(L).
runner_case(when,2, events, geler, 'XLOG 4.3.5, XLOG 5') :-
when(ground(h(X,g(Y,X))), true), Y = '$ATTR'(_,R),
var(R).