AceWiki Grammar

- Tobias Kuhn, 10 December 2010 -

Below, the grammar rules of the AceWiki grammar are shown:

Texts and Sentences

'text' stands for a complete text consisting of an arbitrary number of complete sentences (including zero):

(1) text =>
(2) text => complete_sentence text

A complete sentence is represented by the category 'complete_sentence' and is either a declarative sentence that ends with a full stop or a question ending with a question mark:

(3) complete_sentence ~> // sentence [ . ]
(4) complete_sentence ~> // simple_sentence_2
qu: +
whin:
whout: +
[ ? ]

General sentences are represented by 'sentence':

(5) sentence => sentence_coord_1
(6) sentence ~> // [ for every ] nc
qu:
subj:
sentence_coord_1
(7) sentence ~> // [ if ] sentence_coord_1 [ then ] sentence_coord_1

Sentences can be coordinated using "or" ('sentence_coord_1') and "and" ('sentence_coord_2'):

(8) sentence_coord_1 => sentence_coord_2
(9) sentence_coord_1 ~> // sentence_coord_2 [ or ] sentence_coord_1
(10) sentence_coord_2 => simple_sentence_1
(11) sentence_coord_2 => simple_sentence_1 [ and ] sentence_coord_2

Uncoordinated sentences are represented in two levels by 'simple_sentence_1' and 'simple_sentence_2':

(12) simple_sentence_1 ~> // [ it is false that ] simple_sentence_2
qu:
(13) simple_sentence_1 => [ there is ] np
case: nom
def:
exist: +
pl:
qu:
subj:
(14) simple_sentence_1 => [ there is ] np
case: nom
def:
exist: +
pl:
qu:
subj:
[ such that ] simple_sentence_1
(15) simple_sentence_1 => [ there are ] np
case: nom
def:
exist: +
pl: +
qu:
subj:
(16) simple_sentence_1 => simple_sentence_2
qu:
(17) simple_sentence_2
qu: 1
whin: 2
whout: 3
~> np
case: nom
id: 4
pl: 5
plquant: 6
qu: 1
subj:
whin: 2
whout: 7
vp_coord_1
pl: 5
plquant: 6
qu: 1
subj: 4
whin: 7
whout: 3

Verb Phrases

Like sentences, verb phrases can be coordinated using "or" ('vp_coord_1') and "and" ('vp_coord_2'):

(18) vp_coord_1
pl: 1
plquant: 2
qu: 3
subj: 4
whin: 5
whout: 6
=> vp_coord_2
pl: 1
plquant: 2
qu: 3
subj: 4
whin: 5
whout: 6
(19) vp_coord_1
pl: 1
plquant: 2
qu: 3
subj: 4
whin: 5
whout: 6
~> // vp_coord_2
pl: 1
plquant: 2
qu: 3
subj: 4
whin: 5
whout: 7
[ or ] vp_coord_1
pl: 1
plquant: 2
qu: 3
subj: 4
whin: 7
whout: 6
(20) vp_coord_2
pl: 1
plquant: 2
qu: 3
subj: 4
whin: 5
whout: 6
=> vp
pl: 1
plquant: 2
qu: 3
subj: 4
whin: 5
whout: 6
(21) vp_coord_2
pl: 1
plquant: 2
qu: 3
subj: 4
whin: 5
whout: 6
=> vp
pl: 1
plquant: 2
qu: 3
subj: 4
whin: 5
whout: 7
[ and ] vp_coord_2
pl: 1
plquant: 2
qu: 3
subj: 4
whin: 7
whout: 6

Uncoordinated verb phrases represented by 'vp' can use an auxiliary verb:

(22) vp
exist: 1
pl: 2
plquant: 3
qu: 4
rel: 5
subj: 6
whin: 7
whout: 8
~> aux
be: 9
exist: 1
pl: 2
v
be: 9
exist: 1
pl: 2
plquant: 3
qu: 4
rel: 5
subj: 6
vform: inf
whin: 7
whout: 8
(23) vp
exist: +
pl: 1
qu: 2
rel: 3
subj: 4
whin: 5
whout: 6
~> v
be:
exist: +
pl: 1
qu: 2
rel: 3
subj: 4
vform: fin
whin: 5
whout: 6

