A Fog Computing Approach For Cognitive, Reliable And Trusted Distributed Systems