Problem with generic inheritance

Pierre-Alexandre Voye ontologiae at gmail.com
Wed Mar 31 15:18:43 UTC 2010


Hi all, I have a big probleme with agent library. I tried to transform it
more generic, using genericity.

So, I defined a prototype PENCIL which inherit from AGENT(PENCIL).

(All the code is in the git repo application, branch master, in directory
application/examples/standard/agent)

I have a Section Header

  + name      := PENCIL;

  - copyright := "2003-2010 Sonntag Benoit; P-A";

  - author    := "Pierre-Alexandre Voye";
  - comment   := "Pencil agent";

Section Inherit

  + parent_agent:Expanded AGENT(PENCIL);

Section Public

  + step:INTEGER;

  + x:INTEGER;

  + y:INTEGER;

  + dx:INTEGER;
  + dy:INTEGER;

...


Agent is defined like this :

Section Header

  + name      := AGENT(V);


Maybe because PENCIL inherit from AGENT(PENCIL), I have an error from the
compiler :

$ lisaac  example.li
Load lip file: ./../make.lip
Warning: Slot `output_extension' not found.
Warning: Slot `is_library' not found.
Warning: Slot `output_extension' not found.
Depending pass: ....--SEMANTIC---------
Invariance type argument invalid.
Line 62 column 10 in PENCIL(.../application/examples/standard/agent/
pencil.li):
  - make s:STATE(PENCIL) <-
          ^

Line 44 column 10 in AGENT(.../application/examples/standard/agent/agent.li
):
  - make s:STATE(V) <-
          ^


I'm unable to understand what's the problem...

Surprasingly when I change

 + parent_agent:Expanded AGENT(PENCIL)

to

  + parent_agent:Expanded AGENT(SELF);

I have :

$ lisaac  example.li
Load lip file: ./../make.lip
Warning: Slot `output_extension' not found.
Warning: Slot `is_library' not found.
Warning: Slot `output_extension' not found.
Depending pass: ..--SEMANTIC---------
Cannot resolve type for type parameter SELF
Line 23 column 8 in PENCIL(.../application/examples/standard/agent/pencil.li
):
  + name      := PENCIL;
        ^


Thanks for your help,

regards,
P-A

-- 
---------------------
Isaac Project - http://www.lisaac.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/lisaac-devel/attachments/20100331/1b06cbd7/attachment.htm>


More information about the Lisaac-devel mailing list