{
* File: ProductsDDI.sml.txt
* Author: Manfred Jeusfeld
* Created: 2021-06-18/M.Jeusfeld (2021-06-22/M.Jeusfeld)
* ------------------------------------------------------
* Small products example showing DDI
*
}

serialnumber in ALABEL end
numberofdoors in ALABEL end

NumericValue in OBJECT end

ProductType in OBJECT with 
  linkDR
     m1: NumericValue
end

ProductType!m1 with
  sourcelevel s: 2
  targetlevel t: 1
  label l: serialnumber
end

{---}


Car in OBJECT with
  IN c1: ProductType
  linkDR
    m2: NumericValue
end

Car!m2 with
  sourcelevel s: 1
  targetlevel t: 1
  label l: numberofdoors
end

{---}

"12345" in OBJECT with
  IN c1: NumericValue
end

"4" in OBJECT with
  IN c1: NumericValue
end

mycar123 in OBJECT with
  IN c1: Car
  linkDR
    m1: "12345";
    m2: "4"
end

mycar123!m1 with
  sourcelevel s: 0
  targetlevel t: 0
  label l: serialnumber
end

mycar123!m2 with
  sourcelevel s: 0
  targetlevel t: 0
  label l: numberofdoors
end


{* level violation
Car in OBJECT with 
  linkDR
   m3  : "3"
end 

"3" in OBJECT with
  IN c: NumericValue
end

Car!m3 with
  sourcelevel sl: 0
  targetlevel tl: 0
  label lab: numberofdoors
end
*}

{---}

WirelessCommunicationStandard in OBJECT end

DigitalWirelessCommunicationStandard in OBJECT with
  SPEC super: WirelessCommunicationStandard
end

GSMStandard in OBJECT with
  IN c: DigitalWirelessCommunicationStandard
end

"2G" in OBJECT with
 IN c: GSMStandard
end

"3G" in OBJECT with
 IN c: GSMStandard
end

"4G" in OBJECT with
 IN c: GSMStandard
end

"5G" in OBJECT with
 IN c: GSMStandard
end

{---}

protocol in ALABEL end


MobilePhone in OBJECT with
  IN c: ProductType
  linkDR m1: WirelessCommunicationStandard
end

MobilePhone!m1 with
  sourcelevel s: 1
  targetlevel t: 2
  label l: protocol
end


DigitalMobilePhone in OBJECT with
  SPEC super: MobilePhone
  linkDR m1: DigitalWirelessCommunicationStandard
end

DigitalMobilePhone!m1 with
  sourcelevel s: 1
  targetlevel t: 2
  label l: protocol
end

{---}


myphone in OBJECT with
  IN c: DigitalMobilePhone
  linkDR m1: "4G"
end

myphone!m1 with
  sourcelevel s: 0
  targetlevel t: 0
  label l: protocol
end

{---}


"8899123" in OBJECT with
  IN c1: NumericValue
end

myphone in OBJECT with
  linkDR
    m2: "8899123"
end

myphone!m2 with
  sourcelevel s: 0
  targetlevel t: 0
  label l: serialnumber
end