————————————————–
module annotations-test
imports liblib

signature
sorts Exp Type
constructors
Var : String -> Exp
Plus : Exp * Exp -> Exp
Int : Type
Float : Type

strategies

main =
!Plus(Var(“a”), Var(“b”)){Int}
; rm-annotations
————————————————–

Outputs term with annotations. Looking into this problem right now.

Submitted on 29 July 2005 at 13:30

On 29 July 2005 at 13:45 Jira commented:

STR-382, martin:
Smaller test:
——————————————
module annotations-test
imports list-cons

signature
sorts Exp Type
constructors
Var : String -> Exp
Plus : Exp * Exp -> Exp
Int : Type
Float : Type

strategies

main =
!Plus(Var(“a”), Var(“b”)){Int}

rm-annotations :
t -> t{}
——————————————

It seems that t -> t{} is not compiled correctly. The C code:
——————————————
ATerm rm_annotations_0_0 (ATerm t)
{
ATerm x_0 = NULL;
x_0 = t;
t = x_0;
return(t);
}
——————————————

Obviously, this does nothing.

Reassigning to Eelco.


On 29 July 2005 at 16:11 Jira commented:

STR-382, visser:
The back-end compiles patterns of the form !c(t*){^[]} to just a the
construction of the term with subterms t* and constructor c and no
arguments (which is equivalent to having an empty argument list).

In the case of variables !x{^[]} is wrong however, since here the
intention is to replace the annotations of the term bound to x
with the empty annotation list.

Log in to post comments