include "primitives.alh"

SimpleAttribute Natural{
    name = "Natural"
    constraint = $
        String function constraint(model : Element, name : String):
            if (is_physical_int(model["model"][name])):
                return "OK"!
            else:
                return "Natural has non-integer value"!
        $
}

SimpleAttribute String{
    name = "String"
    constraint = $
        String function constraint(model : Element, name : String):
            if (is_physical_string(model["model"][name])):
                return "OK"!
            else:
                return "String has non-string value"!
        $
}

SimpleAttribute Boolean {
    name = "Boolean"
}

Class Named {
    name = "Named"
    name : String
}
Class Place : Named {
    name = "Place"
    tokens : Natural
}
Class Transition : Named {
    name = "Transition"
}
Class Port : Named {
    name = "Port"
}

Association P2T (Place, Transition) {
    name = "P2T"
}
Association T2P (Transition, Place) {
    name = "T2P"
}
Association PortPlace (Port, Place) {
    name = "PortPlace"
}
Association Related (Port, Port) {
    name = "Related"
}
