On

the

Feasibility

of

Checking

Temporal

Integrity

Constraints

Jan

Chomickiy

Kansas

State

University

Damian

Niwi?nskiz

Warsaw

University

May

CR

Classification

F.

F.

H.

Abstract

We

analyze

the

computational

feasibility

of

checking

temporal

integrity

constraints

formulated

in

some

sublanguages

of

first-order

temporal

logic

Our

results

illustrate

the

impact

of

the

quantifier

pattern

on

the

complexity

of

this

problem

The

presence

of

a

single

quantifier

in

the

scope

of

a

temporal

operator

makes

the

problem

undecidable

On

the

other

hand

if

no

quantifiers

are

in

the

scope

of

a

temporal

operator

and

all

the

quantifiers

are

universal

temporal

integrity

checking

can

be

done

in

exponential

time

Introduction

As

temporal

databases

become

more

widely

used

in

practice

-LSB-

-RSB-

the

need

arises

to

address

database

integrity

issues

that

are

specific

to

such

databases

In

particular

it

is

necessary

to

generalize

the

standard

notion

of

static

integrity

-LRB-

involving

single

database

states

-RRB-

to

temporal

integrity

-LRB-

involving

sequences

of

database

states

-RRB-

This

work

is

the

first

attempt

to

date

to

analyze

the

computational

feasibility

of

checking

temporal

integrity

constraints

We

consider

various

sublanguages

of

first-order

temporal

logic

-LRB-

FOTL

-RRB-

The

starting

point

is

the

class

of

biquantified

formulas

proposed

by

Lipeck

Saake

and

their

students

-LSB-

-RSB-

Biquantified

formulas

allow

only

future

tense

To

appear

in

Journal

of

Computer

and

System

Sciences

A

preliminary

version

of

this

paper

was

presented

at

the

ACM

SIGACT-SIGMOD-SIGART

Symposium

on

Principles

of

Database

Systems

May

Washington

D.C.

Supported

by

NSF

grant

KSU

Faculty

Development

Award

and

Polish

KBN

grants

and

yAddress

Computing

and

Information

Sciences

Nichols

Hall

Kansas

State

University

Manhattan

KS

E-mail

chomicki@cis.ksu.edu

zWork

performed

mainly

while

visiting

Kansas

State

University

Address

Institute

of

Informatics

Warsaw

University

Banacha

Warsaw

Poland

E-mail

niwinski@mimuw.edu.pl

temporal

operators

and

restricted

quantification

in

the

following

sense

the

quantifiers

can

be

either

external

-LRB-

not

in

the

scope

of

any

temporal

operators

-RRB-

or

internal

-LRB-

no

temporal

operator

in

their

scope

-RRB-

Moreover

all

external

quantifiers

are

universal

Biquantified

formulas

arise

as

the

result

of

composing

propositional

temporal

logic

with

first-order

predicate

logic

-LSB-

-RSB-

i.e.

taking

a

version

of

propositional

temporal

logic

in

which

propositional

atoms

are

replaced

by

first-order

predicate

formulas

The

main

complexity

results

are

as

follows

ffl

for

biquantified

formulas

with

a

single

internal

quantifier

-LRB-

existential

or

universal

-RRB-

temporal

integrity

checking

is

undecidable

-LRB-

-RRB-

ffl

for

biquantified

formulas

with

no

internal

quantifiers

-LRB-

called

universal

-RRB-

temporal

integrity

checking

is

decidable

-LRB-

in

exponential

time

-RRB-

Although

the

time

in

our

framework

is

infinite

integrity

constraints

impose

restrictions

on

finite

sequences

of

database

states

Consequently

temporal

integrity

violations

should

be

detectable

using

finite

databases

This

intuition

is

formalized

by

the

requirement

that

integrity

constraints

define

safety

properties

-LSB-

-RSB-

We

are

going

to

adopt

this

point

of

view

thus

we

consider

only

formulas

that

define

safety

properties

As

a

side

result

we

obtain

a

biquantified

formula

-LRB-

defining

a

safety

property

-RRB-

which

is

not

equivalent

to

any

formula

where

is

a

past

formula

It

is

well

known

-LSB-

-RSB-

that

every

propositional

temporal

logic

formula

defining

a

safety

property

is

equivalent

to

a

formula

in

the

latter

form

Thus

our

result

highlights

the

difference

between

propositional

and

first-order

temporal

logic

Our

results

are

applicable

both

to

temporal

integrity

checking

and

to

temporal

triggers

because

we

show

that

trigger

firing

is

a

notion

dual

to

constraint

satisfaction

The

plan

of

the

paper

is

as

follows

In

section

we

introduce

the

basic

concepts

of

FOTL

discuss

our

framework

of

temporal

integrity

checking

and

define

the

class

of

biquantified

formulas

and

its

subclasses

In

section

we

show

that

for

biquantified

formulas

with

a

single

internal

quantifier

temporal

integrity

checking

is

undecidable

In

section

we

show

that

for

universal

biquantified

formulas

-LRB-

no

internal

quantifiers

-RRB-

temporal

integrity

checking

is

decidable

in

exponential

time

In

section

we

briefly

discuss

related

work

In

section

we

conclude

and

outline

directions

for

future

research

Basic

Notions

In

this

section

we

introduce

the

basic

concepts

of

FOTL

discuss

our

framework

of

temporal

integrity

checking

and

define

the

class

of

biquantified

formulas

and

its

subclasses

A

comprehensive

recent

reference

for

temporal

logic

is

-LSB-

-RSB-

Syntax

The

expressions

of

FOTL

are

built

from

the

following

sets

of

symbols

a

finite

set

of

predicate

symbols

a

finite

set

of

constant

symbols

a

countably

infinite

set

of

variables

the

equality

connective

the

logical

connectives

-RRB-

quantifiers

future

tense

temporal

connectives

and

until

and

past

tense

temporal

connectives

and

since

Each

predicate

symbol

is

given

with

an

arity

r

We

refer

to

the

sets

of

predicate

and

constant

symbols

as

the

vocabulary

of

the

language

This

part

is

not

fixed

we

will

consider

languages

over

different

vocabularies

A

term

is

a

constant

or

a

variable

An

atomic

formula

is

of

the

form

or

p

-LRB-

tr

-RRB-

where

the

ti

's

are

terms

and

p

is

a

predicate

symbol

of

arity

r

Other

formulas

are

defined

by

the

following

rules

if

A

B

are

formulas

and

x

is

a

variable

the

following

are

also

formulas

A

B

A

A

-RRB-

B

A

-LRB-

read

as

next

time

A

-RRB-

A

until

B

A

-LRB-

previous

time

A

-RRB-

and

A

since

B

The

formulas

that

do

not

use

temporal

connectives

at

all

are

referred

to

as

pure

first-order

formulas

The

formulas

that

use

past

tense

temporal

connectives

but

not

future

tense

ones

are

called

past

temporal

formulas

The

formulas

that

use

future

tense

connectives

but

not

past

tense

ones

are

called

future

temporal

formulas

Semantics

A

first-order

structure

M

over

a

given

vocabulary

consists

of

a

universe

jM

j

an

interpretation

cM

jM

j

for

each

constant

symbol

c

and

an

interpretation

pM

jM

jr

for

each

predicate

symbol

p

of

arity

r

We

say

that

a

predicate

p

of

M

is

true

about

a

tuple

-LRB-

mr

-RRB-

of

elements

of

jM

j

if

-LRB-

mr

-RRB-

pM

In

order

to

interpret

temporal

formulas

we

assume

that

time

is

isomorphic

to

the

natural

numbers

i.e.

time

instants

form

an

infinite

sequence

t

An

infinite-time

temporal

database

-LRB-

usually

called

shorter

temporal

database

or

just

database

-RRB-

is

a

sequence

D

-LRB-

:-RRB-

of

first-order

structures

over

the

same

vocabulary

and

with

the

same

universe

which

we

will

call

the

universe

of

the

database

and

denote

jDj

-LRB-

so

jDj

:-RRB-

We

refer

to

the

structure

Dt

as

the

database

state

at

time

instant

t

We

assume

that

a

constant

symbol

c

has

the

same

interpretation

in

each

database

state

-LRB-

i.e.

cDt

for

each

t

-RRB-

which

we

shall

denote

simply

by

cD

The

interpretation

of

a

predicate

symbol

may

vary

from

one

time

instant

to

another

We

make

the

following

assumptions

about

database

states

the

universe

is

infinite

and

countable

and

the

interpretation

of

any

predicate

symbol

is

a

finite

relation

These

are

rather

standard

assumptions

in

database

theory

Notice

that

the

equality

is

not

considered

as

one

of

database

predicates

-LRB-

actually

it

is

an

infinite

relation

-RRB-

For

notational

convenience

only

we

shall

also

assume

that

unless

otherwise

stated

the

universe

of

each

database

state

equals

to

the

set

of

natural

numbers

N

Let

D

-LRB-

:-RRB-

be

a

temporal

database

A

valuation

is

a

mapping

v

that

associates

a

value

v

-LRB-

x

-RRB-

N

with

each

variable

x.

Notice

that

the

value

of

a

variable

does

not

change

with

time

-LRB-

in

other

words

all

variables

we

consider

are

global

or

rigid

-RRB-

It

is

convenient

to

extend

the

valuation

to

terms

by

setting

v

-LRB-

c

-RRB-

cD

for

a

constant

symbol

c

Now

we

define

the

truth

value

of

a

formula

at

a

time

instant

t

under

a

valuation

v

by

means

of

the

satisfaction

relation

is

satisfied

by

D

at

the

time

instant

t

under

the

valuation

v

in

symbols

D

v

t

j

defined

inductively

as

follows

ffl

D

v

t

j

whenever

v

-LRB-

-RRB-

v

-LRB-

-RRB-

ffl

D

v

t

j

p

-LRB-

tr

-RRB-

whenever

the

predicate

p

of

Dt

is

true

about

-LRB-

v

-LRB-

-RRB-

v

-LRB-

tr

-RRB-

-RRB-

ffl

D

v

t

j

A

iff

not

D

v

t

j

A

ffl

D

v

t

j

A

B

iff

D

v

t

j

A

or

D

v

t

j

B

similarly

for

other

logical

connectives

ffl

D

v

t

j

iff

there

exists

i

N

such

that

D

v

-LSB-

x

i

-RSB-

t

j

A

where

v

-LSB-

x

i