The category 'v' represents the main verb or - if "be" is used as a copula verb - the complementing noun phrase or adjective complement:

(24) v
be:
copula:
exist: 1
pl: 2
vform: 3
whin: 4
whout: 4
=> verb
be:
exist: 1
pl: 2
vcat: itr
vform: 3
(25) v
be:
copula:
embv: 1
exist: 2
pl: 3
qu: 4
rel: 5
subj: 6
vform: 7
whin: 8
whout: 9
=> verb
be:
exist: 2
pl: 3
vcat: tr
vform: 7
np
case: acc
embv: 1
qu: 4
rel: 5
subj: 6
vcat: tr
whin: 8
whout: 9
(26) v
be: +
copula:
embv: 1
qu: 2
rel: 3
subj: 4
whin: 5
whout: 6
=> verb
be: +
vcat: tr
np
case: acc
copula:
embv: 1
qu: 2
rel: 3
subj: 4
whin: 5
whout: 6
(27) v
be: +
copula: +
embv: 1
qu: 2
rel: 3
subj: 4
whin: 5
whout: 6
=> np
case: acc
copula: +
embv: 1
of: +
pl:
qu: 2
rel: 3
subj: 4
whin: 5
whout: 6
(28) v
be: +
copula: +
embv: 1
plquant:
qu: 2
rel: 3
subj: 4
whin: 5
whout: 6
=> np
case: acc
copula: +
embv: 1
of:
pl:
qu: 2
rel: 3
subj: 4
whin: 5
whout: 6
(29) v
be: +
copula: +
embv: 1
qu: 2
rel: 3
subj: 4
whin: 5
whout: 6
=> tradj np
case: acc
copula:
embv: 1
qu: 2
rel: 3
subj: 4
whin: 5
whout: 6

Noun Phrases

Noun phrases are represented by 'np' and can consist of proper names, variables, pronouns, and different noun constructs:

(30) np
def: +
embv: 1
exist: +
id: 2
of:
pl:
qu: 3
rel: 4
whin: 5
whout: 6
=> propername
gender: 7
human: 8
text: 2
>>
gender: 7
hasvar:
human: 8
id: 2
type: prop
relcl
embv: 1
human: 8
qu: 3
rel: 4
subj: 2
whin: 5
whout: 6
(31) np
def: +
exist: +
id: 1
of:
pl:
whin: 2
whout: 2
=> #1 newvar
var: 3
>
hasvar: +
id: 1
type: var
var: 3
(32) np
def: +
exist: +
id: 1
of:
pl:
whin: 2
whout: 2
=> defnoun
noun: 3
reference
text: 4
<
gender: 5
hasvar: +
human: 6
id: 1
noun: 3
type: noun
var: 4
>
gender: 5
hasvar:
human: 6
id: 1
type: ref
(33) np
def: +
exist: +
id: 1
of:
pl:
whin: 2
whout: 2
=> defnoun
noun: 3
<
gender: 4
human: 5
id: 1
noun: 3
type: noun
>
gender: 4
hasvar:
human: 5
id: 1
type: ref
(34) np
def: +
exist: +
id: 1
of:
pl:
whin: 2
whout: 2
=> reference
text: 3
<
gender: 4
hasvar: +
human: 5
id: 1
var: 3
>
gender: 4
hasvar:
human: 5
id: 1
type: ref
(35) np
embv: 1
exist: 2
id: 3
of: 4
pl:
qu: 5
rel: 6
subj: 7
whin: 8
whout: 9
=> quant
exist: 2
qu: 5
nc
embv: 1
id: 3
of: 4
qu: 5
rel: 6
subj: 7
whin: 8
whout: 9
(36) np
embv: 1
exist: 2
id: 3
of:
pl:
qu: 4
rel: 5
whin: 6
whout: 7
=> #3 ipron
exist: 2
human: 8
qu: 4
opt_newvar
hasvar: 9
var: 10
>
hasvar: 9
human: 8
id: 3
type: ipron
var: 10
relcl
embv: 1
human: 8
qu: 4
rel: 5
subj: 3
whin: 6
whout: 7
(37) np
copula:
exist: +
id: 1
of:
pl: +
plquant: +
whin: 2
whout: 2
=> num_quant number #1 nounpl
(38) np
copula:
exist: +
id: 1
of:
pl:
whin: 2
whout: 2
=> num_quant [ 1 ] #1 noun
gender: 3
human: 4
text: 5
>
gender: 3
hasvar:
human: 4
id: 1
noun: 5
type: noun
(39) np
exist: +
id: 1
of:
pl:
qu: +
whin:
whout: +
=> #1 [ what ] >
hasvar:
human:
id: 1
type: wh
(40) np
exist: +
id: 1
of:
pl:
qu: +
whin:
whout: +
=> #1 [ who ] >
hasvar:
human: +
id: 1
type: wh
(41) np
embv: 1
exist: +
id: 2
of: 3
pl:
qu: +
rel: 4
subj: 5
whin:
whout: +
=> [ which ] nc
embv: 1
id: 2
of: 3
qu: +
rel: 4
subj: 5
whin: +
whout: +
(42) np
exist: +
id: 1
of:
pl: +
plquant:
qu: +
whin:
whout: +
=> [ which ] #1 nounpl

