Issue 52 in teyjus: "register assignment1" in computing a normal form

0 views
Skip to first unread message

tey...@googlecode.com

unread,
Apr 3, 2011, 1:05:13 AM4/3/11
to teyjus...@googlegroups.com
Status: Accepted
Owner: dale.a.m...@gmail.com

New issue 52 by dale.a.m...@gmail.com: "register assignment1" in computing
a normal form
http://code.google.com/p/teyjus/issues/detail?id=52

When trying to compile the attached files lambdaterms-church.mod and .sig,
I get the error messages:

$ tjcc lambdaterms-church
none(0,0) : Error : unable to perform register assignment1
none(0,0) : Error : unable to perform register assignment1
none(0,0) : Error : unable to perform register assignment1
$

The process of compiling the clause for the predicate "three" may involve
computing a normal form for an expression that is the church numeral for
256 (f\x\ (f(f ... (f x)))). Have I bumped up against a design limitation
for this version of Teyjus? That is, is 256 too big.

Notice that the error message is not very useful (for example, the location
in the file of the error).

Specifics about the implementation are below.

$ tjcc -v
Teyjus version 2.0-b2
$ uname -a
Linux gerhard 2.6.35-28-generic #49-Ubuntu SMP Tue Mar 1 14:39:03 UTC 2011
x86_64 GNU/Linux


Attachments:
lambdaterms-church.mod 367 bytes
lambdaterms.sig 79 bytes

tey...@googlecode.com

unread,
Feb 7, 2013, 9:38:05 AM2/7/13
to teyjus...@googlegroups.com

Comment #1 on issue 52 by fafou...@gmail.com: "register assignment1" in
There are only 256 registers but there should be no limitation in the size
of the terms.

In the case of a first-order structure f (f (f (f (f (f ... the generated
code uses only a fixed number of registers.

However in the case you are describing (involving binders), this is not the
case, as the disassembled code shows:
put_index A255, #2
put_index A254, #2
put_index A253, #2
put_index A252, #2
put_index A251, #2
put_index A250, #2
put_index A249, #2
put_index A248, #2
put_index A247, #2
.............
..............


The problem only appears when compiling. Querying the evaluation of three
X = ((g\e\ g (g (g e))) (e\f\ e (e f)) (f\x\ f (f x))).
directly with tjsim gives the correct answer.




tey...@googlecode.com

unread,
Feb 7, 2013, 6:35:21 PM2/7/13
to teyjus...@googlegroups.com

Comment #2 on issue 52 by gopalan....@gmail.com: "register assignment1" in
The observation is correct---there is an easy reorganization of compilation
steps that should get rid of this problem. This is a known issue from the
first implementation of Teyjus that unfortunately did not get fixed in the
second version. I hope that I or someone else will find some time to look
at the code in the near future to correct this; I know what has to be done,
it is mainly an issue of getting all the details right.

Reply all
Reply to author
Forward
0 new messages