Mr Logic from Viz combines this with Sesquipedalian Loquaciousness. An example being upon hearing a shop assistant say "Everything's a pound", he immediately assumes that he could buy the entire contents of the shop for a pound, rather than costing one pound per individual item. He is told of his mistake, and then gets confused and tries to buy the cash register for a pound, only to be told it's not stock. He subsequently explains what the shop assistant should have said to him, before getting carried out by security.
Calvin gets up to this sometimes. On one occasion, when told to "get in the tub", he climbs into the very dry bathtub and sits there fully clothed until his mother realizes she doesn't hear any water running.
Calvin: I obey the letter of the law, if not the spirit.
This Harry Potter Fanfic has Percy Weasley, of all people, pulling this on Umbridge and her Muggle-Born Registration Commission and making their job much harder by "just doing his job according to the Ministry rules."
Mass Effect Human Revolution: Played both ways between Jensen and Executor Palin. Jensen ignored orders to cease the Saren investigation, but then pointed out that Palin had only declared the case was closed and had failed to go through the necessary channels to make the order official, so Jensen technically didn't do anything wrong. However, that technicality didn't stop Palin from suspending Jensen for a week without pay for another technicality regarding his investigation. Then, finally, Palin fills out the needed paperwork so Jensen answers directly to him.
The Infinite Loops makes this Harry Potter's modus operandi when dealing with his enemies.
Meanwhile, Mayor Mare has made this her speciality, managing to stop the Vogons blow up Equestria with it.
Films — Animated
In The Incredibles, Bob Parr would like to help his customers navigate Insuricare's labyrinthine policies to receive their insurance coverage, but he can't. As a side-effect, this makes his boss absolutely furious because Parr's actions are causing legitimate payments the business can't weasel out of.
Mr. Huff: They're penetrating the bureaucracy!
Films — Live-Action
In The Terminal, Viktor Navorski's home country goes through a civil war, rendering his passport useless. He can't go back home, and he can't step onto U.S. soil. Frank Dixon, the U.S. immigration officer, hopes that Viktor will try to break the rules by leaving the airport, which would make Navorski someone else's problem -- not his. Viktor doesn't, making him something of a Spanner in the Works. This was based on the Real Life Mehran Karimi Nasseri, who became trapped by the Iranian Revolution in Charles de Gaulle Airport, where he lived for 18 years.
In The Pentagon Wars, Lt. Col. Burton (Cary Elwes) keeps trying to report the deadly flaws in the Bradley Fighting Vehicle but is consistently thwarted by his superior, Maj. Gen. Partridge (Kelsey Grammar). After consulting the U.S. Army Book of Rules & Regulations, Burton publishes a report detailing the vehicle's every flaw and sends it to Partridge. Partridge orders the report rewritten to make the Bradley seem perfect. Burton follows regulations and writes a memo on the rewrite and sends it to all 198 people involved in the project. Partridge is furious and wants Burton disciplined, but his underlings tell him that Burton followed regulations to the letter.
In Brazil, Sam keeps the Central Services workers out of his apartment (for a while, at least) by asking to see their form 27B/6, claiming he's "a bit of a stickler for paperwork." From their reactions, it's pretty clear it's a bureaucratic formality they usually gloss over.
In Killing Them Softly, Mickey explains to Jackie that before coming to Boston, he killed someone from the wrong jurisdiction and, per the family's rules, he's only "allowed" to take on one of Jackie's two planned killings. Of course, Mickey isn't actually trying to be subversive; he's just lazy.
In Old School, the Dean is furious that the fraternity (of 30-something professionals) has gone through all the necessary legal channels to continue their lifestyle. The Dean's assistant notes that they're very good at filling out forms.
Many a fairy, genie, demon, or other magical creature is beholden to a set of rules but will cause as much damage as they can devise within those rules.
A Chilean folktale tells of a "roto" (kind of a country bumpkin) who sold his soul to the Devil in exchange for cash. When the Devil asks him when it should come pick up his soul, the roto tells him to do so the following day. Surprised, the Devil writes the agreement, saying that it'll take the soul "the next day". They meet daily for a while, the roto arguing that well, the contract says "next day", and that's tomorrow.
In The Lost Fleet, John Geary at one point deals with a request by his Obstructive Bureaucrat higher-ups to provide "any information related" to a decision he made. He responds by rationalizing that since all of it had some relevance to his decision making process, and giving them an infodump of everything in the entire fleet database in a single file. This takes several minutes for the entire combined computing power of the whole alliance fleet, and he wonders if it might crash their servers. Even if it didn't it would be functionally impossible to dig through the entire mess of information to find anything to use against him.
In the Discworld novels it's suggested that golems rebel this way (they tend to parody various robot related tropes) until they are free. This has the side effect of convincing people that they are stupid and/or insane.
As Vimes points out in Night Watch, The Oath of the Ankh-Morpork City Watch has a lovely little loophole in it: the duties of a Watchman are to "... uphold the Laws and Ordinances of the city of Ankh-Morpork comma serve the public trust comma and defend the subjects of His stroke Her bracket delete whichever is inappropriate bracket Majesty bracket name of reigning monarch bracket..." - but nothing about obeying orders. Another loophole in this oath was that the oathtaker promises to protect the subjects of his / her majesty, but doesn't say anything about defending the majesty themselves.
In Night Watch, Vimes uses this to rein in the Cable Street Particulars of the past (in his own time, the Particulars have been revived as a plainclothes division for occasions when stealth and espionage are required). There are numerous protocols in place to ensure the fair treatment of prisoners, but for the longest time, the Particulars have been entirely ignoring protocol because their reputation is so nasty that even other coppers are afraid of them. Vimes is able to take Refuge in Audacity and hobble the Particulars just by insisting on following protocol to the letter.
A few of the Treacle Mine Road Watchmen try to pull this on Vimes in Night Watch, but it doesn't last very long.
In Jingo, the City Watch comes under the command of Lord Rust, after the Patrician is forced out of office. Vimes and the rest of the Watch resign on the spot. Then Vimes points out that, as a nobleman (technically), he has the right to raise a personal militia for the upcoming war, and proceeds to do so, which just happens to include all his former City Watch subordinates...
Used for a last-minute save in Lois McMaster Bujold's Falling Free. The genetically-engineered quaddies having been legally defined as "post-fetal experimental tissue cultures," Captain Bannerji refuses to fire on them on the grounds that it could be considered an act of hazardous waste disposal, for which the proper forms have not been filled out.
In Robert A. Heinlein's The Number of the Beast, Jake's family decides to pull a White Mutiny (see below under Work to Rule) in order to pay him back for antics during Zeb's and Hilda's tenures as commanding officer and make sure he doesn't pull the same stuff when it's Deety's turn. Specifically, they do exactly what he says and no more, even things that were implied in the order, but not stated. note As a hypothetical example, if Jake asked Zeb to make him a cup of coffee, Zeb would go and prepare a cup of coffee, and then stand there next to the cup. He would not move either to go back to what he had been doing before, or bring the cup to Jake until specifically asked to do so. This forces him to micro-manage everything.
In Heinlein's Glory Road he said there are two kinds of military clerks. The first kind will quote the regulation that prohibits you from doing what you want. The second will dig into the book until they find one that helps you. He must have liked this one, because he mentioned it again almost word-for-word in The Door into Summer, this time about payment.
Also in the film verison, Harry's Ironic Echo when Umbridge is confronting the centaurs: she begs him to tell them she's harmless, to which he replies "I'm sorry, Professor, but I must not tell lies."
Dumbledore also manages to piss Umbridge off when she fires Trelawney by pointing out that although she has the power to fire teachers at Hogwarts, it doesn't mean she can also evict Trelawney from her home there, as the authority to decide the actual residency in the castle still lies with the Headmaster. He follows it up by reminding her that her right to hire staff applies only if he himself is unsuccessful in finding someone to fill the position, and hires Firenze (a centaur, who Umbridge is terrified of) on the spot to take over as Divination teacher.
The main character of Ella Enchanted adopts this as a lifestyle. She is required by magic to obey all orders given to her and finds this spectacularly annoying. So when those orders are not the sort that will harm anyone, she will obey those orders right down to the dregs, just to spite the person giving them. When ordered to sing louder, she practically shouts. When then ordered to sing quieter, she drops to a whisper, etc.
Tisiphone and Cerberus of Ravirn, both under orders to kill the title character, invoke this to allow him to free Persephone. When he escapes into Hades proper from the borderlands, Cerberus refuses to chase him because his job is to guard the borders, and Tisiphone insists on a strict interpretation of jurisdiction that prevents her and the other Furies from entering Hades at all.
Atlas Shrugged. When Dagny comes back from Galt's Gulch she cooperates with her brother for the first time and follows his every rule. He complains that she's never been so uncooperative in her life.
At the end of The Dresden Files book Ghost Story the threat of this is used against Queen Mab to enable the person she's trying to ensnare to still be able to act independently. Specifically, if Harry suspects that Mab has screwed with his mind in any way, he'll follow her orders to the letter—but only that, so that she will have to personally order him to do anything and everything, when he knows she really wants a Knight who is clever and will act on his own initiative.
In the Star Wars Expanded Universe novel X-Wing: Isard's Revenge, we meet a sympathetic Star Destroyer commander who was ordered to bombard a village because one of its inhabitants tried to kill the local warlord. So the commander took a shuttle down to the village to tell everyone how doomed they were, going on in great detail about his firing plans, and explaining that as soon as he got back to his ship, their homes would be flattened by turbolasers. Then he got back in his shuttle and called up his officers to go over the firing plan again. And then had them calibrate the sensors and weapons. Then do another weapons check, so the show of force would be absolutely perfect. Three hours later he finally went back to his Star Destroyer and proceeded to annihilate the long-since-empty village. The commander spun his report to emphasize how the survivors would be sure to spread their terrible story, and the warlord didn't kill him, but warned him not to fail him again. The commander would go on to accept "insubordinate" officers from the warlord's other crews who would otherwise be executed, and eventually surrendered to the New Republic.
Example of retaliatory Bothering by the Book in the Vorkosigan Saga: A Civil Campaign. Aral sponsors a bill making it easier for peasants to change from one Feudal Overlord to another. This naturally increases the rent and tax incomes of the more popular ones. One Count decided to breed several dozen girls in artificial wombs— a newly imported technology— thus increasing his district's population without having to compete fair and square. Though it was considered obviously wrong to exploit mass-produced children, he argued that he'd used his own genetic material for their paternal contribution, and they were therefore technically his daughters. There Ain't No Rule against having a very large family, after all... Whereupon Miles' friends realized that if they were his daughters, he could be required to pay a dowry for each and every one of them. The last we see is him screaming in rage right after the judgement is handed to him.
Jested about In Andre Norton's Ice Crown. One of Imfray's men, after rescuing him from his execution for treason, claims that he never heard an order saying he's no longer his commander, so it was his duty; Imfray points out that he must have heard it just before; the man says he's been hard of hearing ever since Imfray rescued him from a rock fall. Imfray carries on the joke with an observation that hearing loss could see him out of the guard, and the man assures him that if anyone knows he was involved, it did.
In Mary Johnstone's To Have and To Hold, the king sends word to the colony officials that they must send back Runaway Fiancée Lady Jocelyn and any man so rash as to marry her, which is to say Captain Percy. The officials object that this is irregular — the king must order the company to have her sent, and then the company must order its colony to do so. Captain Percy's friends work on him in court, and his next message to bless their union.
Live Action TV
Used in an episode of Scrubs when the nursing staff declared a "slow down" until their demands were met. Kelso specifically states that they'll work just fast enough that he can't fire them for it. And that he doesn't really have to worry about it because they won't do anything to hurt the patients.
One episode of Corner Gas has Davis and Karen using "Work to rule" as a form of protest. When they tell the mayor they're working "By the book", the mayor actually gives them a copy of the rule book, which is an encyclopedia-sized tome. They decide to go back to work normally.
In Red Dwarf, after Kryten quotes one too many Space Corps Directives, Rimmer reads the entire book of directives himself and uses them to make Lister, Cat and Kryten's lives into a living hell.
A classic one from Star Trek: The Next Generation features Captain Picard using this very trope as a tactic against the Sheliak, a race of Obstructive Bureaucrats. He requests a neutral third party to arbitrate the discussion, and picks a race that is currently hibernating, meaning the Sheliak can either be stuck waiting for several months, or Know When to Fold 'Em. They got the point he was making, and gave in.
When the main characters on Law & Order arrest a prison guard, the other guards show solidarity by refusing to transfer prisoners for arraignment unless the paperwork is perfect. On the first day, the arraignment judge manages to arraign less than an eighth of the defendants on his docket.
There's a moment in the first season where they invoked the Rush Act, giving the military CO of the station (Commander Sinclair) authority to end a dockworkers' strike by any means necessary. They obviously expect this to mean Sinclair will quell the strike by force; Sinclair, however, determines that the means necessary to end the strike involve drawing money from the station's defense budget to raise the dockers' wages so they'll go back to work, justifying it by saying that the smooth operation of the docks is necessary to the station's defense.
Commander Sinclair: Never hand a man a loaded gun unless you know where he's going to aim it.
A few episodes later, in the episode "Eyes", Sinclair tries this again against The Inquisitor Colonel sent to evaluate him and his crew. He does this because Colonel Ben Zayn seems bent on having him run off the station. (He's right; the investigating officer wanted the Commander's chair for himself.) At first it seems to work, but eventually the colonel manages to out-Rule-Fu him, forcing Sinclair to change tack.
A later episode had Captain Sheridan effectively buy time to shut down the pro-Earth (and officially unofficial) Night Watch by careful use of this trope. The orders he'd received gave Night Watch a frankly scary array of powers and authority, but had come from the Political Office, rather than through Earth Alliance military channels. He refused to implement his orders because they were from outside his chain of command (this could only buy time, as Night Watch were one of President Clark's pet projects, and he was in the chain of command. Commander in Chief, to be precise).
An episode of The Phil Silvers Show featured Sgt Bilko's superiors trying to deal with him by pushing him into the Military Police to stop his various cons. Bilko deals with this by arresting everyone he can for the smallest infraction of the rules. On one occasion when one woman mocks his tone of voice for saying he's just following the rules, Bilko has her arrested for impersonating an officer.
Sue Thomas: F.B.Eye: In "The Holocaust Survivor," Obstructive Bureaucrat Randy denies Myles' expense reimbursement for a rental car. The group decides to get back at him by drowning him in expense vouchers for cheap, mundane things that they bought out of pocket, each on a separate form.
Sue: I used three sheets of a yellow pad at home last night for FBI business. That should be three vouchers.
Randy gets back at them by reimbursing the rental car in jars of unsorted coins.
In The West Wing, Donna and Margaret attempt this after Leo brushes off their concerns about the West Wing's compliance with carpal tunnel syndrome regulations (due to all the typing the assistants do) with "Type slower." Donna gets all the aides, including Margaret, to do just that. Unfortunately for them, it's subverted, however, with Leo's stony "I-am-but-seconds-from-firing-you" glare upon finding out about this from Margaret ("Margaret, look at my face right now.") prompts her to immediately capitulate, and Donna is informed that her little scheme wouldn't have worked anyway — the White House is exempt from such regulations.
A major point in F Troop was the Captain using the rule book to determine everything, including "Sunrise, How to determine for shooting people at" and refusing to believe in vampires since "They're not mentioned in the manual."
In one episode of Grange Hill, the students decided to attempt to stage a strike in school. When that failed, they went to the school rule book, which they stole a copy of from one of the teachers. The rule they picked was "Students must always walk in the hallways". So, they started always walking in the hallways - including walking when they should've actually been in class. When that tactic failed, they resorted to a second perambulatory rule, which was "Students must always walk on the left". This gave them an excuse to take the long way around to get from one classroom to the classroom immediately to its right, by walking on the left of the hall all the way around the school. Again the teachers were not happy, and all student-owned copies of the rulebook were confiscated. Apparently only the teachers were supposed to know the exact wording of the rules, the students only got to know when they'd broken one.
In one episode of Bachelor Father, Bentley Gregg's houseboy Peter Tong falls under the sway of his corrupt cousin Charlie, joining and becoming president of the Benevolent Society of Chinese Houseboys. When Peter goes on strike, Bentley decides to capitulate, following the B.S.C.H. labor contract to the letter. He installs a time-clock and a bell to hurry Peter through his duties, running him ragged. Peter gets a bigger paycheck at the end of the week, but after cousin Charlie takes his B.S.C.H. cut he winds up with much less than before. Peter promptly dissolves the B.S.C.H., and gives cousin Charlie an honest job as an "automatic dishwasher."
Captain Sharon Raydor proves adept at this in Major Crimes, having previously worked in internal affairs. Case in point: On one occasion when she had no legal reason to hold a gang member to keep him from avenging his brother, she was able to create one by questioning him past his parole-mandated curfew.
One of Denis Norden's Feghoots on My Word explained how he worked his exit from the army with pedantically exact interpretations of his superior officers' orders, often based on his Drill Sergeant Nasty's pronunciation. For example, on being told to "quick march" (which came out as "Quick Hutch!"), he went AWOL and hid in a cupboard for several weeks, his argument being that "hutch" is a verb meaning "to put away in, or as in, a hutch".
Frequently in Cabin Pressure, Martin will insist that something be done "by the book." The people he tells this usually demonstrate just why he doesn't want them to do so.
In pen-and-paper RPGs, doing this is called being a Rules Lawyer.
Magic: The Gathering has a very large number of stages and checks to be done in each turn. In a lot of games nothing happens during many of them. As a fairly minor minor example of how this could be potentially frustrating:
Player 1: I end my main phase.
Player 2: Okay.
Player 1: The combat phase begins. Beginning of combat step.
Player 2: Oookay.
Player 1: Declare attackers step. Do you have a response?
Player 2: You don't have any creatures...
Player 1: I declare no attackers. Declare blockers step.
Player 2: There is nothing to block.
Player 1: Are you declaring any blockers?
Player 2: No.
Player 1: Combat damage step. No combat damage is dealt. End of Combat Step. Combat Phase Ends. Second Main Phase begins.
Magic actually does have rules that allow you to shortcut this process if both players have nothing to do, so trying this sort of thing in a tournament will get you a penalty for stalling and/or unsportsmanlike conduct for fishing for penalties. It's one key thing judges are taught to spot. In casual play, of course, your opponent will probably just start throwing stuff at you.
And a further shortcut to the scenario presented above: If an attacker declares no attackers during the Declare Attackers step, the game skips straight to the end of combat step.
One famous incident at a French Nationals had a group of players try to use a typo in the most recent printing of the official card texts (Magic has a ton of errata on old cards) to use a devastatingly powerful combo. The head judge used his discretion to overrule the official wording ahead of the tournament and the players were disqualified when they still tried to do it. The DCI fully backed the judge's ruling.
There are many legitimate uses for such techniques. For example, if a source of mana is being destroyed, the opponent might tap it before it is gone, and then declaring a zero-creature attack can flush that mana pool. However, rather than be a jerk about it, it is much politer simply to explain where in the "glossed over" part of the turn you intend to intervene.
Of course, no loyal citizen would ever try this in a game of Paranoia.
In GURPS, one disadvantage (that, incidentally, is part of the Artificial Intelligence meta-trait) is Reprogrammable. An entity with that disadvantage is forced to obey the orders of a specific character. It is explicitly mentioned that, unless the entity also has the disadvantage Slave Mentality, he/she/it must chose anytime upon being an order whether to follow the letter or the intent of the order, thus allowing a sufficiently spiteful entity with that disadvantage to subvert the orders through Exact Words.
Articles written by the SCP Foundation use metric units, in keeping with a scientific viewpoint. From time-to-time, American submitters intentionally write the exact metric equivalent of a measure, without rounding, to make a point. For example, if an object is supposed to be 600 feet, it's damn sure going to be written as 182.88 meters.
This strip explains why Florence isn't necessarily bound to follow every single directive given to her:
Florence: "The surest way to cause your supervisor to fail is to follow his every order without question."
In another strip, Sam gives her a piece of advice regarding orders she can't get out of with the above philosophy, with the added bonus that it's invariably frustrating to authority figures (who he makes a hobby of pissing off):
Sam: Never ask for permission. Always arrange matters so that you automatically have permission unless someone actively takes steps to stop you.
In Tales of the Questor, Unseleighe Princeling Dolan stated that Quentyn had until the rooster crowed at dawn to evade the Wild Hunt. Little did Quentyn know that Dolan had had all the local roosters killed ahead of time. Fortunately, Quentyn's allies went even further in Bothering by the Book: A character nicknamed "Rooster" crowed convincingly without Dolan looking.
Quentyn's entire quest is this: Racconnan law states that if a contract doesn't mention how many successors a contract applies to, then it only applies to one. He's that successor, and he's trying to fulfill a contract to save his town, so if he dies in the attempt, the contract dies with him.
Scott: Sometimes, that is the best form of sabotage.
Truth In Television
Work to Rule is a labor action taken when workers follow rules and regulations to the letter, doing no more work than required and taking no shortcuts. Often, in cases of particularly labyrinthine rules, this can slow the workplace to a crawl or even cause it to grind to a halt, if the rule book doesn't match actual practice or how you can get anything accomplished. Also called a White Strike or Italian Strike—the term in the military is White Mutiny.
A textbook example: French railway employees were forbidden to strike after the railways were nationalized. They scanned the rule book and found that regulations stated the engineer had to check at every overpass for obstructions on the tracks, and if he wasn't sure, to consult with the rest of the train crew. It wasn't usually done, of course, for the simple reason that doing so put the trains ridiculously behind schedule...which is exactly what happened when they started doing it. They couldn't be penalized for enforcing the rules, but it got results. Postal workers in Austria did much the same thing, strictly enforcing a rule that all packages and letters must be weighed to ensure there was enough postage for them, leaving the post offices filled up with unweighed mail by the second day. http://libcom.org/organise/work-to-rule
"Malicious Compliance" is the common management phrase for this, particularly if it isn't just taking advantage or a protest but an attempt to actually subvert or destroy an individual, project, or organization.
There weren't exactly any explicit rules, but since slaves in antebellum America couldn't easily rise up and overthrow their masters (though it was attempted in some notable rebellions), and running away was rather risky, many would instead resist passive-aggressively by working as slowly as they could get away with, and intentionally screwing up so that their masters would think they were stupid and not trust them with difficult tasks.
This is also the origin behind Capoeira. The slaves couldn't spar to train for an eventual overthrow, but could play and dance, which they used to disguise the training. To this day, sparring and practicing in capoeira is called playing.
A heroic example is the story of the "Belgian Ghost Train", in which during the final days of the German occupation of Belgium in World War II, members of the Belgian National Railways managed to prevent a trainload of political prisoners being taken to Germany for extermination by finely judged bureaucratic time-wasting, as well as sabotage and, in some cases, running away and hiding. Read the full story.
The KKK petitioned the state of Missouri to be allowed to "adopt" a stretch of road; getting their name on a sign by that road and doing charity by picking up trash and debris on their stretch. The KKK being obnoxious racists, no one wanted to formally acknowledge them as a civic organization. Yet, the law in the Unites States says they were free to associate, speak, and work in the community no matter how noisome they are. The solution? Assigning the Klansmen to clean up Rosa Parks Highway
Taken to ridiculous extents with this video of Israeli MK Ahmad Tibi. In short (and for non-Hebrew speakers), Tibi is serving as substitute chairman for the meeting, and as one of the MKs. He (as MK) wishes to take the podium in order to present a bill to the Knesset - but then there will be no chairman to substitute him. Therefore, he (as an MK) must request from himself (as chairman) to allow himself to present the bill from his current seat.
An idiomatically translated transcript of the best bit:
MK Ne'eman: Does your honor have a conflict of interest?
MK Tibi: There is a conflict - the possibility of recessing came up, but I said that today was a special day, there's a semifinal, so in spite of it, there's no reason to hurt people's chances of getting home on time. [Looks down at his text] Your honor the chairman, which is me, your honor the Minister, Ladies and Gentlemen the Members of the Knesset, there is no doubt that—
MK Shai: You need to set a limit for your time!
MK Tibi: I'll call myself to order if I carry on.
It should be noted that Tibi is an Arab Israeli and the leader of the Arab Ta'al party; by custom, Arab parties are excluded from the Cabinet and (though it is officially frowned upon) otherwise made to feel unwelcome among many legislators. He found himself at the head of the meeting somewhat unexpectedly, so one can't really fault him for enjoying doing this kind of thing to thumb his nose at the rest of the Knesset.
In addition to his special situation as an Arab MK, his YouTube record would indicate that he makes a habit of this kind of improv comedy on slow days in the Knesset.
Similarly to Ahmad Tibi, but probably apocryphally, future Confederate General Braxton Bragg once was serving as both quartermaster of a small frontier base and commander of one of the companies stationed there. As company commander, he filed a supply requisition that, as quartermaster, he felt duty bound to reject. With neither half of him willing to yield, the issue had to be referred to the incredulous post commandant. According to Ulysses S. Grant's memoirs, that worthy exclaimed:
"My God, Mr. Bragg, you have quarreled with every officer in the army, and now you are quarreling with yourself!"
In personality theory if this behaviour becomes pathological this could be obsessive-compulsive personality disorder or passive aggressive personality disorder. Both disorders are theorized to have the same cause of being enraged at having to bow to authority or somebody who happens to possess the right amount of influence. The obsessive-compulsive just wants it to stop and follows rules with the pent up rage inside so the higher ups will shut up already. Unaware they're distorting the rule givers intentions. The passive aggressive expresses the pent up rage by secretly undermining authority while pretending to be nice and loyal. They're probably a bit more aware of the distortion.
Somewhat of an example is the filibuster used by Congress. The filibuster allows a politician to stall the voting of a piece of legislation by basically speaking for however long they can hold out. It doesn't even have to actually be about the topic at hand. But some politicians have taken it to ridiculous lengths going as far as 75 hours (as a group) and 24 hours (as an individual) to stall legislation unsuccessfully (both instances were related to Civil Rights legislation). One could use cloture to put an end to the filibuster but it's rarely used partly because it's hard to invoke but also because of fear of reciprocation.
Similarly to the literary example in the Oath of the Ankh-Morpork City Watch, the United States Military has its oath worded similarly. Members of the US Military are sworn not to defend the President, the Government, or even the people of the United States, but rather to defend the Constitution. Upon completion of the oath, the new enlistee is reminded that the difference is far more than mere semantics.