[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

errors



Arezki BRAHMI DEA LIM (stage) writes:
 > 
 > projection[T1, T2: TYPE] : THEORY
 >    BEGIN
 > 	C1: TYPE = list[T1]
 > 	C2: TYPE = list[T2]
 > 	proj: VAR [C1->C2]
 > 	f: VAR [T1->T2]
 > 	l: VAR C1
 > 	x: VAR T1
 > 	proj(l): RECURSIVE [C1->C2] =
 > 		CASES l OF
 > 			null: null,
 > 			cons(x,y): cons(f(car(l)),proj(cdr(l)))
 > 		ENDCASES 
 > 	MEASURE length(l)
 >  
 >    END projection
 > 
 > After M-x tc message error is: Free variables not allowed here
 > the curssor is placed there f(car(l)),proj(cdr(l)
 > 

You have declared `f' to be a *variable* of type [T1->T2].  You have
not bound f with the definition of proj.  Thus, f is a free variable.

You either need to redefine f as a constant (or theory parameter), or
include f as a formal argument to your definition of f.

Regards,

-- 
-- Paul S. Miner                | phone: (757) 864-6201
-- 1 South Wright St. / MS 130  | fax:   (757) 864-4234
-- NASA Langley Research Center | mailto:p.s.miner@larc.nasa.gov
-- Hampton, Virginia 23681-2199 | http://shemesh.larc.nasa.gov/~psm/