module	::= name sig* fact*

sig		::= "sig" signame sigin? "{" decl* "}"
sigin		::= "in" signame
		::= "extends" signame		non standard
decl		::= mult declexpr
mult		::= "lone"
		::= "set"
declexpr	::= signame (multarrow declexpr)?
multarrow	::= mult "->" mult

fact		::= "{" factexpr* "}"
factexpr	::= rel "in" relexpr
		::= signame "in" sigexpr
rel		::= relname
		::= perm
perm		::= "{" permdecl "|" permexpr "in" relname "}"
permdecl	::= varname ":" signame ("," permdecl)?
permexpr	::= varname ("->" permexpr)?
relexpr	::= proj (multarrow relexpr)?
proj		::= signame
		::= rel
		::= signame "." proj
		::= proj "." signame
sigexpr	::= proj ("+" sigexpr)?			non standard (more than one proj)

Extra type restrictions:
	. no references to non keys
	. sigexpr must subsume the signature domain
	. all the references in sigexpr must be connected and not through the parent signature
	. in facts, signame cannot have loops