let checkLexp (l: lexp) (dect: dec_table) proct = match l with
          LVar(i)       ->  let (_,_,t) = (getVarDeclaration i dect) in (getType t)
        | LVec(i,x)     ->  if ((checkAexp x dect proct) = DIntthen (
                                let (_,_,t) = (getVarDeclaration i dect) in (getType t)
                            ) else (
                                raise (SEMANTIC_ERROR "Invalid Index")
                            )
        | LMat(i,x,y)    ->  if (((checkAexp x dect proct) = DInt& ((checkAexp y dect proct) = DInt)) then (
                                let (_,_,t) = (getVarDeclaration i dect) in (getType t)
                            ) else (
                                raise (SEMANTIC_ERROR "Invalid Index")
                            )