The ABS Language

The Abstract Behavioral Specification Language (ABS) is a concurrent, object-oriented, modeling language that features functional data-types.

The current language specification is available as a PDF file.

Example

/*
 * PingPong.abs -- PingPong example
 *
 */
module PingPong;

data PingMsg = Fine
             | HelloPing 
             | ByePing 
             ;

data PongMsg = NoMsg 
         | Hello(Ping)
         | HowAreYou
         | ByePong
         ;

interface Ping {
    Unit ping(PingMsg m);
}

interface Pong {
    Unit hello(Ping ping);
    Unit pong(PongMsg m);
}

class PingImpl(Pong pong) implements Ping {
    Unit run(){
      pong!hello(this); 
    }

    Unit ping(PingMsg msg){
      PongMsg reply = case msg {
         HelloPing => HowAreYou;
         Fine => ByePong; 
         ByePing => NoMsg;
      };
      
      if (reply != NoMsg) {
         Fut<Unit> fu = pong!pong(reply);
         fu.get;
      }
     }
} 

class PongImpl implements Pong {
    Ping ping;

    Unit hello(Ping ping) {
       this.ping = ping;
       ping!ping(HelloPing);
    }

    Unit pong(PongMsg msg){
       if (msg == HowAreYou)
           ping!ping(Fine);
       else
           ping!ping(ByePing);
    } 

}

{
    Pong pong = new cog PongImpl(); 
    new cog PingImpl(pong); 
}