-RSB-

is

a

valuation

that

maps

x

to

i

and

otherwise

coincides

with

v

ffl

D

v

t

j

iff

for

all

i

N

D

v

-LSB-

x

i

-RSB-

t

j

A

ffl

D

v

t

j

A

iff

D

v

t

j

A

ffl

D

v

t

j

A

until

B

iff

for

some

s

t

D

v

s

j

B

and

for

all

u

t

u

s

D

v

u

j

A

ffl

D

v

t

j

A

iff

t

and

D

v

t

j

A

ffl

D

v

t

j

A

since

B

iff

for

some

s

s

t

D

v

s

j

B

and

for

all

u

s

u

t

D

v

u

j

A

A

formula

with

no

occurrences

of

free

variables

is

said

to

be

closed

or

a

sentence

Clearly

the

truth

value

of

a

closed

formula

does

not

depend

on

the

valuation

so

if

A

is

a

sentence

we

simply

write

D

t

j

A

We

also

write

D

v

j

A

or

D

j

A

to

mean

D

v

j

A

or

D

j

A

respectively

In

this

last

case

we

say

that

D

is

a

model

of

A

Other

well

known

temporal

connectives

-LRB-

sometime

in

the

future

-RRB-

-LRB-

always

in

the

future

-RRB-

-LRB-

sometime

in

the

past

-RRB-

and

-LRB-

always

in

the

past

-RRB-

can

be

defined

using

until

or

since

A

True

until

A

A

A

A

True

since

A

A

A

For

a

past

formula

A

the

truth

of

A

at

instant

t

is

determined

only

by

the

database

states

Dt

Therefore

we

shall

also

consider

finite-time

temporal

databases

of

the

form

D

-LRB-

Dt

-RRB-

with

the

satisfaction

of

past

formulas

defined

and

denoted

similarly

as

in

the

infinite

case

If

D

-LRB-

:-RRB-

is

an

infinite-time

database

then

any

finite-time

database

-LRB-

Dt

-RRB-

is

called

a

prefix

of

D

In

this

case

D

is

an

extension

of

-LRB-

Dt

-RRB-

Examples

Consider

a

temporal

database

-LRB-

-RRB-

whose

every

state

Dt

t

contains

information

about

customer

orders

submitted

or

filled

at

instant

t.

For

example

Sub

-LRB-

a

-RRB-

is

satisfied

at

instant

t

if

a

is

an

order

submitted

at

t

The

constraint

an

order

can

be

submitted

only

once

-LRB-

implementing

a

kind

of

object

identity

-RRB-

can

be

specified

as

-LRB-

Sub

-LRB-

x

-RRB-

-RRB-

Sub

-LRB-

x

-RRB-

-RRB-

The

constraint

orders

should

be

filled

in

the

order

that

they

are

submitted

-LRB-

in

fact

enforcing

a

queue-like

discipline

-RRB-

can

be

written

as

-LRB-

x

y

Sub

-LRB-

x

-RRB-

-LRB-

-LRB-

Fill

-LRB-

x

-RRB-

-RRB-

until

-LRB-

Sub

-LRB-

y

-RRB-

-LRB-

-LRB-

Fill

-LRB-

x

-RRB-

-RRB-

until

-LRB-

Fill

-LRB-

y

-RRB-

Fill

-LRB-

x

-RRB-

-RRB-

-RRB-

-RRB-

-RRB-

-RRB-

Intuitively

the

above

formula

says

that

there

can

not

be

two

different

orders

x

and

y

such

that

x

is

submitted

before

y

and

x

is

not

filled

before

y

is

filled

Extended

vocabulary

It

is

sometimes

convenient

to

extend

the

above

language

by

symbols

that

refer

explicitly

to

the

ordering

of

natural

numbers

the

binary

relation

symbols

and

succ

and

the

monadic

relation

symbol

Zero

These

symbols

are

assumed

to

be

interpreted

in

the

same

way

in

any

database

state

D

namely

<=D

is

the

standard

ordering

relation

on

N

succD

is

the

standard

successor

relation

-LRB-

i.e.

succD

-LRB-

a

b

-RRB-

is

true

iff

b

a

-RRB-

and

Zero

-LRB-

a

-RRB-

is

true

iff

a

Notice

that

like

the

equality

and

succ

differ

from

other

predicate

symbols

in

that

they

define

infinite

relations

Classification

of

formulas

Let

us

recall

in

this

context

the

standard

classification

of

first-order

formulas

in

prefix

normal

form

-LSB-

-RSB-

It

is

well

known

that

every

first-order

formula

can

be

transformed

to

this

form

We

start

with

the

class

of

formulas

-LRB-

or

equivalently

formulas

-RRB-

consisting

of

first-order

formulas

that

do

not

contain

quantifiers

or

temporal

connectives

Note

that

formulas

are

just

boolean

combinations

of

atomic

formulas

of

the

form

or

p

-LRB-

tr

-RRB-

where

the

ti

's

are

terms

and

p

is

a

predicate

symbol

of

arity

r

The

classes

of

n

and

n

formulas

are

defined

inductively

as

follows

If

A

is

a

n

formula

then

any

formula

of

the

form

is

n

formula

If

A

is

a

n

formula

then

any

formula

of

the

form

is

n

formula

Denote

by

the

union

of

all

n

for

n

For

a

class

C

of

formulas

let

tense

-LRB-

C

-RRB-

be

the

class

of

temporal

formulas

obtained

from

C

using

future

temporal

and

propositional

connectives

but

no

quantifiers

-LRB-

i.e.

using

the

rules

of

the

definition

of

formulas

-RRB-

If

Q

let

QC

be

the

class

of

all

formulas

of

the

form

QxA

where

A

C

and

let

Q?C

be

the

union

of

all

classes

QQ

QC

If

we

take

a

class

of

formulas

of

the

form

Q?tense

-LRB-

C

-RRB-

the

quantifiers

in

Q

are

called

external

and

the

quantifiers

in

C

internal

We

will

be

mainly

concerned

with

the

following

classes

of

formulas

ffl

biquantified

formulas

in

symbols

tense

-LRB-

-RRB-

ffl

universal

formulas

in

symbols

tense

-LRB-

-RRB-

ffl

biquantified

formulas

with

a

single

internal

quantifier

in

symbols

tense

-LRB-

-RRB-

Note

that

the

formulas

are

equivalent

to

the

negations

of

the

formulas

Then

since

tense

-LRB-

C

-RRB-

is

closed

under

negation

the

tense

-LRB-

-RRB-

formulas

are

equivalent

to

tense

-LRB-

-RRB-

formulas

Both

the

examples

given

earlier

in

this

section

are

universal

-LRB-

i.e.

tense

-LRB-

-RRB-

-RRB-

formulas

Temporal

integrity

checking

and

triggers

Temporal

integrity

constraints

are

imposed

on

the

current

history

of

a

database

i.e.

the

sequence

of

states

up

to

the

current

one

Such

a

history

is

of

course

a

finite-time

temporal

database

However

the

semantics

of

a

temporal

integrity

constraint

is

defined

with

respect

to

an

infinite

structure

representing

a

possible

future

evolution

of

the

database

The

notion

of

potential

constraint

satisfaction

-LRB-

called

potential

validity

in

-LSB-

-RSB-

-RRB-

reconciles

those

two

views

For

a

closed

FOTL

formula

C

the

set

Pref

-LRB-

C

-RRB-

is

defined

as

follows

Pref

-LRB-

C

-RRB-

if

there

is

a

model

D

-LRB-

:-RRB-

of

C

such

that

-LRB-

Dt

-RRB-

A

constraint

C

is

potentially

satisfied

at

instant

t

if

the

current

history

-LRB-

Dt

-RRB-

Pref

-LRB-

C

-RRB-

In

other

words

a

constraint

is

potentially

satisfied

after

an

update

if

the

history

ending

in

the

state

resulting

from

the

update

has

an

-LRB-

infinite

-RRB-

extension

to

a

model

of

the

constraint

In

the

database

context

considering

infinite

sequences

of

states

means

that

the

database

is

infinitely

updatable

This

seems

like

a

desirable

characteristic

even

though

in

most

applications

databases

have

only

a

finite

lifetime

Similarly

in

concurrent

programming

one

often

studies

infinite

behaviors

although

every

practical

program

runs

only

for

a

finite

time

In

both

cases

infinity

provides

a

convenient

mathematical

abstraction

Moreover

the

paper

-LSB-

-RSB-

that

originated

the

study

of

temporal

integrity

constraints

considered

constraints

over

infinite

sequences

As

we

study

classes

of

constraints

proposed

in

that

very

paper

we

want

to

stay

as

close

to

the

original

motivation

as

possible

In

the

future

it

may

prove

wortwhile

to

study

integrity

checking

over

finite

histories

as

well

as

different

notions

of

constraint

satisfaction

A

Condition-Action

trigger

-LSB-

-RSB-

if

C

then

A

fires

at

instant

t

for

a

-LRB-

ground

-RRB-

substitution

to

the

free

variables

of

C

if

C

-LRB-

the

result

of

applying

the

substitution

to

C

-RRB-

is

not

potentially

satisfied

at

t

The

action

executed

is

A

Intuitively

a

trigger

fires

after

an

update

if

no

extension

of

the

history

ending

in

the

state

resulting

from

the

update

can

make

the

trigger

condition

false

So

we

can

see

that

the

notion

of

trigger

firing

is

dual

to

potential

constraint

satisfaction

That

corresponds

to

the

intuition

that

integrity

checking

triggers

should

fire

when

the

integrity

is

violated

Safety

properties

Any

set

of

temporal

databases

over

a

fixed

vocabulary

can

be

considered

a

property

We

say

that

a

property

P

is

defined

by

a

-LRB-

closed

-RRB-

formula

A

if

it

consists

of

all

models

of

that

sentence

i.e.

P

fD

D

j

Ag

A

property

P

is

called

a

safety

property

-LSB-

-RSB-

if

it

satisfies

the

following

condition

Let

D

-LRB-

:-RRB-

be

a

temporal

database

If

any

prefix

-LRB-

Dt

-RRB-

of

D

can

be

extended

to

some

in

P

then

D

itself

belongs

to

P

A

formula

defining

a

safety

property

is

called

a

safety

formula

We

note

the

following

Proposition

Any

property

defined

by

a

formula

of

the

form

A

where

A

is

a

past

formula

is

a

safety

property

A

