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

Mu-Prolog: out of memory



Hi, 
We are presently using Centaur system to build a compiler prototype.
Translation rules for our language expressions have been coded in
TYPOL.

Our judgements have the following shape:
	ENV |- EXP -> CODE

where ENV is the translation environment	
      EXP is an expression
      CODE is the expression translation code
	Rem. abstract syntax for code...
		ch -> implemented as STRING;
		code -> CH *...
		CH	::= ch;
		CODE	::= code;

We are using Mu-Prolog's predicate appendtree/3 to concatenate
sub-expressions translation code. 
   
Here is our problem. We do not succeed in translating expressions for
which the corresponding abstract syntax tree is relatively deep.
For example, take the following program which presents several nested
applications

	let x1 = 1 in
		let x2 = 2 in

			x1 + x2 + x1 + x2 +
			x1 + x2 + x1 + x2 +
			x1 + x2 + x1 + x2 +	
			x1 + x2 + x1 + x2 

In this case, the execution is aborted during translation.
"Mu-Prolog: out of memory" is given as an error message.

However, translation of the same expression with one addition in
less succeeds.

We believe the problem is caused by Mu-Prolog limited stack size.
Since the translation code for an expression is built from the code
generated for its sub-expressions, the stack is inevitably increasing till
the leaves of the abstract syntax tree are reached.

Can Mu-Prolog's stack size constrain us this way , forcing us to limit
the nesting of expressions in the programs we want to translate? 
Thanks in advance for your answer,

Regards,

--
Julie Vachon
Departement d'informatique et de recherche operationnelle
Universite de Montreal, C.P. 6128 succursale A, Montreal, Quebec H3C 3J7
Tel. (514) 343-6111 poste 1962  | e-mail: vachonj@iro.umontreal.ca 
Fax  (514) 343-5834		|