57421ab2
Salvador Abreu
first stab at typ...
|
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
type(var(_,T,_,_), T) :- type(T).
type(lit(_,T), T) :- type(T).
type(id(_,T), T) :- type(T).
type(lit(E,array(T)), array(T)) :- type(E, T).
type(lit(_,T), T) :- type(T).
type([], _).
type([E|Es], T) :- type(E, T), type(Es, T).
% -- type(TYPE) ---------------------------------------------------------------
%
% type/1: generate or test valid types.
type(int). % integer
type(int(_L,_U)). % integer interval
type(float). % floating point
type(float(_L,_U)). % floating point interval
type(string). % string
type(array(T,1,_U)) :- type(T). % array of type
|
65f52800
Salvador Abreu
paccs output prog...
|
27
28
29
30
31
32
33
34
35
|
% bound(lb,T,LB)
% bound(ub,T,UB)
bound(lb,int(LB,_UB),LB).
bound(lb,int,1).
bound(ub,int(_LB,UB),UB).
bound(ub,int,999). % FIXME
|