The category 'nc' represents nouns optionally followed by variables, relative clauses, and of-constructs:

(43) nc
embv: 1
id: 2
of:
qu: 3
rel: 4
whin: 5
whout: 6
=> n
gender: 7
human: 8
id: 2
text: 9
opt_newvar
hasvar: 10
var: 11
>
gender: 7
hasvar: 10
human: 8
id: 2
noun: 9
type: noun
var: 11
relcl
embv: 1
human: 8
qu: 3
rel: 4
subj: 2
whin: 5
whout: 6
(44) nc
embv: 1
of: +
qu: 2
rel: 3
subj: 4
whin: 5
whout: 6
~> nounof np
case: acc
embv: 1
qu: 2
rel: 3
subj: 4
whin: 5
whout: 6

The category 'n' stands for nouns:

(45) n
gender: 1
human: 2
id: 3
text: 4
=> #3 noun
gender: 1
human: 2
text: 4

New variables, optional and mandatory, are represented by 'opt_newvar' and 'newvar', respectively:

(46) opt_newvar
hasvar:
=>
(47) opt_newvar
hasvar: +
var: 1
=> newvar
var: 1
(48) newvar
var: 1
=> variable
text: 1
/<
hasvar: +
var: 1

Relative Clauses

Relative clauses are represented by 'relcl'. They start with a relative pronoun and are always optional:

(49) relcl
whin: 1
whout: 1
=>
(50) relcl
embv: +
human: 1
qu: 2
rel: +
subj: 3
whin: 4
whout: 5
=> relpron
human: 1
relpron: 6
relcl1
human: 1
qu: 2
relpron: 6
subj: 3
whin: 4
whout: 5

Like sentences and verb phrases, relative clauses can be coordinated by "or" ('relcl1') and "and" ('relcl2'):

