Optimization Of discrete and differential inclusions of Goursat-Darboux type with state constraints