property

P

is

a

liveness

property

-LSB-

-RSB-

if

it

satisfies

the

following

condition

Any

finite-time

temporal

database

D

-LRB-

Dt

-RRB-

can

be

extended

to

an

element

of

P

A

formula

defining

a

liveness

property

is

called

a

liveness

formula

It

should

be

clear

that

a

liveness

formula

is

useless

for

integrity

checking

because

it

does

not

produce

any

integrity

violations

-LRB-

it

is

always

potentially

satisfied

-RRB-

For

an

example

consider

the

formula

p

-LRB-

x

-RRB-

-LSB-

-RSB-

shows

that

every

property

is

an

intersection

of

a

safety

property

and

a

liveness

property

Only

the

safety

property

-LRB-

defined

by

a

temporal

formula

-RRB-

is

useful

for

temporal

integrity

Intuitively

this

can

be

explained

as

follows

Integrity

checking

is

always

done

using

a

finite

history

Therefore

if

an

infinite

sequence

of

states

violates

a

constraint

the

integrity

checking

mechanism

should

be

able

to

discover

that

after

looking

at

some

finite

prefix

of

this

sequence

The

behavior

at

infinity

is

not

known

at

the

time

of

checking

the

constraint

because

future

updates

may

be

arbitrary

This

should

be

contrasted

with

the

situation

in

the

area

of

concurrent

programming

-LSB-

-RSB-

where

formulas

that

are

not

safety

formulas

are

very

useful

Such

formulas

usually

describe

properties

of

a

given

concurrent

program

whose

behavior

at

infinity

is

known

Following

this

line

of

thought

liveness

formulas

may

be

useful

as

integrity

constraints

if

the

database

changes

in

a

controlled

manner

for

example

when

all

the

updates

are

performed

by

predefined

procedures

Then

a

priori

integrity

verification

may

become

possible

-LSB-

-RSB-

The

restriction

to

safety

formulas

is

essential

for

the

technical

results

presented

in

this

paper

particularly

for

the

positive

results

in

section

which

do

not

hold

for

non-safety

formulas

Propositional

temporal

logic

We

shall

also

consider

a

propositional

version

of

the

logic

presented

above

The

vocabulary

of

the

propositional

temporal

logic

of

linear

time

-LRB-

propositional

TL

-RRB-

consists

of

a

set

of

propositional

letters

that

are

used

as

atomic

formulas

of

the

logic

Other

formulas

are

formed

from

atomic

formulas

using

the

Boolean

operators

and

temporal

connectives

The

semantics

is

given

in

terms

of

infinite

sequences

of

propositional

states

where

a

state

is

a

mapping

from

the

set

of

propositional

letters

to

the

set

ftrue

falseg

The

interpretation

of

the

temporal

connectives

is

similar

as

in

the

first

order

case

presented

above

-LSB-

-RSB-

Propositional

temporal

logic

has

attracted

much

attention

as

a

formalism

for

reasoning

about

concurrent

programs

since

the

basic

properties

of

this

logic

-LRB-

satisfiability

validity

equivalence

of

formulas

-RRB-

are

elementarily

decidable

-LRB-

see

-LSB-

-RSB-

for

a

survey

-RRB-

We

shall

see

in

section

that

in

some

special

cases

decision

problems

for

FOTL

can

be

reduced

to

the

propositional

case

Internal

quantification

In

this

section

we

study

the

complexity

of

the

extension

problem

i.e.

of

Pref

-LRB-

ff

-RRB-

for

a

biquantified

formula

ff

with

a

single

internal

quantifier

-LRB-

a

tense

-LRB-

-RRB-

formula

-RRB-

It

is

easy

to

see

that

it

does

not

matter

whether

this

quantifier

is

universal

or

existential

because

a

universal

quantifier

can

be

replaced

by

an

existential

one

and

vice

versa

For

example

We

assume

that

the

internal

quantifier

is

existential

We

show

that

there

is

a

-LRB-

-RRB-

formula

for

which

the

extension

problem

is

We

also

show

that

is

a

formula

that

defines

a

safety

property

but

can

not

be

transformed

to

the

form

A

where

A

is

a

past

formula

The

vocabulary

of

consists

of

monadic

predicate

symbols

only

As

the

first

step

we

construct

another

formula

that

is

universal

but

over

the

extended

vocabulary

-LRB-

c.f.

section

-RRB-

The

argument

uses

an

encoding

of

the

computations

of

a

deterministic

Turing

machine

for

which

some

temporal

property

is

shown

Repeating

computations

We

now

describe

a

problem

about

Turing

machines

and

prove

its

We

consider

deterministic

Turing

machines

with

a

single

tape

infinite

to

the

right

over

an

alphabet

including

B

as

a

blank

symbol

and

ae

as

an

input

alphabet

We

say

that

a

word

w

induces

a

repeating

behaviour

of

a

machine

M

if

the

computation

of

M

starting

with

w

as

an

input

is

infinite

and

also

the

machine

's

head

visits

the

leftmost

cell

of

the

tape

infinitely

often

Lemma

There

exists

a

Turing

machine

M

such

that

the

set

of

words

w

which

induce

a

repeating

behaviour

of

M

is

Proof

Let

us

fix

a

language

A

By

a

well

-LCB-

known

characterization

of

the

sets

-LRB-

c.f.

Rogers

-LSB-

-RSB-

Chapter

-RRB-

there

exists

a

recursive

relation

R

-LRB-

x

y

z

-RRB-

such

that

x

A

-LRB-

-RRB-

R

-LRB-

x

y

z

-RRB-

Clearly

we

can

have

a

Turing

machine

say

over

an

alphabet

g

which

halts

for

every

input

and

accepts

a

word

w

v

u

iff

w

v

and

u

are

words

in

satisfying

the

relation

R

We

shall

construct

a

machine

M

with

the

input

alphabet

such

that

a

word

w

will

induce

a

repeating

behaviour

of

M

iff

w

A.

Given

an

input

w

the

machine

first

shifts

it

one

cell

to

the

right

and

marks

the

second

cell

of

the

tape

in

some

special

way

this

is

in

order

to

prevent

visiting

the

origin

of

the

tape

except

in

the

situations

to

be

described

below

Now

M

enters

into

an

infinite

loop

in

which

it

will

examine

all

the

words

v

in

some

fixed

linear

order

For

each

such

v

the

machine

M

starts

another

loop

in

which

it

enumerates

all

the

pairs

-LRB-

u

m

-RRB-

where

u

and

m

is

-LRB-

an

encoding

-RRB-

of

a

natural

number

For

each

such

-LRB-

u

m

-RRB-

M

simulates

m

steps

of

the

computation

of

the

machine

on

the

input

w

v

u

-LRB-

remember

that

w

is

the

original

input

of

the

machine

M

-RRB-

If

it

happens

that

the

simulated

machine

stops

and

accepts

within

m

steps

then

the

machine

M

exits

from

the

loop

enumerating

the

pairs

-LRB-

u

m

-RRB-

for

this

given

v

and

goes

to

the

origin

of

its

own

tape

Next

it

passes

to

an

examination

of

the

succesor

of

v.

Note

that

if

for

some

v

no

attempt

of

simulating

is

successful

then

M

will

loop

forever

for

that

v

and

will

not

visit

the

origin

of

the

tape

any

more

neither

will

it

examine

any

succesor

of

v

This

may

happen

however

only

if

there

is

no

u

such

that

R

-LRB-

w

v

u

-RRB-

holds

Then

it

is

easy

to

see

that

an

input

w

induces

a

repeating

behaviour

of

M

iff

for

all

v

there

is

some

u

such

that

the

relation

R

-LRB-

w

v

u

-RRB-

holds

that

is

iff

w

A.

Remark

For

some

nondeterministic

Turing

machines

the

problem

of

deciding

whether

a

word

induces

a

repeating

behaviour

is

not

arithmetical

This

fact

has

been

used

in

the

proof

that

the

satisfiability

problem

for

first

-LCB-

order

temporal

logic

is

-LSB-

-RSB-

Formula

We

are

now

going

to

show

that

the

repeating

behaviour

of

a

Turing

machine

can

be

expressed

in

the

framework

of

first-order

temporal

logic

over

a

vocabulary

extended

by

the

symbols

succ

and

Zero

Let

us

fix

a

Turing

machine

M

satisfying

the

property

of

the

preceding

lemma

Recall

that

the

alphabet

of

the

tape

symbols

used

by

M

includes

the

input

alphabet

and

the

special

blank

symbol

B

Let

Q

be

the

set

of

states

of

M

including

the

initial

state

We

encode

configurations

of

M

-LRB-

i.e.

sequences

of

the

form

ffq

B

where

ff

and

q

Q

-RRB-

by

database

states

in

the

following

way

the

vocabulary

will

include

a

monadic

symbol

Pq

for

each

state

q

Q

and

a

monadic

predicate

symbol

Poe

for

each

oe

except

for

B

The

intuitive

meaning

of

a

formula

Poe

-LRB-

x

-RRB-

-LRB-

resp

Pq

-LRB-

x

-RRB-

-RRB-

is

the

xth

symbol

of

the

actual

configuration

is

oe

-LRB-

resp

q

-RRB-

It

will

be

further

convenient

to

use

the

notation

PB

-LRB-

x

-RRB-

as

an

abbreviation

for

V

-LSB-

fBg

Pz

-LRB-

x

-RRB-

The

intuitive

meaning

of

this

is

the

xth

symbol

of

the

actual

configuration

is

the

blank

symbol

The

formula

which

forces

a

temporal

database

to

encode

a

repeating

computation

of

M

will

express

the

following

database

properties

First

for

any

element

x

of

the

universe

in

any

database

state

-LRB-

i.e.

always

in

the

temporal

sense

-RRB-

at

most

one

of

the

monadic

predicates

Pz

where

z

Q

-LSB-

fBg

is

true

about

x.

Second

the

initial

database

state

encodes

some

initial

configuration

of

M

Third

subsequent

database

states

encode

subsequent

configurations

Finally

there

are

infinitely

many

database

states

which

encode

configurations

with

the

machine

's

head

scanning

the

leftmost

tape

cell

We

sketch

the

construction

here

It

is

given

in

detail

in

the

Appendix

Each

of

the

above

conditions

can

be

expressed

by

a

temporal

formula

of

the

form

where

is

quantifier-free

For

example

the

last

statement

-LRB-

concerning

the

repeating

