Reconstruction of the state equation and scalar field potential in inflationary cosmology