Checking Termination of Datalog with Function Symbols Through Linear Constraints