His pen was a wire fence ring around a tree (so he couldn't push it around the yard). I sat down next to the wire and ignored him.
He came closer to me, just to be companionable, still browsing in the grass head down. Silently I picked up the wire fence, moved it over him, set it down so now he was inside the ring.
After a minute he glanced up, looked around in a panicky way, and began to scream! You tricked me! Oh he was mad, charged around yelling.
So anyway, pigs are smart.
most types are not, but if you ever have the chance try to get to know KuneKune pigs. They are rather small, hairy, friendly domesticated pigs originally from New Zealand. See [1] for some pictures. Anyway they are very cuddly, for example when I call ours (whistling works but they usually see/hear/smell me before I need to call them) they'll come running over. If you then start petting their back they lay themselves on their side because they want you to rub their belly. If you sit down they'll try to come sit on your lap.