This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/meld/maxtemp.meld

39 lines
652 B
Plaintext
Raw Normal View History

%:- ensure_loaded(l
2010-11-03 00:33:26 +00:00
type extensional root(module).
type extensional neighbor(module, module).
type extensional temperature(module, float).
type logical_neighbor parent(module, first module).
type maxTemp(module, max float).
parent(A, A) :- root(A).
parent(A, B) :-
neighbor(A, B),
parent(B, _).
maxTemp(A, T) :-
temperature(A, T).
maxTemp(B, T) :-
parent(A, B),
maxTemp(A, T).
type globalMax(module, max float).
globalMax(A, T) :-
maxTemp(A, T),
root(A).
globalMax(B, T) :-
neighbor(A, B),
globalMax(A, T).
type localMax(module).
localMax(A) :-
temperature(A,T),
forall
neighbor(A, B)
then
( temperature(B, TT), T > TT ).