Vladimir Gordeev
11/15/2018, 6:36 AMlayer('A', 'ComponentA1').
layer('A', 'ComponentA2').
read_components_in_dir('C', "c_layer").
io_allowed(Component1, Component2) :-
layer('A', Component1), layer('C', Component2), false;
io_allowed(Component1, Component2) :-
layer('A', Component2), layer('C', Component1), false;
io_allowed(Component1, Component2).
I'm not sure I got the Prolog code right, but you get the idea.
Thus it will throw a warning if it notices that code break constraint described in documentation.
This will motivate programmers describe higher level assumptions about code in documentation, because it constraints it and provides some kind of safety. Just like static typing or assertion does.Vladimir Gordeev
11/15/2018, 6:43 AMTudor Girba
11/15/2018, 7:10 AMVladimir Gordeev
11/15/2018, 7:13 AMTudor Girba
11/15/2018, 7:16 AMTudor Girba
11/15/2018, 7:16 AMcomponentA shouldNotUse: componentB
.Tudor Girba
11/15/2018, 7:19 AMVladimir Gordeev
11/15/2018, 7:22 AMshalabh
11/15/2018, 6:00 PMTudor Girba
11/15/2018, 6:03 PMTudor Girba
11/15/2018, 6:04 PMTudor Girba
11/15/2018, 9:06 PMshalabh
11/21/2018, 1:07 AMshalabh
11/21/2018, 1:08 AM