behaviour

of

the

machine

-RRB-

can

be

formalized

as

Zero

-LRB-

x

-RRB-

-RRB-

Pq

-LRB-

x

-RRB-

Indeed

this

formula

forces

that

for

the

least

element

of

the

database

universe

infinitely

often

some

predicate

Pq

is

true

This

corresponds

to

the

fact

that

in

the

encoded

computation

the

first

symbol

of

a

configuration

is

infinitely

often

a

state

i.e.

the

machine

's

head

visits

the

origin

of

the

tape

infinitely

often

Moreover

for

all

these

formulas

k

Then

using

the

standard

transformations

of

predicate

calculus

we

can

write

the

entire

formula

in

the

form

where

is

quantifier-free

We

can

summarize

the

above

considerations

in

the

following

Proposition

There

is

a

temporal

formula

over

the

vocabulary

described

above

and

of

the

form

where

is

quantifier-free

such

that

any

temporal

database

over

this

vocabulary

satisfies

if

and

only

if

it

is

an

encoding

of

a

repeating

computation

of

the

machine

M

Proposition

The

property

defined

by

a

formula

of

Proposition

is

a

safety

property

Proof

Since

the

machine

M

is

deterministic

any

finite

sequence

of

database

states

of

length

has

at

most

one

extension

to

a

temporal

database

Thus

the

safety

condition

holds

obviously

But

the

main

feature

of

the

above-defined

formula

is

the

following

Theorem

The

problem

of

deciding

whether

a

given

finite-time

temporal

database

over

the

vocabulary

considered

above

can

be

extended

to

a

-LRB-

infinite-time

-RRB-

temporal

model

of

is

Proof

We

show

a

Turing

reduction

of

the

problem

discussed

in

Lemma

Let

w

Consider

a

database

state

which

encodes

the

initial

configuration

of

the

machine

M

with

the

input

w

Now

the

one

element

sequence

consisting

of

this

database

state

can

be

extended

to

a

temporal

model

of

iff

w

induces

a

repeating

behaviour

of

M

Thus

the

problem

is

In

order

to

see

that

the

problem

is

actually

in

the

class

we

can

give

it

an

alternative

formulation

as

follows

Given

a

finite

sequence

of

database

states

determine

if

for

each

n

there

is

a

finite

prolongation

of

this

sequence

which

encodes

an

initial

segment

of

some

computation

of

M

in

which

the

machine

's

head

visits

the

leftmost

cell

of

the

tape

at

least

n

times

Since

finite

sequences

of

database

states

can

be

encoded

by

integers

and

it

is

clearly

decidable

if

a

finite

sequence

of

database

states

encodes

some

initial

segment

of

a

computation

of

M

then

the

latter

problem

is

clearly

in

In

order

to

see

that

it

is

equivalent

to

the

original

one

observe

that

a

finite

sequence

of

database

states

has

at

most

one

prolongation

of

a

given

length

to

a

sequence

which

actually

encodes

an

initial

segment

of

some

computation

of

M

Corollary

The

formula

is

not

equivalent

to

any

formula

of

the

form

with

being

a

past

formula

Proof

Suppose

to

the

contrary

that

is

equivalent

to

The

set

of

finite

sequences

of

database

states

that

satisfy

can

not

coincide

with

the

set

of

prefixes

of

temporal

models

of

since

the

former

set

is

clearly

decidable

while

the

latter

was

shown

to

be

This

however

is

not

yet

a

contradiction

since

the

mere

satisfaction

of

by

a

sequence

of

database

states

does

not

imply

that

the

sequence

can

be

extended

to

a

temporal

model

of

We

have

to

proceed

more

subtly

Let

w

and

let

be

the

initial

configuration

of

the

machine

M

with

the

input

w

We

claim

that

the

following

condition

is

equivalent

to

the

statement

that

w

induces

a

repeating

behavior

of

M

For

each

n

the

computation

of

M

on

the

input

w

does

not

terminate

within

n

steps

and

for

each

finite-time

database

D

-LRB-

Dn

-RRB-

such

that

Di

is

the

encoding

of

the

ith

configuration

of

the

computation

of

M

on

w

-LRB-

the

quantifier

for

each

stands

here

for

formal

reasons

in

fact

there

may

be

at

most

one

such

database

-RRB-

D

satisfies

the

past

formula

One

implication

is

plain

and

the

other

follows

from

our

hypothesis

and

the

fact

that

the

initial

configuration

has

at

most

one

prolongation

to

a

computation

of

M

of

length

n.

Now

using

appropriate

encodings

of

finite

sequences

of

database

states

by

natural

numbers

one

can

easily

see

that

the

last

problem

is

in

the

class

which

contradicts

Lemma

Formula

The

formula

will

force

that

a

database

encodes

a

repeating

computation

if

considered

with

an

ordering

of

type

on

the

universe

which

is

not

explicitly

present

but

can

be

defined

by

means

of

temporal

formulas

Definability

of

such

an

ordering

in

temporal

logic

is

a

standard

construction

used

in

the

proofs

of

the

incompleteness

of

FOTL

-LSB-

-RSB-

Thus

we

transform

the

above

formula

into

a

-LRB-

-RRB-

formula

written

over

a

vocabulary

consisting

of

monadic

symbols

only

Let

W

be

a

new

monadic

symbol

Consider

the

following

temporal

formulas

-LRB-

-LRB-

W

-LRB-

x

-RRB-

W

-LRB-

y

-RRB-

-RRB-

-RRB-

x

y

-RRB-

-LRB-

x

-RRB-

-LRB-

W

-LRB-

x

-RRB-

-RRB-

W

-LRB-

x

-RRB-

-RRB-

Notice

that

and

are

universal

formulas

while

is

a

tense

-LRB-

-RRB-

formula

The

formula

forces

that

for

each

database

state

there

is

at

most

one

element

of

the

universe

satisfying

the

predicate

W

and

induce

that

for

each

database

state

there

is

exactly

one

such

element

forces

that

for

each

element

of

the

universe

the

predicate

W

is

true

in

at

most

one

database

state

Whenever

and

are

true

in

a

temporal

database

D

they

induce

a

total

ordering

of

type

on

the

set

WD

of

those

elements

of

the

universe

that

satisfy

the

predicate

W

in

some

database

state

defined

as

follows

i

W

j

iff

W

-LRB-

i

-RRB-

happens

not

later

than

W

-LRB-

j

-RRB-

This

ordering

can

be

expressed

by

a

temporal

quantifier-free

formula

x

W

y

df

-LRB-

W

-LRB-

x

-RRB-

W

-LRB-

y

-RRB-

-RRB-

Moreover

if

D

satisfies

then

the

set

WD

is

infinite

and

the

successor

relation

corresponding

to

W

can

be

defined

by

the

formula

SW

-LRB-

x

y

-RRB-

df

-LRB-

W

-LRB-

x

-RRB-

W

-LRB-

y

-RRB-

-RRB-

while

the

initial

-LRB-

zero

-RRB-

element

is

clearly

distinguished

by

ZW

-LRB-

x

-RRB-

df

W

-LRB-

x

-RRB-

We

shall

consider

the

vocabulary

of

monadic

symbols

of

the

previous

subsection

-LRB-

induced

by

the

Turing

machine

M

-RRB-

extended

by

the

symbol

W

Now

if

we

restrict

our

attention

to

models

of

we

can

define

the

encoding

of

configurations

of

M

by

database

states

in

the

similar

way

as

before

but

now

with

respect

to

the

new

ordering

W

Also

the

property

a

database

encodes

a

repeating

computation

of

M

w.r.t.

W

can

be

defined

in

a

similar

way

Let

the

formula

be

as

in

the

previous

subsection

Let

W

be

-LRB-

-RRB-

W

-LRB-

-RRB-

W

-LRB-

-RRB-

W

-LRB-

-RRB-

-RRB-

W

where

W

is

a

formula

obtained

from

by

replacing

each

subformula

x

y

by

x

W

y

succ

-LRB-

x

y

-RRB-

by

SW

-LRB-

x

y

-RRB-

and

Zero

-LRB-

x

-RRB-

by

ZW

-LRB-

x

-RRB-

Consider

the

formula

W

This

formula

can

readily

be

transformed

to

the

form

where

is

tense

-LRB-

-RRB-

Notice

that

uses

only

monadic

predicate

symbols

of

the

database

vocabulary

Consequently

we

have

new

versions

of

Propositions

and

Theorem

and

Corollary

Proposition

A

database

D

satisfies

iff

D

encodes

a

repeating

computation

of

the

machine

M

w.r.t.

the

ordering

W

Proposition

The

property

defined

by

the

formula

is

a

safety

property

Proof

Let

D

-LRB-

:-RRB-

be

a

temporal

database

such

that

any

prefix

-LRB-

Dt

-RRB-

of

D

can

be

extended

to

a

model

of

It

is

easy

to

see

that

D

must

satisfy

We

have

to

show

that

D

j

W

By

Proposition

any

prefix

of

D

can

be

extended

to

a

temporal

database

encoding

some

repeating

computation

of

M

In

all

these

encodings

the

database

state

encodes

an

initial

configuration

of

the

corresponding

computation

Notice

that

this

configuration

is

not

entirely

determined

by

itself

and

not

even

by

the

whole

D

but

it

depends

also

on

the

interpretation

of

the

predicate

letter

W

in

the

actual

extension

We

show

however

that

if

we

consider

sufficiently

large

prefixes

then

the

initial

configurations

in

question

are

equal

Indeed

consider

the

first

time

instant

t

such

that

for

all

a

if

some

Pz

-LRB-

a

-RRB-

z

Q

-LSB-

holds

in

then

W

-LRB-

a

-RRB-

holds

in

some

database

state

Di

with

i

t

or

it

holds

in

no

database

state

of

D

at

all

Let

b

be

the

element

such

that

W

-LRB-

b

-RRB-

holds

in

Dt

-LRB-

there

is

such

an

element

since

D

satisfies

-RRB-

Observe

that

for

any

extension

of

the

prefix

-LRB-

Dt

-RRB-

that

encodes

a

computation

of

the

machine

M

if

we

consider

the

initial

configuration

of

this

computation

then

b

encodes

the

first

position

of

the

machine

's

tape

holding

the

symbol

blank

-LRB-

Intuitively

the

information

about

the

initial

configuration

encoded

by

has

been

completed

by

t.

-RRB-

Then

it

is

not

