When a sentence or other clause contains the V-en form of some verb, preceded by an inflectional form of auxiliary have, the clause is said to be PHASE-MODIFIED.  Phase-modification thus defined in terms of form is of course a purely syntactic matter.  It is best thought of as involving a mapping, with clauses as inputs and phase-modified clauses as outputs.

Thus the sentence

Grannie steals to fund her crack habit
maps onto

Grannie has stolen to fund her crack habit.

Here the aboriginal (V-s) form of steal maps to the aboriginal (V-s) form of have + the V-en form of steal.  Notice the regularity: aboriginal maps on to aboriginal.  If instead we take as input a transported clause, like

Grannie stole to fund her crack habit

then the output sentence is

Grannie had stolen to fund her crack habit.

Here the transported (V-ed) form of steal maps onto the transported (V-ed) form of have + the V-en form of steal. Transported maps on to transported.  This selfsame regularity also holds when sentences or other clauses of the secondary pattern are phase-modified.

Grannie will be a handful at the vicar’s ordination

maps onto

Grannie will have been a handful at the vicar’s ordination

The input sentence has an aboriginal secondary auxiliary followed by the base of the verb be.  Phase-modification yields the aboriginal secondary auxiliary followed by the base form of have + the V-en form of the verb be.  Base maps to base.

Now as an instrument of the code, phase must have an invariant informational trigger.  And indeed it does: 

Phase-modification has the invariable semantic effect of locating one temporal point as past with respect to another.

But this effect can play out in what seem like quite different ways, case by case, creating an illusion of heterogeneity.  First we examine the role of phase in primary-pattern sentences.

The primary pattern: the grammatical perfect explained

When an aboriginal clause is phase-modified, the message encoded is always perfective.  The natural interpretation of

[1] Grannie has just decked the Chaplain

– call it m1 – alleges the occurrence of an instance of Chaplain-decking  in a period leading up to the point of speech.  Thus the perfective aspect: the decking takes place at some moment in the past, but the message holds true (or false) of the present moment. And of course it is possible to allege the same about some past point.  Nothing could be simpler.  Just transport sentence [1], producing

[2] Grannie had just decked the Chaplain.

This sentence has an interpretation m2 alleging of some past point p exactly what m1 alleges of the point of speech, namely an instance of Chaplain-decking occurring in a period leading up to p.  Again, perfective aspect: the decking takes place at some point prior to p, but the message is true or false of p

But now, when a clause is both transported and phase-modified, there is often the possibility of ambiguity.  Grammarians from at least Jespersen on have distinguished between what we might call PAST-PAST interpretations of such sentences and PAST PERFECT interpretations.  (‘Past’, of course, means past with repect to the point of speech.  And ‘past-past’ means past with respect to some point independently identified as past with repect to the point of speech).  Thus

[3] Grannie had been drunk

admits of a past-past interpretation, locating an episode of drunkenness at a point p behind some salient past point, and being true or false of p.  The past-past interpretation is clearly forced upon us in the embellished version

Grannie had been drunk a few seconds before the President arrived

Here what is alleged is true or false of p, where p is a point before some salient past point – here, no doubt, the arrival of the President.  Notice: there is no aboriginal analogue:

Grannie has been drunk a few seconds before

is not an English sentence.  But [3] also admits of a past perfect interpretation, alleging of some (now merely) past point p an episode of drunkenness in a period leading up to p.  True or false depending on how things are at p

How is this palpable difference to be accounted for?  Not, we say, by attributing variant meanings to phase-modification.  At the syntactic level you can think of it in terms of order of operations on the aboriginal

Grannie is drunk.

Phase-modification yields

Grannie has been drunk

and transportation of this last yields

Grannie had been drunk.

But now reverse the order of operations.  Transport first, and then phase-modify.  Now the sequence runs

Grannie is drunk —-> Grannie was drunk —-> Grannie had been drunk.

Same result, two different ways of getting there.  At the semantic level this corresponds to a difference in the location of informational choices made in the inquisition phase of the encoding routine. Let me explain.

These simple primary messages have an obvious outermost structure.  A message m will comprise a NOTIONAL SUBJECT s, a tense t, and a PREDICATION CONDITION C.  All three will be IMMEDIATE factors of the message, co-equal.  And in primary messages the time identified by their tenses is the time p of predication (t=p for primary messages). The overarching message will then allege satisfaction of the predication condition C by s at some point p identified by the tense t.  For those who like their formalism, we could diagram the schematic message structure as:

m=m(C, s, t)

So that for instance a message

(be drunk, Grannie, p=0)

would  allege satisfaction, by Grannie, at the point of speech, of the predication condition of being drunk.  Selecting the aboriginal form of be to encode presentness, the encoding routine will output the sentence Grannie is drunk.  And

(be drunk, Grannie, p<0)

would allege the same of some past point p.  Selecting the transported form to represent pastness, the encoding routine would output Grannie was drunk.  And finally

(be drunk, Grannie, p<<0)

would allege the same of some past past point p (i.e. past with respect to some already past point q).  Past-pastness is encoded by transported form + phase-modification, so the encoding routine would output Grannie had been drunk.

Now we are in a position to give a formal explanation of the grammatical perfect. The point is that the encoding routine can resort to phase-modification at two different stages in the inquisition. Either in specifying the detail of C, the predication condition, or in specifying p, the point of predication.  When phase is part of the machinery identifying p,  we have past-past interpretations, as above.  But when phase is used to encode an elaboration of the predication condition, we get perfect uses, either present or past.

Return to our original pair of sentences

Grannie has just decked the Chaplain.
Grannie had just decked the Chaplain.

As noted above, both have interpretations alleging an episode of Chaplain-decking not at some point p, but  in a period leading up to p, where p is either the point of speech (in the first example) or some past point (second example).  p is a mere reference point, and all the action takes place in a preceding interval.  What we have here is a modified predication condition, which we could represent as H{deck the Chaplain}, so that the two messages are now limned as

(H{deck the Chaplain}, Grannie, p=0)
(H{deck the Chaplain}, Grannie, p<0)

And how are the attentions of H to be encoded? Why, via phase-modification, of course, which does exactly what we want.  Remember:

Phase-modification has the invariable semantic effect of locating one temporal point as past with respect to another.

And there you are, and there it is, and there you have it.  The grammatical perfect completely explained.

At least, that is, for Primary messages, where of course the main clause is parsed declaratively.  When we come to clauses of the primary pattern which are not declaratively pasrsed, there will be more to say.  And when we come to Secondary messages, there will be more to say still. 

N.B. Those of you who have been reading their Dudman, especially Towards a Theory of Predication for English will realise that Dudman’s own notation for limning the structure of messages is not the same as mine, and is at least two dimensions more complex.  It needs to be, for he is tackling negation as well, and my simple notation will not extend to do that.  Think of mine as a coinage for the day, intended only to explain how phase-modification operates.