Previous Up Next

Appendix C  Constructors

The Constructors bring structure in formulas and interpretations. They allow for the composition of complex syntaxes and semantics in logics. Recursive structures are often introduced by a recursive composition of these functors. They often mimick data structures in programming languages. Many of these structures can be defined as combinators of simpler functors, hence a great saving of means.

C.1  Sum/2

The disjoint union of syntaxes and interpretation domains. This functor corresponds to sum types in programming languages.

C.1.1  Parameters

L1, L2L: 2 logics.

C.1.2  Syntax

AS =def AS1AS2 ⊎ {0}
TELL =def TELL1TELL2
ASK =def ASK1ASK2

C.1.3  Semantics

domain:
I =def I1I2.

satisfaction:
M(f) =def

M1(f) if fAS1
M2(f) if fAS2
if f = 0

C.1.4  Operations

subsumption:
fg =def



f1 g if f, gAS1
f2 g if f, gAS2
f11 if fAS1
f22 if fAS2
f = 0 otherwise


contradiction:
⊥ =def 0.

conjunction:
fg =def

f1 g if f,gAS1
f2 g if f,gAS2
0 otherwise


disjunction:
fg =def

f1 g if f,gAS1
f2 g if f,gAS2
fd g otherwise

C.1.5  Properties

C.2  Prod/2

The product of syntaxes and interpretation domains. Formulas are couples of sub-formulas, and interpretations are couples of sub-interpretations. This functor corresponds to couples in programming languages, and enables the combination of orthogonal properties such as attributes and values to form valued attributes.

C.2.1  Parameters

L1, L2L:
2 logics.

C.2.2  Syntax

AS =def (AS1 × AS2) ⊎ {0}
TELL =def TELL1 × TELL2
ASK =def ASK1 × ASK2

C.2.3  Semantics

domain:
I = I1 × I2.

satisfaction:
(i1,i2) ⊨ f =def f = (f1,f2) i11 f1 i2f2.

C.2.4  Operations

subsumption:
fg =def

f = 0
f = (f1,f2) (f111 f222)
f = (f1,f2) g = (g1,g2) f11 g1 f22 g2.


tautology:
⊤ =def (⊤1,⊤2).

contradiction:
⊥ =def 0.

conjunction:
fg =def

0 if f = 0 g = 0
(f11 g1,f22 g2) if f = (f1,f2) g = (g1,g2)


disjunction:
fg =def



{f} if g = 0
{g} if f = 0
{(f1,f2), (g1,g2)} if f = (f1,f2) g = (g1,g2)
∪ {(f11 g1,h2) ∣ def(f11 g1), h2f22 g2}  
∪ {(h1,f22 g2) ∣ def(f22 g2), h1f11 g1}  

C.2.5  Properties

C.3  Multiset/1

The multisets of sub-formulas and interpretations. These can also be seen as unordered tuples. Multisets can contain several equivalent elements, so that it can be expressed that a multiset contains “at least n elements of some type”. It can also be expressed that 2 properties are satisfied by 2 different elements.

C.3.1  Parameters

EL:
a logic, whose formulas play the role of multiset elements.

C.3.2  Syntax

AS =def NASE
TELL =def NTELLE
ASK =def NASKE
Formulas are multisets, whose elements are formulas of E. A possible concrete syntax is {e1,...,en}. A shorthand for e, ...,e (n times the same element e) is n e; and a shorthand for {n e} is simply n e. In this way the property “contains at least n elements of type e” can be expressed as n e. This can be combined for different numbers and types of elements as in {n1 e1, n2 e2}, whose meaning is “contains n1 different elements of type e1, and n2 other elements of type e2”.

C.3.3  Semantics

domain:
I =def NIE (multisets of IE interpretations).

satisfaction:
iE =def ∃ ρ ∈ Ei: ∀ eE: ρ(e) ⊨E e,
where ↪ denotes an injective function.

C.3.4  Operations

subsumption:
EF =def ∃ ρ ∈ FE: ∀ fF: ρ(f) ⊑E f

tautology:
⊤ =def {}.

C.3.5  Properties

C.4  Pair/1 = λ X.Prod(X,X)

Formulas and interpretations are ordered pairs over some sub-logic.

C.5  Attrval/1 = λ Val.Prod(Atom,Val)

The valued attributes, where values are taken in the sub-logic Val.

C.6  Option/1 = λ X.Sum(Unit,X)

This combinator helps to make a property optional by allowing a Unit-value to be used instead.

C.7  Vector/1 = μ VX.Option(Prod(X,V))

This combinator defines vectors as a generalization of pairs to an arbitrary number of elements (starting from 0). This is close to arrays in programming languages.

C.8  List/1 = μ LX.Top(Option(Prod(X,L)))

Lists are similar to vectors, except that in ASK-formulas only a prefix of a list can be specified.

C.9  Tree/2 = μ TFX.Top(Prod(X,F(T)))

This combinator defines trees in a very generic way. X abstracts the labelling of nodes, and F is a functor that abstracts the way the children of a node are organized.

C.10  NaryTree/1 = λ X.Tree(List,X)

An n-ary tree is a tree in which each node has a list of children (possibly empty).

C.11  BinaryTree/1 = λ X.TreeT.Option(Pair(T)),X)

A binary tree is a tree in which each node may have a pair of children.


Previous Up Next