difficult

to

see

that

all

the

computations

encoded

by

the

extensions

of

the

prefix

-LRB-

Dt

-RRB-

start

with

the

same

initial

configuration

and

consequently

are

equal

Using

a

similar

argument

for

subsequent

configurations

one

can

further

see

that

D

itself

encodes

this

unique

computation

in

question

Thus

by

Proposition

we

are

done

Theorem

The

problem

of

deciding

whether

a

given

finite-time

temporal

database

over

the

vocabulary

considered

above

can

be

extended

to

a

temporal

model

of

is

Proof

The

argument

is

analogous

as

in

the

proof

of

Theorem

However

in

the

reduction

given

w

we

have

now

to

construct

a

finite-time

temporal

database

say

Dw

-LRB-

Dtw

-RRB-

that

usually

has

more

than

one

state

It

is

easy

to

construct

Dw

in

such

a

way

that

is

the

encoding

of

the

initial

configuration

of

M

on

the

input

w

in

any

possible

extension

of

Dw

satisfying

-LRB-

due

to

appropriate

choice

of

the

predicate

W

in

the

database

states

Dtw

-RRB-

The

following

is

obtained

by

a

slight

modification

of

the

proof

of

Corollary

Corollary

The

formula

is

not

equivalent

to

any

formula

of

the

form

with

being

a

past

formula

Universal

formulas

We

now

fix

an

arbitrary

finite

vocabulary

L.

Recall

that

by

definition

the

universe

of

a

database

is

infinite

and

countable

and

by

convention

it

coincides

with

N

In

what

follows

we

will

sometimes

relax

this

last

convention

Let

A

be

an

infinite

subset

of

the

universe

of

a

database

D

containing

the

interpretations

of

all

the

constant

symbols

of

L

The

restriction

of

D

to

A

in

symbols

DjA

is

a

database

with

the

universe

A

in

which

the

interpretation

of

a

predicate

symbol

p

of

arity

r

at

a

time

instant

t

is

given

by

pDt

Ar

Clearly

one

could

find

a

database

with

the

universe

N

isomorphic

to

DjA

The

following

property

will

be

useful

if

D

is

a

model

of

a

universal

temporal

sentence

so

is

DjA

Let

D

-LRB-

Dt

:-RRB-

be

a

finite

or

infinite-time

temporal

database

with

the

universe

N

We

call

an

element

m

N

relevant

to

D

if

m

is

an

interpretation

of

some

constant

symbol

or

m

is

in

the

domain

of

the

interpretation

of

some

relation

symbol

in

some

state

of

D

Otherwise

an

element

m

is

irrelevant

to

D.

Let

RD

be

the

set

of

all

elements

relevant

to

D

Let

ID

N

RD.

Clearly

for

a

finite-time

temporal

database

D

RD

is

finite

and

ID

is

infinite

Lemma

Let

be

a

universal

safety

sentence

Suppose

that

a

finite-time

temporal

database

D

-LRB-

Dt

-RRB-

has

an

extension

to

an

infinite-time

temporal

database

satisfying

Then

D

can

be

also

extended

to

some

satisfying

such

that

RD.

Proof

Let

be

an

extension

of

D

satisfying

We

define

by

setting

Di

for

i

t

and

for

each

n

t

each

predicate

letter

p

of

arity

r

and

ar

N

-LRB-

ar

-RRB-

iff

-LRB-

ar

-RRB-

and

ar

RD

Clearly

RD.

In

order

to

verify

that

j

it

is

enough

to

show

that

for

each

n

N

the

prefix

-LRB-

-RRB-

of

has

an

extension

satisfying

We

can

assume

n

t

Let

be

the

set

of

those

n

N

that

are

not

relevant

to

in

the

prefix

-LRB-

-RRB-

That

is

m

iff

m

is

neither

an

interpretation

of

a

constant

symbol

nor

is

it

in

the

domain

of

the

interpretation

of

a

relation

symbol

in

some

state

for

m

n.

Consider

the

temporal

database

E

obtained

by

the

restriction

of

to

the

set

RD

-LSB-

Because

is

a

universal

formula

E

is

also

a

model

of

But

the

prefix

-LRB-

En

-RRB-

is

clearly

isomorphic

to

-LRB-

-RRB-

Then

we

can

infer

that

-LRB-

-RRB-

itself

has

the

desired

extension

The

important

point

in

the

above

lemma

is

that

the

universe

of

the

model

in

consideration

must

be

infinite

according

to

our

usual

requirement

about

databases

-LRB-

In

particular

the

restriction

of

the

above

to

RD

although

it

is

obviously

a

model

of

can

not

be

considered

a

temporal

database

unless

we

allow

temporal

databases

with

finite

universes

-RRB-

To

illustrate

the

importance

of

the

above

point

we

show

an

example

of

a

universal

temporal

formula

that

has

models

with

arbitrary

large

finite

universes

but

does

not

have

a

model

with

an

infinite

universe

Let

the

formulas

and

x

W

y

be

as

in

section

Define

-LRB-

-RRB-

-LRB-

-LRB-

W

-LRB-

x

-RRB-

-RRB-

until

-LRB-

W

-LRB-

x

-RRB-

W

-LRB-

x

-RRB-

-RRB-

-RRB-

This

formula

forces

that

any

element

of

the

universe

satisfies

the

relation

W

in

exactly

one

database

state

Let

Q

be

a

fresh

monadic

predicate

letter

and

let

and

Q

be

defined

like

and

W

resp.

except

that

all

the

occurrences

of

W

are

replaced

by

Q.

Take

the

conjunction

of

and

the

formula

-LRB-

y

-RRB-

-LRB-

x

Q

y

-RRB-

y

W

x

-RRB-

The

last

formula

asserts

that

the

ordering

of

the

universe

induced

by

Q

is

the

inverse

of

the

ordering

induced

by

W

Together

with

it

forces

the

existence

of

a

W

decreasing

chain

formed

by

all

elements

of

the

universe

Theorem

Given

a

finite-time

temporal

database

D

-LRB-

Dt

-RRB-

and

a

universal

safety

sentence

one

can

construct

a

finite

sequence

of

propositional

states

wD

-LRB-

wt

-RRB-

and

a

formula

'D

of

propositional

TL

such

that

D

can

be

extended

to

an

infinite-time

temporal

database

satisfying

iff

wD

can

be

extended

to

an

infinite

sequence

of

propositional

states

satisfying

'D

The

formula

'D

can

be

chosen

of

the

size

O

-LRB-

-LRB-

j'

j

jRDj

-RRB-

max

-LRB-

k

l

-RRB-

-RRB-

where

l

is

the

maximum

arity

of

database

relations

Proof

Let

Without

loss

of

generality

we

can

assume

that

RD

mDg

for

some

mD

N

Let

CL

be

the

-LRB-

finite

-RRB-

set

of

constants

symbols

of

the

vocabulary

L

We

also

fix

some

k

symbols

say

zk

disjoint

from

RD

and

CL

-LRB-

intuitively

they

will

represent

the

elements

of

the

universe

outside

RD

-RRB-

Let

M

RD

-LSB-

zkg

We

define

a

vocabulary

of

the

propositional

temporal

logic

as

a

set

LD

consisting

of

the

following

propositional

symbols

ffl

-LRB-

a

b

-RRB-

for

each

a

b

M

-LSB-

CL

ffl

p

-LRB-

aar

-LRB-

p

-RRB-

-RRB-

for

each

predicate

p

of

L

and

each

sequence

aar

-LRB-

p

-RRB-

M

-LSB-

CL

-LRB-

Note

that

we

have

intentionally

chosen

some

well

formed

first-order

formulas

to

denote

the

propositional

letters

in

LD

-RRB-

Now

let

f

xkg

M

be

any

mapping

For

each

atomic

formula

ff

over

L

with

variables

among

xkg

let

ff

-LSB-

f

-RSB-

be

the

result

of

the

substitution

of

f

-LRB-

xi

-RRB-

for

xi

For

example

if

f

-LRB-

-RRB-

and

f

-LRB-

-RRB-

then

-LRB-

-RRB-

-LSB-

f

-RSB-

-LRB-

-RRB-

Notice

that

each

ff

-LSB-

f

-RSB-

can

be

identified

with

a

propositional

symbol

in

LD

The

ff

-LSB-

f

-RSB-

operation

can

be

extended

in

a

natural

way

to

all

quantifier-free

first-order

temporal

formulas

over

L

with

variables

among

xkg

ff

-LSB-

f

-RSB-

is

then

a

formula

of

the

propositional

temporal

logic

over

LD

Let

D

f

-LSB-

f

-RSB-

where

f

ranges

over

all

mappings

from

the

set

xkg

to

M

We

also

define

the

propositional

temporal

formula

AxiomD

as

the

conjunction

of

the

following

ffl

-LRB-

a

a

-RRB-

for

each

a

M

-LSB-

CL

ffl

-LRB-

a

b

-RRB-

-LRB-

b

a

-RRB-

for

each

a

b

M

-LSB-

CL

ffl

-LRB-

a

b

-RRB-

-LRB-

b

c

-RRB-

-RRB-

-LRB-

a

c

-RRB-

for

each

a

b

c

M

-LSB-

CL

ffl

-LRB-

-RRB-

-LRB-

aar

-LRB-

p

-RRB-

bar

-LRB-

p

-RRB-

-RRB-

-RRB-

p

-LRB-

aar

-LRB-

p

-RRB-

-RRB-

p

-LRB-

bar

-LRB-

p

-RRB-

-RRB-

for

each

predicate

p

of

L

and

each

aar

-LRB-

p

-RRB-

bar

-LRB-

p

-RRB-

M

-LSB-

CL

ffl

-LRB-

i

c

-RRB-

for

each

i

mD

and

c

CL

such

that

i

ffl

-LRB-

c

d

-RRB-

for

each

c

d

CL

s.t.

ffl

-LRB-

i

j

-RRB-

for

each

i

j

mD

i

j

ffl

-LRB-

i

c

-RRB-

for

each

i

mD

and

c

CL

s.t.

i

ffl

-LRB-

c

d

-RRB-

for

each

c

d

CL

s.t.

ffl

-LRB-

zi

j

-RRB-

for

each

zi

and

each

j

mD

ffl

-LRB-

zi

zj

-RRB-

for

each

zi

zj

such

that

i

j

ffl

:p

-LRB-

aar

-LRB-

p

-RRB-

