1. I painted a wall in my room for forty minutes.
2. I trained my dog to give paw for forty minutes.
3. I taught Marika to play the piano for forty minutes.
There's nothing wrong with these sentences. They all answer the question
What did you do yesterday? The time phrase
for forty minutes, which expresses duration, shows clearly that the verbs are to be interpreted as
atelic. That means that a listener will interpret that you
didn't finish the task in each case.
4. I painted a wall in my room.
5. I trained my dog to give paw.
6. I taught her to play the piano.
These are different. Since these sentences do not have duration time phrases, interpretation will depend on contextual cues. It may be interpreted that the tasks were finished and it may not. It depends on the context. If you want to explore this further, and usefully, we'd need to clarify the context.
Note that without any context at all, there is a natural telicity in the verb aspect. If you say
I painted a wall in my room with no other contextual cues, the interpretation that you completed the task is heavily biased. In semantics, this is called a
telic interpretation. However (and this is very important!), in the right context, this telic interpretation may be overridden. It's very complicated.
I reckon that words and sentences in the English language have meaning.
You're right but that's only half of the picture. Words and sentences naturally have what we call
word meaning and
sentence meaning. These often conflict with what we call
speaker meaning, which is the meaning that the speaker wants to communicate. So it's possible that a speaker can say a sentence where the words mean one thing but the meaning that a listener understands is completely the opposite thing. Of course, speaker meaning is much more important as this is the goal of interpretation.