(51) relcl1
human: 1
qu: 2
relpron: 3
subj: 4
whin: 5
whout: 6
~> // relcl2
human: 1
qu: 2
rel:
relpron: 3
subj: 4
whin: 5
whout: 7
or_relpron
human: 1
relpron: 3
relcl1
human: 1
qu: 2
relpron: 3
subj: 4
whin: 7
whout: 6
(52) relcl1
human: 1
qu: 2
relpron: 3
subj: 4
whin: 5
whout: 6
=> relcl2
human: 1
qu: 2
relpron: 3
subj: 4
whin: 5
whout: 6
(53) relcl2
human: 1
qu: 2
rel: 3
relpron: 4
subj: 5
whin: 6
whout: 7
=> vp
pl:
qu: 2
rel:
subj: 5
whin: 6
whout: 8
and_relpron
human: 1
relpron: 4
relcl2
human: 1
qu: 2
rel: 3
relpron: 4
subj: 5
whin: 8
whout: 7
(54) relcl2
qu: 1
rel: 2
subj: 3
whin: 4
whout: 5
=> vp
pl:
qu: 1
rel: 2
subj: 3
whin: 4
whout: 5
(55) relcl2
qu: 1
subj: 2
whin: 3
whout: 4
~> np
case: nom
copula:
pl: 5
qu: 1
refl:
rel:
subj: 2
whin: 3
whout: 4
aux
be:
exist: 6
pl: 5
verb
be:
exist: 6
pl: 5
vcat: tr
vform: inf
(56) relcl2
qu: 1
subj: 2
whin: 3
whout: 4
~> np
case: nom
copula:
pl: 5
qu: 1
refl:
rel:
subj: 2
whin: 3
whout: 4
verb
be:
exist: +
pl: 5
vcat: tr
vform: fin

Relative pronouns are represented by 'relpron' and can be either "that", "who" or "which":

(57) relpron
relpron: that
=> [ that ]
(58) relpron
human: +
relpron: who
=> [ who ]
(59) relpron
human:
relpron: which
=> [ which ]

The categories 'or_relpron' and 'and_relpron' define shortcuts - like "or that" as one token - for better usability inside of the predictive editor:

(60) or_relpron
human: 1
relpron: 2
=> [ or ] relpron
human: 1
relpron: 2
(61) or_relpron
relpron: that
=> [ or that ]
(62) or_relpron
human: +
relpron: who
=> [ or who ]
(63) or_relpron
human:
relpron: which
=> [ or which ]
(64) and_relpron
human: 1
relpron: 2
=> [ and ] relpron
human: 1
relpron: 2
(65) and_relpron
relpron: that
=> [ and that ]
(66) and_relpron
human: +
relpron: who
=> [ and who ]
(67) and_relpron
human:
relpron: which
=> [ and which ]

Verbs

The category 'verb' represents main verbs:

(68) verb
be:
pl:
vcat: tr
vform: fin
=> verbsg
(69) verb
be:
pl: +
vcat: tr
vform: fin
=> verbinf
(70) verb
be:
vcat: tr
vform: inf
=> verbinf
(71) verb
be: +
vcat: tr
=> pverb

Auxiliary verbs are represented by 'aux', which includes negation markers:

(72) aux
be: +
exist: +
pl:
=> [ is ]
(73) aux
be: +
exist:
pl:
=> // [ is not ]
(74) aux
be: +
exist:
pl:
=> // [ is ] [ not ]
(75) aux
be: +
exist: +
pl: +
=> [ are ]
(76) aux
be: +
exist:
pl: +
=> // [ are not ]
(77) aux
be: +
exist:
pl: +
=> // [ are ] [ not ]
(78) aux
be:
exist:
pl:
=> // [ does not ]
(79) aux
be:
exist:
pl: +
=> // [ do not ]

Quantifiers

Existential and universal quantifiers are represented by 'quant':

(80) quant
exist: +
=> [ a ]
(81) quant
exist: +
=> [ an ]
(82) quant
exist:
qu:
=> // [ every ]
(83) quant
exist:
=> // [ no ]

The category 'num_quant' stands for numerical quantifiers:

(84) num_quant => [ at least ]
(85) num_quant => [ at most ]
(86) num_quant => [ less than ]
(87) num_quant => [ more than ]
(88) num_quant => [ exactly ]

Indefinite Pronouns

Indefinite pronouns are represented by 'ipron':

(89) ipron
exist: +
human:
=> [ something ]
(90) ipron
exist: +
human: +
=> [ somebody ]
(91) ipron
exist:
human:
qu:
=> // [ everything ]
(92) ipron
exist:
human: +
qu:
=> // [ everybody ]
(93) ipron
exist:
human:
=> // [ nothing ]
(94) ipron
exist:
human: +
=> // [ nobody ]