-RRB-

for

each

predicate

p

of

L

and

each

aar

-LRB-

p

-RRB-

M

-LSB-

CL

s.t.

at

least

one

ai

is

among

zkg

We

set

'D

df

D

AxiomD

We

are

now

going

to

define

the

sequence

of

propositional

states

wD

-LRB-

wt

-RRB-

Recall

that

a

propositional

state

is

a

mapping

from

the

set

of

propositional

letters

to

the

set

ftrue

falseg

Intuitively

w

is

a

description

of

the

database

state

D

Recall

that

the

interpretation

of

a

constant

symbol

c

is

the

same

in

each

database

state

in

symbols

cD

We

set

ffl

w

-LRB-

c

d

-RRB-

true

iff

cD

dD

for

all

constant

symbols

c

d

CL

ffl

w

-LRB-

c

i

-RRB-

w

-LRB-

i

c

-RRB-

true

iff

cD

i

for

c

CL

i

mD

ffl

w

-LRB-

i

i

-RRB-

true

ffl

w

-LRB-

i

j

-RRB-

false

for

i

j

ffl

w

-LRB-

zi

zi

-RRB-

true

ffl

w

-LRB-

zi

zj

-RRB-

false

for

i

j

ffl

w

-LRB-

zi

c

-RRB-

w

-LRB-

c

zi

-RRB-

false

for

c

CL

ffl

w

-LRB-

zi

j

-RRB-

w

-LRB-

j

zi

-RRB-

false

ffl

w

-LRB-

p

-LRB-

aar

-LRB-

p

-RRB-

-RRB-

-RRB-

true

for

aar

-LRB-

p

-RRB-

mDg

-LSB-

CL

iff

the

predicate

p

is

true

for

the

vector

-LRB-

aar

-LRB-

p

-RRB-

-RRB-

in

the

database

state

D

ffl

w

-LRB-

p

-LRB-

aar

-LRB-

p

-RRB-

-RRB-

false

whenever

at

least

one

of

the

ai

's

is

in

among

zkg

Suppose

now

that

if

D

-LRB-

Dt

-RRB-

has

an

extension

to

an

infinite-time

temporal

database

-LRB-

Dt

:-RRB-

satisfying

By

Lemma

we

can

assume

that

RD.

Let

-LRB-

wt

wt

wt

:-RRB-

where

for

t

w

is

defined

in

the

same

way

as

for

t

-LRB-

see

above

-RRB-

We

will

verify

that

satisfies

'D

Clearly

satisfies

AxiomD

Now

let

f

xkg

M

Fix

some

distinct

k

elements

bk

N

RD

and

define

a

valuation

v

by

v

-LRB-

xi

-RRB-

-LRB-

f

-LRB-

xi

-RRB-

if

f

-LRB-

xi

-RRB-

RD

bj

if

f

-LRB-

xi

-RRB-

zj

Now

it

is

easy

to

verify

by

structural

induction

that

for

any

quantifier-free

temporal

formula

ff

-LRB-

xk

-RRB-

and

for

any

time

instant

s

v

s

j

ff

iff

s

j

ff

-LSB-

f

-RSB-

Since

by

our

assumption

v

j

we

can

conclude

that

j

-LSB-

f

-RSB-

Because

f

was

arbitrarily

chosen

we

have

j

D

and

hence

also

j

'D

as

required

To

show

the

other

direction

suppose

wD

can

be

extended

to

to

an

infinite

sequence

that

is

a

model

of

'D

Then

in

order

to

obtain

an

extension

of

D

satisfying

we

need

to

decode

propositional

states

into

relations

Suppose

that

the

sequence

wD

-LRB-

wt

-RRB-

can

be

extended

to

an

infinite

sequence

of

propositional

states

say

-LRB-

wt

wt

wt

:-RRB-

which

satisfies

'D

For

each

i

t

we

define

a

database

state

Di

as

follows

The

interpretation

of

the

constant

symbols

is

the

same

as

in

D.

For

a

predicate

symbol

p

and

aar

-LRB-

p

-RRB-

N

pDi

-LRB-

aar

-LRB-

p

-RRB-

-RRB-

holds

iff

aar

-LRB-

p

-RRB-

RD

and

the

propositional

symbol

p

-LRB-

aar

-LRB-

p

-RRB-

-RRB-

evaluates

to

true

in

the

propositional

state

wi

otherwise

pDi

-LRB-

aar

-LRB-

p

-RRB-

-RRB-

does

not

hold

We

will

show

that

the

resulting

infinite-time

database

-LRB-

Dt

Dt

Dt

:-RRB-

satisfies

Let

v

be

a

valuation

Suppose

that

the

values

v

-LRB-

xi

-RRB-

i

k

which

are

not

in

RD

form

a

set

bpg

-LRB-

this

set

can

be

empty

-RRB-

Fix

some

embedding

e

of

this

set

into

zkg

Define

f

xkg

M

as

f

-LRB-

xi

-RRB-

-LRB-

v

-LRB-

xi

-RRB-

if

v

-LRB-

xi

-RRB-

RD

e

-LRB-

v

-LRB-

xi

-RRB-

-RRB-

otherwise

Now

using

the

fact

that

j

AxiomD

it

is

easy

to

verify

by

structural

induction

that

for

any

quantifier-free

temporal

formula

ff

-LRB-

xk

-RRB-

and

for

any

time

instant

s

v

s

j

ff

iff

s

j

ff

-LSB-

f

-RSB-

Since

by

our

assumption

j

-LSB-

f

-RSB-

for

any

f

we

have

v

j

for

any

v

and

consequently

j

as

required

The

polynomial

upper

bound

on

the

size

of

'D

follows

directly

from

the

proof

The

exponent

is

due

to

the

fact

that

the

size

of

AxiomD

is

O

-LRB-

jRDjmax

-LRB-

k

l

-RRB-

-RRB-

The

above

theorem

will

allow

us

to

reduce

the

question

if

a

finite-time

temporal

database

can

be

extended

to

a

model

of

a

universal

safety

sentence

to

the

question

of

satisfiability

of

some

propositional

temporal

formula

By

the

results

on

propositional

temporal

logic

this

will

yield

decidability

of

the

extension

problem

Lemma

Given

a

sequence

of

propositional

states

w

-LRB-

wt

-RRB-

and

a

formula

ff

of

propositional

TL

one

can

decide

if

w

can

be

extended

to

a

model

of

ff

in

time

O

-LRB-

t

jffj

-RRB-

-LRB-

jffj

-RRB-

and

space

t

jffjO

-LRB-

-RRB-

Proof

The

algorithm

consists

of

two

phases

The

first

phase

is

deterministic

we

check

whether

the

propositional

states

wt

are

consistent

with

ff

i.e.

whether

they

can

form

a

prefix

of

a

model

of

ff

This

can

be

done

using

the

approach

of

Sistla

and

Wolfson

-LSB-

-RSB-

The

essence

of

this

approach

consists

of

building

a

formula

on

the

basis

of

ff

and

w

-LRB-

wt

-RRB-

for

t

This

formula

will

be

tested

for

satisfiability

in

the

second

phase

We

show

how

to

build

the

formula

Start

with

the

expression

-LSB-

ff

-RSB-

We

will

push

the

subscript

-LRB-

denoting

the

state

index

in

the

prefix

w

-RRB-

inside

the

formula

If

ff

until

then

it

will

be

rewritten

to

-LSB-

-RSB-

-LSB-

-RSB-

-LSB-

ff

-RSB-

If

ff

then

it

will

be

rewritten

to

-LSB-

-RSB-

-LSB-

-RSB-

If

ff

then

several

cases

are

distinguished

If

then

-LSB-

ff

-RSB-

is

rewritten

to

-LSB-

-RSB-

If

ffi

then

-LSB-

ff

-RSB-

is

rewritten

to

-LSB-

-RSB-

-LSB-

ffi

-RSB-

If

until

ffi

then

the

result

of

the

rewriting

is

-LSB-

ffi

-RSB-

-LRB-

-LSB-

-RSB-

-LSB-

ff

-RSB-

-RRB-

If

then

-LSB-

ff

-RSB-

is

rewritten

to

-LSB-

-RSB-

Finally

if

ff

then

-LSB-

ff

-RSB-

is

rewritten

to

-LSB-

-RSB-

Subsequently

the

expressions

with

subscript

are

further

rewritten

using

the

same

rules

It

should

be

clear

that

as

the

result

of

the

rewriting

we

obtain

a

boolean

combination

of

propositional

atoms

with

subscript

and

expressions

of

the

form

-LSB-

-RSB-

where

is

a

subformula

of

the

original

formula

or

its

negation

Now

atoms

of

the

first

kind

can

be

replaced

by

true

or

false

depending

on

the

propositional

state

and

the

resulting

formula

simplified

In

this

way

we

obtain

the

formula

In

the

next

step

expressions

with

subscript

are

rewritten

and

the

resulting

formula

simplified

to

obtain

etc.

Finally

the

formula

fft

is

obtained

The

second

phase

verifies

the

satisfiability

of

fft

using

the

nondeterministic

polynomial

space

procedure

of

Sistla

and

Clarke

-LSB-

-RSB-

It

is

easy

to

see

that

every

formula

ffi

i

t

is

of

size

at

most

O

-LRB-

jffj

-RRB-

Thus

the

first

phase

takes

O

-LRB-

t

jffj

-RRB-

time

and

the

second

phase

takes

-LRB-

jffj

-RRB-

time

From

this

and

Theorem

we

can

infer

our

main

result

about

universal

formulas

Theorem

Given

a

finite-time

temporal

database

D

-LRB-

Dt

-RRB-

and

a

universal

safety

sentence

one

can

decide

if

D

can

be

extended

to

an

infinite-time

temporal

database

satisfying

in

time

O

-LRB-

t

-LRB-

j'

j

jRDj

-RRB-

max

-LRB-

k

l

-RRB-

-RRB-

-LRB-

-LRB-

j'

j?jRDj

-RRB-

max

-LRB-

k

l

-RRB-

-RRB-

where

l

is

the

maximum

arity

of

database

relations

In

the

formulation

of

Theorem

it

is

essential

that

be

a

safety

sentence

For

universal

sentences

that

are

not

safety

sentences

e.g.

p

-LRB-

x

-RRB-

Lemma

fails

and

the

proofs

of

and

Theorem

do

not

go

through

This

fact

provides

an

additional

justification

