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

35 lines
532 B
Plaintext
Raw Normal View History

%:- ensure_loaded(l
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 ).