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
2010-11-03 16:16:40 +00:00

34 lines
512 B
Plaintext

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 ).