for

considering

only

safety

formulas

as

integrity

constraints

Related

work

It

seems

safe

to

say

that

FOTL

is

the

preferred

language

for

the

specification

of

temporal

integrity

constraints

as

evidenced

by

the

following

papers

-LRB-

the

list

is

by

no

means

complete

-RRB-

-LSB-

-RSB-

Lipeck

Saake

and

their

students

-LSB-

-RSB-

introduced

the

class

of

biquantified

formulas

-LRB-

although

they

did

n't

use

this

term

-RRB-

proposed

several

constraint

checking

methods

for

this

class

and

were

the

first

to

define

a

notion

equivalent

to

potential

constraint

satisfaction

It

is

clear

from

the

lower

recursion-theoretic

bounds

established

in

the

present

paper

that

checking

potential

constraint

satisfaction

for

the

full

class

of

biquantified

formulas

is

not

computationally

feasible

Therefore

the

methods

of

Lipeck

and

Saake

implemented

by

necessity

a

weaker

notion

of

constraint

satisfaction

namely

one

in

which

constraint

violations

are

always

detected

but

not

necessarily

at

the

earliest

possible

time

In

our

earlier

work

-LSB-

-RSB-

we

introduced

Past

FOTL

-LRB-

FOTL

with

past

operators

only

-RRB-

as

the

language

for

specifying

temporal

integrity

constraints

and

proposed

an

efficient

method

to

evaluate

such

constraints

-LRB-

again

under

a

weaker

notion

than

potential

constraint

satisfaction

-RRB-

We

have

also

extended

Past

FOTL

to

Past

Metric

FOTL

in

order

to

be

able

to

formulate

real-time

constraints

-LRB-

constraints

that

refer

to

the

values

of

a

clock

-RRB-

Qian

and

Waldinger

-LSB-

-RSB-

also

recognized

the

need

for

efficient

checking

of

temporal

constraints

They

presented

many

compelling

examples

but

no

general

method

Castilho

Casanova

and

Furtado

-LSB-

-RSB-

and

Kung

-LSB-

-RSB-

dealt

mainly

with

the

issue

of

consistency

of

temporal

constraints

with

action

specifications

and

did

not

study

integrity

checking

in

the

presence

of

arbitrary

updates

Sistla

and

Wolfson

-LSB-

-RSB-

discussed

triggers

whose

conditions

are

temporal

formulas

However

instead

of

standard

first-order

quantifiers

they

used

freeze

quantifiers

with

nonstandard

semantics

The

expressive

power

of

their

trigger

language

depends

on

the

query

language

of

the

underlying

DBMS

It

is

interesting

to

note

that

if

the

latter

language

is

a

first-order

query

language

like

relational

calculus

or

algebra

the

trigger

language

of

-LSB-

-RSB-

is

as

expressive

as

the

class

tense

-LRB-

-RRB-

of

FOTL

formulas

i.e.

the

class

of

negations

of

biquantified

formulas

The

integrity

checking

method

of

-LSB-

-RSB-

implements

like

-LSB-

-RSB-

a

notion

of

constraint

satisfaction

that

is

weaker

than

potential

constraint

satisfaction

In

the

object-oriented

context

Gehani

Jagadish

and

Shmueli

-LSB-

-RSB-

discussed

triggers

that

are

fired

by

event

occurrences

They

introduced

a

language

of

extended

regular

expressions

for

specifying

composite

events

Conclusions

and

further

work

We

have

analyzed

the

computational

feasibility

of

checking

temporal

integrity

constraints

formulated

in

some

sublanguages

of

FOTL

Our

results

illustrate

the

impact

of

the

quantifier

pattern

on

the

complexity

of

this

problem

The

presence

of

a

single

quantifier

in

the

scope

of

a

temporal

operator

makes

the

problem

undecidable

On

the

other

hand

if

no

quantifiers

are

in

the

scope

of

a

temporal

operator

and

all

the

quantifiers

are

universal

temporal

integrity

checking

can

be

done

in

exponential

time

The

most

immediate

question

is

whether

one

can

remove

jRDj

-LRB-

the

size

of

the

set

of

relevant

domain

elements

-RRB-

from

the

exponent

in

the

time

bound

for

universal

formulas

Most

probably

no

as

shown

by

the

following

argument

Consider

a

deterministic

Turing

machine

M

that

decides

the

problem

SAT

within

polynomial

space

and

exponential

time

Using

techniques

similar

to

those

used

in

section

we

can

encode

an

initial

configuration

of

this

machine

by

a

single

database

state

We

can

make

this

initial

configuration

as

large

as

the

maximal

space

needed

for

the

computation

Then

it

is

not

difficult

to

write

a

universal

formula

defining

a

safety

property

such

that

the

singleton

sequence

-LRB-

-RRB-

can

be

extended

to

a

model

of

iff

M

accepts

-LRB-

Notice

that

we

are

now

dealing

with

a

machine

operating

in

a

bounded

space

It

is

enough

that

the

successor

relation

will

be

correctly

defined

in

the

formula

can

force

that

this

relation

remains

the

same

throughout

the

other

database

states

Therefore

the

problem

resulting

from

the

impossibility

of

axiomatizing

the

successor

relation

by

a

universal

formula

that

we

have

encountered

in

section

does

not

arise

here

-RRB-

Now

if

we

could

answer

the

extension

question

within

a

time

polynomial

in

the

size

of

then

we

could

solve

SAT

in

polynomial

time

which

is

believably

not

possible

It

is

essential

that

a

universal

sentence

be

a

safety

sentence

for

the

exponential

upper

bound

to

hold

Sistla

-LSB-

-RSB-

showed

that

propositional

safety

formulas

can

be

characterized

syntactically

He

also

proved

that

recognizing

propositional

safety

formulas

is

decidable

We

conjecture

that

his

results

generalize

to

universal

biquantified

formulas

To

make

temporal

integrity

checking

more

practical

weaker

notions

of

constraint

satisfaction

should

be

considered

and

their

computational

complexity

analyzed

An

important

notion

in

this

area

is

that

of

a

history-less

constraint

evaluation

-LSB-

-RSB-

Intuitively

the

complexity

of

history-less

constraint

evaluation

does

not

depend

on

the

length

of

the

database

history

but

only

on

the

number

of

different

attribute

values

that

appear

in

it

A

history-less

evaluation

method

for

Past

FOTL

implementing

a

notion

weaker

than

potential

constraint

satisfaction

is

presented

in

-LSB-

-RSB-

It

remains

to

be

seen

whether

a

history-less

method

can

be

devised

for

universal

biquantified

formulas

Acknowledgments

The

comments

of

the

anonymous

referees

are

gratefully

acknowledged

References

-LSB-

-RSB-

Alpern

B.

and

Schneider

F.

Defining

Liveness

Inf

Process

Lett

-LRB-

-RRB-

-LCB-

-LSB-

-RSB-

Chang

C.

and

Keisler

H.

Model

Theory

North-Holland

-LSB-

-RSB-

Chomicki

J.

History-less

Checking

of

Dynamic

Integrity

Constraints

In

IEEE

International

Conference

on

Data

Engineering

-LRB-

Phoenix

Arizona

February

-RRB-

-LSB-

-RSB-

Chomicki

J.

Real-Time

Integrity

Constraints

In

ACM

Symposium

on

Principles

of

Database

Systems

-LRB-

San

Diego

California

June

-RRB-

-LSB-

-RSB-

Chomicki

J.

Temporal

Integrity

Constraints

in

Relational

Databases

IEEE

Data

Engineering

Bulletin

-LRB-

June

-RRB-

-LCB-

-LSB-

-RSB-

Dayal

U.

et

al.

The

HiPAC

Project

Combining

Active

Databases

and

Timing

Constraints

SIGMOD

Record

-LRB-

March

-RRB-

-LCB-

-LSB-

-RSB-

de

Castilho

J.

Casanova

M.

and

Furtado

A

A

Temporal

Framework

for

Database

Specifications

In

International

Conference

on

Very

Large

Data

Bases

-LRB-

-RRB-

pp.

-LCB-

-LSB-

-RSB-

Emerson

E.

Temporal

and

Modal

Logic

In

Handbook

of

Theoretical

Computer

Science

J.

van

Leeuwen

Ed.

vol

B.

Elsevier/MIT

Press

ch

pp.

-LCB-

-LSB-

-RSB-

Finger

M.

and

Gabbay

D.

Adding

a

temporal

dimension

to

a

logic

system

Journal

of

Logic

Language

and

Information

-LRB-

-RRB-

-LSB-

-RSB-

Gabbay

D.

Hodkinson

I.

and

Reynolds

M.

Temporal

Logic

Mathematical

Foundations

and

Computational

Aspects

Oxford

University

Press

-LSB-

-RSB-

Garson

J.

Quantification

in

Modal

Logic

In

Handbook

of

Philosophical

Logic

D.

Gabbay

and

F.

Guenthner

Eds

D.

Reidel

ch

II

pp.

-LCB-

-LSB-

-RSB-

Gehani

N.

Jagadish

H.

and

Shmueli

O.

Composite

Event

Specification

in

Active

Databases

Model

Implementation

In

International

Conference

on

Very

Large

Data

Bases

-LRB-

-RRB-

pp.

-LCB-

-LSB-

-RSB-

Gehani

N.

Jagadish

H.

and

Shmueli

O.

Event

Specification

in

an

Active

ObjectOriented

Database

In

ACM

SIGMOD

International

Conference

on

Management

of

Data

-LRB-

-RRB-

pp.

-LCB-

-LSB-

-RSB-

Gertz

M.

and

Lipeck

U.

Deriving

Integrity

Maintaining

Triggers

from

Transition

Graphs

In

IEEE

International

Conference

on

Data

Engineering

-LRB-

-RRB-

-LSB-

-RSB-

Harel

D.

Recurring

Dominoes

Making

the

Highly

Undecidable

Highly

Understandable

Annals

of

Discrete

Mathematics

-LRB-

-RRB-

-LCB-

-LSB-

-RSB-

Hopcroft

J.

and

Ullman

J.

Introduction

to

Automata

Theory

Languages

and

Computation

Addison-Wesley

-LSB-

-RSB-

H?ulsmann

K.

and

Saake

G.

Theoretical

Foundations

of

Handling

Large

Substitution

Sets

in

Temporal

Integrity

Monitoring

Acta

Informatica

-LRB-

-RRB-

-LSB-

