include "primitives.alh"

SimpleAttribute Float {
    constraint = $
        String function constraint(model : Element, name : String):
            if (bool_not(is_physical_float(model["model"][name]))):
                return "Float has no float value"!
            else:
                return "OK"!
        $
}

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

Class Block{}
Class ICBlock{}

Class ConstantBlock{
    value : Float
}

Class AdditionBlock{}
Class NegatorBlock{}
Class MultiplyBlock{}
Class InverseBlock{}
Class DelayBlock{}
Class IntegratorBlock{}
Class DerivatorBlock{}
Class ProbeBlock{
    name : String
}

Association Link(Block, Block){}
Association InitialCondition(Block, ICBlock){
    source_lower_cardinality = 1
    source_upper_cardinality = 1
}

Inheritance (ConstantBlock, Block){}
Inheritance (AdditionBlock, Block){}
Inheritance (NegatorBlock, Block){}
Inheritance (MultiplyBlock, Block){}
Inheritance (InverseBlock, Block){}
Inheritance (ProbeBlock, Block){}
Inheritance (ICBlock, Block){}
Inheritance (DelayBlock, ICBlock){}
Inheritance (IntegratorBlock, ICBlock){}
Inheritance (DerivatorBlock, ICBlock){}