-RSB-

Kung

C.

On

Verification

of

Database

Temporal

Constraints

In

ACM

SIGMOD

International

Conference

on

Management

of

Data

-LRB-

Austin

Texas

-RRB-

pp.

-LCB-

-LSB-

-RSB-

Lipeck

U.

Gertz

M.

and

Saake

G.

Transitional

Monitoring

of

Dynamic

Integrity

Constraints

IEEE

Data

Engineering

Bulletin

-LRB-

June

-RRB-

-LSB-

-RSB-

Lipeck

U.

and

Saake

G.

Monitoring

Dynamic

Integrity

Constraints

Based

on

Temporal

Logic

Information

Systems

-LRB-

-RRB-

-LCB-

-LSB-

-RSB-

Pnueli

A.

Applications

of

Temporal

Logic

to

the

Specification

and

Verification

of

Reactive

Systems

a

Survey

of

Current

Trends

In

Current

Trends

in

Concurrency

Springer-Verlag

LNCS

-LSB-

-RSB-

Qian

X.

and

Waldinger

R

A

Transaction

Logic

for

Database

Specification

In

ACM

SIGMOD

International

Conference

on

Management

of

Data

-LRB-

-RRB-

pp.

-LCB-

-LSB-

-RSB-

Rogers

Jr.

H.

Theory

of

Recursive

Functions

and

Effective

Computability

McGraw-Hill

-LSB-

-RSB-

Sistla

A.

On

Characterization

of

Safety

and

Liveness

Properties

in

Temporal

Logic

In

ACM

Symposium

on

Principles

of

Distributed

Computing

-LRB-

-RRB-

pp.

-LCB-

-LSB-

-RSB-

Sistla

A.

and

Clarke

E

The

Complexity

of

Propositional

Linear

Temporal

Logics

Journal

of

the

ACM

-LRB-

July

-RRB-

-LCB-

-LSB-

-RSB-

Sistla

A.

and

Wolfson

O.

Temporal

Triggers

in

Active

Databases

IEEE

Transactions

on

Knowledge

and

Data

Engineering

-LRB-

-RRB-

To

appear

-LSB-

-RSB-

Snodgrass

R.

Temporal

Databases

In

Theories

and

Methods

of

Spatio-Temporal

Reasoning

in

Geographic

Space

-LRB-

-RRB-

Springer-Verlag

LNCS

pp.

-LCB-

-LSB-

-RSB-

Tansel

A.

Clifford

J.

Gadia

S.

Jajodia

S.

Segev

A.

and

Snodgrass

R.

Eds

Temporal

Databases

Theory

Design

and

Implementation

Benjamin/Cummings

Appendix

A

temporal

formula

encoding

repeating

computations

of

a

Turing

machine

We

are

going

to

describe

a

way

in

which

the

computations

of

Turing

machines

can

be

encoded

by

temporal

databases

and

to

present

a

temporal

formula

expressing

the

property

that

the

encoded

computation

is

repeating

This

will

be

the

formula

that

is

required

in

Proposition

Recall

that

in

this

formula

we

are

allowed

to

use

the

extended

vocabulary

-LRB-

c.f.

Section

-RRB-

More

specifically

our

vocabulary

will

consist

of

a

finite

number

of

unary

predicate

symbols

and

the

specific

predicate

symbols

-LRB-

binary

-RRB-

succ

-LRB-

binary

-RRB-

and

Zero

-LRB-

unary

-RRB-

interpreted

over

the

universe

N

in

the

standard

way

Note

that

the

interpretation

of

any

unary

predicate

symbol

in

any

database

state

is

finite

Let

us

fix

a

Turing

machine

M

satisfying

the

property

of

Lemma

We

may

assume

that

M

has

one

tape

infinite

to

the

right

Recall

that

the

alphabet

of

the

tape

symbols

used

by

M

includes

the

input

alphabet

and

the

special

blank

symbol

B

Let

Q

be

the

set

of

states

of

M

including

the

initial

state

We

assume

the

reader

is

familiar

with

the

concept

of

configuration

of

a

Turing

machine

-LRB-

also

called

instantaneous

description

-LSB-

-RSB-

-RRB-

For

our

purpose

it

is

convenient

to

slightly

modify

this

concept

and

to

present

a

configuration

as

an

infinite

rather

than

finite

sequence

of

elements

in

-LSB-

Q

Such

a

sequence

is

of

the

form

ffq

B

where

ff

and

q

Q

Note

that

there

is

exactly

one

occurrence

of

a

machine

's

state

symbol

and

that

all

but

finitely

many

symbols

in

the

sequence

are

B.

Thus

a

configuration

corresponds

precisely

to

an

actual

content

of

the

Turing

machine

's

tape

and

the

position

of

q

indicates

the

actual

position

of

the

machine

's

head

it

is

supposed

to

be

scanning

the

first

symbol

of

B

-LRB-

Notice

that

we

do

not

forbid

B

to

occur

in

ff

or

-RRB-

An

initial

configuration

is

of

the

form

where

w

Now

for

a

configuration

C

there

is

at

most

one

configuration

resulting

from

C

by

one

move

of

M

If

it

is

the

case

and

C

then

each

three

consequtive

letters

cici

ci

determine

uniquely

and

determines

uniquely

Now

a

computation

of

M

with

an

input

w

can

be

identified

with

a

sequence

of

configurations

where

is

an

initial

configuration

say

and

for

each

i

Ci

results

from

Ci

by

one

move

Moreover

the

input

w

induces

a

repeating

behaviour

of

M

if

the

computation

sequence

is

infinite

and

contains

infinitely

many

configurations

of

the

form

qffB

We

call

such

a

sequence

a

repeating

computation

-LRB-

of

M

-RRB-

Our

vocabulary

will

include

a

monadic

symbol

Pq

for

each

state

q

Q

and

a

monadic

predicate

symbol

Poe

for

each

oe

except

for

B

We

say

that

a

database

state

D

encodes

a

configuration

C

if

for

each

i

N

at

most

one

monadic

predicate

is

true

about

i

and

for

each

z

Q

-LSB-

fBg

the

predicate

corresponding

to

the

symbol

Pz

is

true

about

i

iff

ci

z

Notice

that

ci

B

if

and

only

if

of

the

predicates

Pz

is

true

about

i

Since

B

is

the

only

symbol

that

can

occur

in

a

configuration

infinitely

often

each

configuration

is

indeed

encoded

by

a

database

state

It

will

be

further

convenient

to

use

the

notation

PB

-LRB-

x

-RRB-

as

an

abbreviation

for

V

-LSB-

fBg

Pz

-LRB-

x

-RRB-

Now

we

say

that

a

temporal

structure

D

-LRB-

:-RRB-

encodes

a

computation

if

each

Di

encodes

Ci

for

i

We

will

construct

a

formula

which

will

force

a

temporal

database

to

encode

a

repeating

computation

of

M

At

first

we

construct

several

formulas

each

one

of

them

capturing

one

of

the

desired

properties

For

any

element

i

of

the

universe

in

any

database

state

at

most

one

of

the

monadic

predicates

Pq

q

Q

Poe

oe

fBg

is

true

about

i.

a

-LSB-

Q

b

-LRB-

Pa

-LRB-

x

-RRB-

Pb

-LRB-

x

-RRB-

-RRB-

The

initial

database

state

encodes

some

initial

configuration

of

M

y

Zero

-LRB-

x

-RRB-

-RRB-

-LRB-

x

-RRB-

-LRB-

Zero

-LRB-

x

-RRB-

x

y

PB

-LRB-

y

-RRB-

-RRB-

-RRB-

-LRB-

-LRB-

-LRB-

y

-RRB-

-LRB-

y

-RRB-

-RRB-

-LRB-

-LRB-

x

-RRB-

-LRB-

x

-RRB-

-RRB-

-RRB-

-LRB-

Note

that

we

do

not

need

to

express

the

property

that

there

is

some

B

since

it

follows

from

our

proviso

that

the

interpretation

of

any

of

the

predicate

symbol

Pa

a

-LSB-

Q

is

finite

-RRB-

Subsequent

database

states

encode

subsequent

configurations

For

this

we

shall

use

the

fact

that

any

three

consecutive

positions

of

a

configuration

determine

uniquely

the

content

of

the

middle

position

in

the

next

configuration

More

specifically

we

shall

need

a

formula

for

each

transition

of

M

Suppose

there

is

a

transition

of

the

form

q

oe

p

ae

R

-LRB-

i.e.

if

the

machine

is

scanning

symbol

oe

in

state

q

then

in

the

next

move

it

changes

state

to

p

replaces

oe

by

ae

and

moves

the

head

right

-RRB-

Then

the

corresponding

formula

is

y

z

-LRB-

succ

-LRB-

x

y

-RRB-

succ

-LRB-

y

z

-RRB-

Pq

-LRB-

x

-RRB-

Poe

-LRB-

y

-RRB-

Pc

-LRB-

z

-RRB-

=-RRB-

-LRB-

Pae

-LRB-

x

-RRB-

Pp

-LRB-

y

-RRB-

Pc

-LRB-

z

-RRB-

-RRB-

-RRB-

Formulas

for

other

transitions

are

similar

Also

we

will

have

a

formula

for

the

case

where

of

the

three

consecutive

positions

contains

a

state

This

formula

will

be

y

z

a

b

-LRB-

succ

-LRB-

x

y

-RRB-

succ

-LRB-

y

z

-RRB-

Pa

-LRB-

x

-RRB-

Pb

-LRB-

y

-RRB-

Pc

-LRB-

z

-RRB-

=-RRB-

Pb

-LRB-

y

-RRB-

-RRB-

There

are

infinitely

many

database

states

which

encode

configurations

with

the

machine

's

head

scanning

the

leftmost

tape

cell

Zero

-LRB-

x

-RRB-

-RRB-

Pq

-LRB-

x

-RRB-

Now

it

is

easy

to

see

that

a

temporal

database

satisfies

the

conjunction

of

all

the

above

formulas

iff

it

is

an

encoding

of

a

repeating

computation

of

the

machine

M

in

the

sense

explained

above

Note

that

any

of

the

above

formulas

can

be

written

in

the

form

where

is

quantifier-free

Moreover

the

conjunction

of

those

formulas

can

be

also

written

in

such

a

form

Thus

the

proof

of

Proposition

is

completed

computational complexity
decidability
integrity constraints
temporal databases
temporal logic