Laboratoire

de

l'Informatique

du

Parall?lisme

Ecole

Normale

Sup?rieure

de

Lyon

Unit

de

recherche

associ?e

au

CNRS

n

A

decision

procedure

for

Direct

Predicate

Calculus

Study

and

implementation

in

the

system

Coq

Jean-Christophe

FILLI

ATRE

February

Research

Report

No

Ecole

Normale

Sup?rieure

de

Lyon

Adresse

lectronique

lip@lip.ens-lyon.fr

T?l?phone

-LRB-

-RRB-

T?l?copieur

-LRB-

-RRB-

All?e

d'Italie

Lyon

Cedex

France

A

decision

procedure

for

Direct

Predicate

Calculus

Study

and

implementation

in

the

system

Coq

Jean-Christophe

FILLI

ATRE

February

Abstract

The

paper

of

J.

Ketonen

and

R.

Weyhrauch

-LSB-

-RSB-

defines

a

decidable

fragment

of

first-order

predicate

logic

Direct

Predicate

Calculus

as

the

subset

which

is

provable

in

Gentzen

sequent

calculus

without

the

contraction

rule

and

gives

an

effective

decision

procedure

for

it

This

report

is

a

detailed

study

of

this

procedure

We

extend

the

decidability

to

non-prenex

formulas

We

prove

that

the

intuitionnistic

fragment

is

still

decidable

with

a

refinement

of

the

same

procedure

An

intuitionnistic

version

has

been

implemented

in

the

system

Coq

-LSB-

-RSB-

using

a

translation

into

natural

deduction

R?esum?e

L'article

de

J.

Ketonen

et

R.

Weyhrauch

-LSB-

-RSB-

d?efinit

un

fragment

d?ecidable

du

calcul

des

pr?edicats

du

premier

ordre

le

Calcul

des

Pr?edicats

Direct

comme

le

sous-ensemble

prouvable

dans

le

calcul

des

s?equents

de

Gentzen

sans

utiliser

la

r?egle

de

contraction

et

en

donne

une

proc?edure

de

d?ecision

effective

Ce

rapport

pr?esente

une

etude

d?etaill?ee

de

cette

proc?edure

Nous

etendons

la

d?ecidabilit?e

au

cas

des

formules

non

n?ecessairement

pr?enexes

Nous

montrons

que

le

fragment

intuitionniste

est

egalement

d?ecidable

par

un

raffinement

de

la

m

eme

proc?edure

Une

version

intuitionniste

de

cette

algorithme

a

et?e

impl?ement?ee

dans

le

syst?eme

Coq

-LSB-

-RSB-

Mots-cl

es

calcul

des

pr?edicats

calcul

des

s?equents

proc?edures

de

d?ecision

recherche

de

preuves

logique

intuitionniste

A

decision

procedure

for

Direct

Predicate

Calculus

Study

and

implementation

in

the

system

Coq

Jean-Christophe

FILLI

ATRE

LIP

URA

CNRS

ENS

Lyon

All?ee

d'Italie

Lyon

cedex

France

e-mail

jcfillia@lip.ens-lyon.fr

February

Abstract

The

paper

of

J.

Ketonen

and

R.

Weyhrauch

-LSB-

-RSB-

defines

a

decidable

fragment

of

first-order

predicate

logic

Direct

Predicate

Calculus

as

the

subset

which

is

provable

in

Gentzen

sequent

calculus

without

the

contraction

rule

and

gives

an

effective

decision

procedure

for

it

This

report

is

a

detailed

study

of

this

procedure

We

extend

the

decidability

to

non-prenex

formulas

We

prove

that

the

intuitionnistic

fragment

is

still

decidable

with

a

refinement

of

the

same

procedure

An

intuitionnistic

version

has

been

implemented

in

the

system

Coq

-LSB-

-RSB-

using

a

translation

into

natural

deduction

Introduction

First-order

predicate

logic

is

known

to

be

undecidable

But

some

fragments

are

decidable

like

propositional

calculus

monadic

predicates

or

some

classes

of

prenex

formulas

-LRB-

Ackermann

's

class

or

G?odel

's

class

for

instance

-RRB-

All

those

fragments

are

syntactic

restrictions

The

paper

of

J.

Ketonen

and

R.

Weyhrauch

-LSB-

-RSB-

defines

a

decidable

fragment

of

predicate

logic

not

in

terms

of

syntactic

restriction

but

with

a

restriction

on

deduction

rules

Indeed

Direct

Predicate

Calculus

is

defined

as

the

fragment

of

first-order

predicate

logic

which

is

provable

in

Gentzen

sequent

calculus

without

the

contraction

rule

Intuitively

it

means

that

for

a

given

proof

each

hypothesis

-LRB-

and

each

conclusion

-RRB-

can

be

used

at

most

once

during

the

proof

For

instance

the

hypothesis

A

is

used

once

in

a

proof

of

A

oe

-LRB-

A

oe

B

-RRB-

oe

B

but

necessarily

twice

in

a

proof

of

A

oe

-LRB-

-LRB-

A

oe

B

-RRB-

-LRB-

A

oe

C

-RRB-

-RRB-

oe

-LRB-

B

C

-RRB-

and

that

's

why

the

first

formula

is

provable

in

Direct

Predicate

Calculus

but

not

the

second

one

In

a

more

subtle

way

it

prevents

proofs

by

case

like

for

instance

the

drinkers

theorem

x

-LRB-

P

-LRB-

y

-RRB-

oe

P

-LRB-

x

-RRB-

-RRB-

which

is

provable

in

Gentzen

sequent

calculus

but

not

in

Direct

Predicate

Calculus

In

-LSB-

-RSB-

a

decision

procedure

for

Direct

Predicate

Calculus

is

explicitly

given

It

has

been

studied

again

in

-LSB-

-RSB-

which

mentions

a

mistake

in

the

original

paper

carries

out

relations

with

linear

logic

and

gives

details

about

implementation

of

the

decision

procedure

The

basic

idea

is

simple

each

atomic

subformula

This

research

was

partly

supported

by

ESPRIT

Basic

Research

Action

Types

and

by

the

GDR

Programmation

cofinanced

by

MRE-PRC

and

CNRS

can

appear

at

most

once

in

an

axiom

therefore

we

can

see

a

derivation

as

the

set

of

its

axioms

The

decision

procedure

consists

of

looking

for

such

sets

-LRB-

called

paths

-RRB-

which

are

finite

and

in

finite

number

then

to

construct

derivation

from

paths

Quantification

in

the

case

of

prenex

formulas

in

handled

through

Herbrand

functions

and

unification

-LSB-

-RSB-

The

result

is

no

longer

true

for

non-prenex

formulas

The

skolemization

does

not

assure

the

eigenvariable

condition

it

can

now

depend

on

the

order

of

the

quantifier

rules

which

was

obvious

and

fixed

in

the

prenex

case

We

extend

the

decision

procedure

to

handle

the

case

of

non-prenex

formulas

the

construction

of

derivations

from

paths

can

now

lead

to

a

failure

We

prove

the

completeness

of

this

procedure

The

ideas

are

closed

to

the

framework

presented

in

-LSB-

-RSB-

but

we

do

not

perform

proof

search

bottom-up

exploiting

the

permutabilities

of

logical

rules

we

look

for

sets

of

axioms

and

re-construct

one

particular

proof

from

these

axioms

Thus

the

permutabilities

of

rules

are

still

completely

exploited

At

last

we

are

interested

in

Intuitionnistic

Direct

Predicate

Calculus

that

is

Direct

Predicate

Calculus

restricted

to

intuitionnistic

sequents

or

equivalently

Gentzen

intuitionnistic

sequent

calculus

-LRB-

LJ

-RRB-

without

contraction

Indeed

we

want

the

decision

procedure

to

be

effective

in

Coq

which

proof

language

is

an

intuitionnistic

natural

deduction

So

we

must

know

when

a

derivation

corresponds

to

an

intuitionnistic

proof

We

extend

again

the

decision

procedure

to

bring

out

intuitionnistic

proofs

when

they

exist

and

we

prove

its

completeness

with

respect

to

intuitionnistic

provability

In

section

we

give

notations

and

definitions

Then

we

present

in

section

the

original

main

result

and

the

decision

procedure

of

-LSB-

-RSB-

but

we

give

a

slightly

different

proof

The

extension

we

give

for

non-prenex

formulas

and

the

case

of

intuitionnistic

proofs

is

presented

in

section

Finally

we

give

details

about

implementation

in

the

system

Coq

in

section

Direct

Predicate

Calculus

Notations

and

definitions

We

assume

the

reader

to

be

familiar

with

predicate

calculus

and

sequent

calculus

Our

language

is

that

of

first-order

predicate

logic

-LRB-

-RRB-

terms

are

built

from

variables

and

functions

symbols

applied

to

terms

formulas

from

atomic

formulas

applied

to

terms

and

the

connectives

oe

with

the

precedences

oe

A

sequent

is

a

couple

of

sequences

and

of

formulas

considered

as

multi-sets

of

formulas

and

is

written

In

order

to

distinguish

the

occurrences

of

an

atomic

formula

in

a

proof

-LRB-

or

a

formula

a

sequent

-RRB-

for

instance

A

in

A

oe

-LRB-

A

oe

C

-RRB-

oe

D

we

extend

the

language

with

annotations

on

atomic

formulas

Ai

will

denote

an

occurrence

of

A

where

i

is

an

integer

Therefore

oe

-LRB-

oe

C

-RRB-

oe

D

represents

the

above

formula

but

in

which

we

have

syntactically

distinguished

the

two

occurrences

of

A

This

language

is

denoted

L.

Definition

-LRB-

separated

formula

-RRB-

A

formula

F

of

L

is

said

to

be

separated

if

two

occurrences

of

the

same

atomic

formula

of

F

are

distinct

that

is

annotated

with

different

integers

If

F

is

a

formula

then

ss

-LRB-

F

-RRB-

is

the

formula

of

obtained

by

removing

all

annotations

on

atomic

formulas

Two

formulas

F

and

G

are

called

similar

-LRB-

F

ss

G

-RRB-

if

ss

-LRB-

F

-RRB-

ss

-LRB-

G

-RRB-

that

is

if

they

represent

the

same

formula

From

now

on

we

will

assume

that

formulas

and

sequents

are

separated

Definition

-LRB-

occurrence

-RRB-

We

will

write

u

OE

t

for

u

occurs

in

t

u

and

t

being

terms

or

formulas

The

notion

of

positive

and

negative

occurrence

is

defined

as

usual

A

formula

A

occurs

positively

in

A

and

if

A

occurs

positively

-LRB-

resp

negatively

-RRB-

in

B

then

A

occurs

positively

-LRB-

resp

negatively

-RRB-

in

C

oe

B

B

C

C

B

B

C

C

B

B

B

and

negatively

-LRB-

resp

positively

-RRB-

in

B

B

oe

C

A

conjunctive

subformula

is

a

positive

occurrence

of

a

conjunctive

formula

-LRB-

A

B

-RRB-

or

a

negative

occurrence

of

a

disjunctive

formula

-LRB-

A

oe

B

-RRB-

and

a

disjunctive

subformula

is

a

positive

occurrence

of

a

disjunctive

formula

or

a

negative

occurrence

of

a

conjunctive

formula

In

the

following

we

will

sometimes

write

A

ffi

B

for

a

conjonctive

or

a

disjunctive

subformula

ffi

being

one

of

the

three

connectives

or

oe

A

quantifier

is

called

essentially

universal

if

it

is

the

outermost

quantifier

of

a

positive

occurrence

of

A

or

a

negative

occurrence

of

A

and

essentially

existential

if

it

is

the

outermost

quantifier

of

a

positive

occurrence

of

A

or

a

negative

occurrence

of

A.

All

those

definitions

are

extended

to

sequents

without

any

difficulty

interpreting

An

Bm

as

the

formula

An

oe

Bm

Axioms

and

rules

Direct

Predicate

Calculus

is

the

fragment

of

first-order

predicate

logic

which

can

be

proved

in

Gentzen

sequent

calculus

-LRB-

LK

-RRB-

without

the

contraction

rules

A

A

A

-LRB-

L

-LCB-

contract

-RRB-

A

A

A

-LRB-

R

-LCB-

contract

-RRB-

Therefore

the

rules

for

Direct

Predicate

Calculus

are

the

following

Axioms

Axioms

are

A

-LRB-

u

-RRB-

B

-LRB-

u

-RRB-

-LRB-

Ax

-RRB-

where

A

and

B

are

two

similar

atomic

formulas

-LRB-

A

ss

B

-RRB-

and

u

a

list

of

terms

Structural

rules

Contraction

being

eliminated

and

exchange

rule

being

implicit

the

only

structural

rules

are

weakening

rules

A

-LRB-

L?W

-RRB-

A

-LRB-

R?W

-RRB-

Logical

rules

Logical

rules

are

exactly

those

of

LK

To

each

connective

oe

or

correspond

two

introduction

rules

one

on

the

left

side

of

the

sequent

the

other

one

on

the

right

side

A

A

-LRB-

L

:-RRB-

A

A

-LRB-

R

:-RRB-

A

B

A

B

-LRB-

L

-RRB-

A

B

A

B

-LRB-

R

-RRB-

A

B

A

B

-LRB-

L

-RRB-

A

B

A

B

-LRB-

R

-RRB-

A

B

A

oe

B

-LRB-

L?oe

-RRB-

A

B

A

oe

B

-LRB-

R?oe

-RRB-

A

-LRB-

t

-RRB-

A

-LRB-

x

-RRB-

-LRB-

L

-RRB-

A

-LRB-

a

-RRB-

A

-LRB-

x

-RRB-

-LRB-

R

-RRB-

A

-LRB-

a

-RRB-

A

-LRB-

x

-RRB-

-LRB-

L

-RRB-

A

-LRB-

t

-RRB-

A

-LRB-

x

-RRB-

-LRB-

R

-RRB-

where

are

formulas

sequences

A

B

are

formulas

a

is

a

variable

which

does

not

appear

in

-LSB-

and

t

a

term

-LRB-

called

witness

of

the

existential

variable

x

-RRB-

In

each

previous

rule

the

formulas

A

and

B

are

called

active

formulas

and

the

formula

appearing

in

the

conclusion

-LRB-

A

B

A

B

:-RRB-

is

called

the

principal

formula

of

the

rule

Notice

that

positivity

is

preserved

by

any

rule

that

is

a

positive

-LRB-

resp

negative

-RRB-

formula

of

the

conclusion

is

also

positive

-LRB-

resp

negative

-RRB-

in

the

premises

and

conversely

One

can

notice

here

that

rules

for

and

oe

are

given

in

their

multiplicative

way

that

is

formulas

of

the

conclusion

are

split

into

the

two

premises

and

not

in

their

additive

way

where

they

would

be

duplicated

in

the

two

premises

like

in

the

rule

A

B

A

B

-LRB-

R

-RRB-

This

is

consistent

with

the

elimination

of

contraction

The

notion

of

derivation

is

defined

as

usual

from

the

rules

above

and

a

formula

of

is

provable

in

Direct

Predicate

Calculus

if

there

exists

a

derivation

of

F

where

F

is

a

formula

of

L

such

that

ss

-LRB-

F

-RRB-

Examples

We

recall

that

LK

denotes

the

first-order

classical

Gentzen

sequent

calculus

-LRB-

see

for

instance

-LSB-

-RSB-

page

-RRB-

As

a

first

example

let

us

consider

the

two

formulas

A

oe

-LRB-

A

-LRB-

B

B

-RRB-

-RRB-

and

A

oe

-LRB-

-LRB-

A

B

-RRB-

-LRB-

A

B

-RRB-

-RRB-

They

represent

the

same

proposition

are

both

provable

in

LK

but

in

the

second

one

the

has

been

distributed

on

the

Only

the

first

one

is

provable

is

DPC

Example

A

oe

A

-LRB-

B

B

-RRB-

is

provable

in

DPC

Proof

A

A

-LRB-

Ax

-RRB-

B

B

-LRB-

Ax

-RRB-

B

B

-LRB-

R

:-RRB-

B

B

-LRB-

R

-RRB-

A

A

-LRB-

B

B

-RRB-

-LRB-

R

-RRB-

A

oe

A

-LRB-

B

B

-RRB-

-LRB-

R?oe

-RRB-

On

the

other

hand

Example

A

oe

-LRB-

-LRB-

A

B

-RRB-

-LRB-

A

B

-RRB-

-RRB-

is

not

provable

in

DPC

Intuitively

every

derivation

of

the

sequent

A

oe

-LRB-

-LRB-

A

B

-RRB-

-LRB-

A

B

-RRB-

-RRB-

must

use

the

hypothesis

A

twice

and

that

is

exactly

what

is

forbidden

by

the

elimination

of

the

contraction

rule

A

proof

of

A

oe

-LRB-

-LRB-

A

B

-RRB-

-LRB-

A

B

-RRB-

-RRB-

in

LK

would

be

A

A

-LRB-

Ax

-RRB-

A

A

-LRB-

Ax

-RRB-

B

B

-LRB-

Ax

-RRB-

B

B

-LRB-

R

:-RRB-

A

B

A

B

-LRB-

R

-RRB-

A

A

A

B

A

B

-LRB-

R

-RRB-

A

A

B

A

B

-LRB-

L?contract

-RRB-

A

-LRB-

A

B

-RRB-

-LRB-

A

B

-RRB-

-LRB-

R

-RRB-

A

oe

-LRB-

-LRB-

A

B

-RRB-

-LRB-

A

B

-RRB-

-RRB-

-LRB-

R?oe

-RRB-

One

can

be

convinced

that

A

oe

-LRB-

-LRB-

A

B

-RRB-

-LRB-

A

B

-RRB-

-RRB-

is

not

provable

in

DPC

by

trying

to

apply

in

a

systematic

way

all

inference

rules

on

the

sequent

-LRB-

see

forthcoming

examples

-RRB-

Another

example

of

formula

provable

in

LK

but

not

in

DPC

is

the

well-known

drinkers

theorem

A

-LRB-

y

-RRB-

oe

A

-LRB-

x

-RRB-

whose

name

came

from

the

interpretation

There

exists

a

person

y

such

that

if

y

drinks

then

everybody

drink

We

choose

here

the

prenex

version

of

this

formula

that

is

x

-LRB-

A

-LRB-

y

-RRB-

oe

A

-LRB-

x

-RRB-

-RRB-

Example

x

-LRB-

A

-LRB-

y

-RRB-

oe

A

-LRB-

x

-RRB-

-RRB-

is

not

provable

in

DPC

Proof

The

only

rule

that

can

be

applied

to

the

sequent

x

-LRB-

A

-LRB-

y

-RRB-

oe

A

-LRB-

x

-RRB-

-RRB-

is

R

and

the

resulting

sequent

is

then

-LRB-

A

-LRB-

t

-RRB-

oe

A

-LRB-

x

-RRB-

-RRB-

x

-LRB-

A

-LRB-

y

-RRB-

oe

A

-LRB-

x

-RRB-

-RRB-

-LRB-

R

-RRB-

where

t

is

a

term

in

which

x

does

not

appear

Again

the

only

rule

that

can

be

applied

is

R

which

leads

to

A

-LRB-

t

-RRB-

oe

A

-LRB-

x

-RRB-

-LRB-

A

-LRB-

t

-RRB-

oe

A

-LRB-

x

-RRB-

-RRB-

-LRB-

R

-RRB-

x

-LRB-

A

-LRB-

y

-RRB-

oe

A

-LRB-

x

-RRB-

-RRB-

-LRB-

R

-RRB-

Once

again

only

the

rule

R

oe

can

be

used

and

leads

to

the

sequent

A

-LRB-

t

-RRB-

A

-LRB-

x

-RRB-

clearly

not

provable

in

DPC

seen

the

above

eigenvariable

condition

on

t.

On

the

other

hand

if

T

denotes

the

formula

x

-LRB-

A

-LRB-

y

-RRB-

oe

A

-LRB-

x

-RRB-

-RRB-

T

T

is

provable

in

DPC

Example

x

-LRB-

A

-LRB-

y

-RRB-

oe

A

-LRB-

x

-RRB-

-RRB-

-LRB-

A

-LRB-

-RRB-

oe

A

-LRB-

-RRB-

-RRB-

is

provable

in

DPC

Proof

A

-LRB-

x

-RRB-

A

-LRB-

x

-RRB-

-LRB-

Ax

-RRB-

A

-LRB-

x

-RRB-

A

-LRB-

x

-RRB-

A

-LRB-

-RRB-

-LRB-

R?W

-RRB-

A

-LRB-

x

-RRB-

A

-LRB-

x

-RRB-

oe

A

-LRB-

-RRB-

-LRB-

R?oe

-RRB-

A

-LRB-

y

-RRB-

A

-LRB-

x

-RRB-

A

-LRB-

x

-RRB-

oe

A

-LRB-

-RRB-

-LRB-

L?W

-RRB-

A

-LRB-

y

-RRB-

oe

A

-LRB-

x

-RRB-

A

-LRB-

x

-RRB-

oe

A

-LRB-

-RRB-

-LRB-

R?oe

-RRB-

A

-LRB-

y

-RRB-

oe

A

-LRB-

x

-RRB-

-LRB-

A

-LRB-

x

-RRB-

oe

A

-LRB-

-RRB-

-RRB-

-LRB-

R

-RRB-

A

-LRB-

y

-RRB-

oe

A

-LRB-

x

-RRB-

-LRB-

A

-LRB-

-RRB-

oe

A

-LRB-

-RRB-

-RRB-

-LRB-

R

-RRB-

-LRB-

A

-LRB-

y

-RRB-

oe

A

-LRB-

x

-RRB-

-RRB-

-LRB-

A

-LRB-

-RRB-

oe

A

-LRB-

-RRB-

-RRB-

-LRB-

R

-RRB-

x

-LRB-

A

-LRB-

y

-RRB-

oe

A

-LRB-

x

-RRB-

-RRB-

-LRB-

A

-LRB-

-RRB-

oe

A

-LRB-

-RRB-

-RRB-

-LRB-

R

-RRB-

x

-LRB-

A

-LRB-

y

-RRB-

oe

A

-LRB-

x

-RRB-

-RRB-

-LRB-

A

-LRB-

-RRB-

oe

A

-LRB-

-RRB-

-RRB-

-LRB-

R

-RRB-

It

shows

that

x

-LRB-

A

-LRB-

y

-RRB-

oe

A

-LRB-

x

-RRB-

-RRB-

is

provable

in

LK

-LRB-

by

first

applying

R

contract

then

the

above

proof

-RRB-

A

decision

procedure

The

decision

procedure

is

based

on

the

search

for

axioms

Axioms

of

a

proof

of

F

are

pairs

of

atomic

formulas

appearing

positively

and

negatively

in

F

We

define

the

notion

of

path

which

is

a

set

of

such

pairs

satisfying

some

conditions

and

show

how

paths

and

proofs

are

in

correspondence

and

how

proofs

are

built

from

paths

Then

the

decision

procedure

will

consist

in

looking

for

paths

which

appears

to

be

clearly

decidable

Definitions

Let

S

be

a

propositional

sequent

Let

P

be

a

set

of

pairs

of

atomic

subformulas

of

S.

Definition

-LRB-

P

satisfies

A

-RRB-

We

say

that

P

satisfies

a

formula

A

-LRB-

in

symbols

P

A

-RRB-

if

there

is

a

pair

-LRB-

P

P

-RRB-

in

P

such

that

either

P

OE

A

or

P

OE

A.

Definition

-LRB-

A

and

B

connected

-RRB-

For

A

B

OE

S

we

say

that

A

and

B

are

connected

-LRB-

in

symbols

AkPB

-RRB-

if

there

is

a

pair

-LRB-

P

P

-RRB-

in

P

such

that

P

OE

A

and

P

OE

B

-LRB-

or

vice

versa

-RRB-

Definition

-LRB-

conjunctive

cycle

-RRB-

We

say

that

P

has

a

conjunctive

cycle

if

there

exist

distinct

conjunctive

subformulas

of

S

namely

ffi

An

ffi

Bn

-LRB-

n

-RRB-

such

that

ng

BikPAi

indexes

being

considered

modulo

n.

Definition

-LRB-

path

-RRB-

We

say

that

P

is

a

path

for

S

if

it

satisfies

the

following

conditions

-LRB-

a

-RRB-

P

-LRB-

b

-RRB-

Atomic

formulas

in

P

are

all

distinct

-LRB-

c

-RRB-

If

-LRB-

P

P

-RRB-

P

then

P

appears

positively

in

S

and

P

negatively

in

S

-LRB-

d

-RRB-

If

A

ffi

B

is

a

conjunctive

subformula

of

S

and

if

P

A

ffi

B

then

P

A

and

P

B

-LRB-

e

-RRB-

If

A

ffi

B

is

a

conjunctive

subformula

of

S

and

if

P

A

ffi

B

then

A

and

B

are

not

connected

-LRB-

f

-RRB-

There

is

no

conjunctive

cycle

in

P.

The

main

theorem

Let

S

be

a

propositional

sequent

Theorem

For

any

substitution

oe

S

-LSB-

oe

-RSB-

is

provable

in

Direct

Predicate

Calculus

if

and

only

if

there

is

a

path

P

for

S

minimal

for

inclusion

such

that

-LRB-

P

P

-RRB-

P

P

-LSB-

oe

-RSB-

ss

P

-LSB-

oe

-RSB-

-LRB-

-RRB-

Examples

ffl

If

S

oe

-LRB-

oe

-RRB-

oe

then

P

-LRB-

-RRB-

-LRB-

-RRB-

is

a

path

for

S

It

corresponds

to

the

proof

-LRB-

Ax

-RRB-

-LRB-

Ax

-RRB-

oe

-LRB-

L?oe

-RRB-

-LRB-

oe

-RRB-

oe

-LRB-

R?oe

-RRB-

oe

-LRB-

oe

-RRB-

oe

-LRB-

R?oe

-RRB-

as

we

will

show

later

ffl

If

S

denotes

the

sequent

-LRB-

a

-RRB-

oe

-LRB-

-LRB-

-LRB-

x

-RRB-

oe

-LRB-

x

-RRB-

-RRB-

-RRB-

oe

-LRB-

y

-RRB-

then

its

skolemized

form

SH

-LRB-

x

y

-RRB-

is

-LRB-

a

-RRB-

oe

-LRB-

-LRB-

x

-RRB-

oe

-LRB-

x

-RRB-

-RRB-

oe

-LRB-

y

-RRB-

and

P

-LRB-

-LRB-

x

-RRB-

-LRB-

a

-RRB-

-RRB-

-LRB-

-LRB-

y

-RRB-

-LRB-

x

-RRB-

-RRB-

is

a

path

for

SH

-LRB-

x

y

-RRB-

satisfying

the

condition

-LRB-

-RRB-

for

the

substitution

oe

x

y

a

a

It

corresponds

to

the

proof

-LRB-

a

-RRB-

-LRB-

a

-RRB-

-LRB-

Ax

-RRB-

-LRB-

a

-RRB-

-LRB-

a

-RRB-

-LRB-

Ax

-RRB-

-LRB-

a

-RRB-

-LRB-

a

-RRB-

oe

-LRB-

a

-RRB-

-LRB-

a

-RRB-

-LRB-

L?oe

-RRB-

-LRB-

a

-RRB-

-LRB-

-LRB-

x

-RRB-

oe

-LRB-

x

-RRB-

-RRB-

-LRB-

a

-RRB-

-LRB-

L

-RRB-

-LRB-

a

-RRB-

-LRB-

-LRB-

x

-RRB-

oe

-LRB-

x

-RRB-

-RRB-

-LRB-

y

-RRB-

-LRB-

R

-RRB-

-LRB-

a

-RRB-

-LRB-

-LRB-

-LRB-

x

-RRB-

oe

-LRB-

x

-RRB-

-RRB-

-RRB-

oe

-LRB-

y

-RRB-

-LRB-

R?oe

-RRB-

-LRB-

a

-RRB-

oe

-LRB-

-LRB-

-LRB-

x

-RRB-

oe

-LRB-

x

-RRB-

-RRB-

-RRB-

oe

-LRB-

y

-RRB-

-LRB-

R?oe

-RRB-

Proof

of

the

theorem

only

if

part

The

only

if

part

is

the

most

intuitive

the

path

corresponds

exactly

to

the

axioms

of

the

derivation

-LRB-

proposition

-RRB-

Definition

-LRB-

path

of

a

derivation

-RRB-

The

path

of

a

derivation

D

-LRB-

in

symbols

P

-LRB-

D

-RRB-

-RRB-

is

defined

as

the

set

of

the

axioms

of

D

that

is

P

-LRB-

D

-RRB-

f

-LRB-

A

B

-RRB-

j

B

A

is

an

axiom

of

D

g

The

notions

of

formulas

satisfied

and

connected

are

extended

to

derivations

through

P

-LRB-

D

-RRB-

Definition

-LRB-

normal

derivation

-RRB-

A

derivation

D

is

said

to

be

normal

if

it

satisfies

the

following

two

conditions

ffl

if

R

is

a

rule

of

D

with

two

premises

of

active

formulas

A

and

B

then

A

and

B

are

satisfied

in

D

ffl

if

R

is

a

rule

of

D

with

one

premise

which

is

not

a

weakening

rule

then

at

least

one

of

the

active

formula

of

R

is

satisfied

in

D.

Proposition

If

S

is

derivable

in

Direct

Predicate

Calculus

then

there

is

a

normal

derivation

of

S

in

Direct

Predicate

Calculus

Proof

Let

D

be

a

derivation

of

S

and

let

us

consider

a

weakening

rule

for

instance

R?W

in

D

A

-LRB-

R?W

-RRB-

-LRB-

X

-RRB-

If

A

is

not

active

in

the

rule

X

then

we

can

exchange

the

application

of

R

W

and

X

Let

us

assume

this

fact

everywhere

in

the

derivation

D.

Then

only

two

cases

can

occur

ffl

The

formula

A

is

active

in

the

inference

X

In

that

case

let

us

assume

that

X

is

a

two

premises

rule

for

instance

R

A

-LRB-

R?W

-RRB-

B

A

B

-LRB-

R

-RRB-

Since

is

a

derivation

of

we

can

simplify

D

in

this

way

A

B

-LRB-

W

-RRB-

where

W

represents

a

sequence

of

weakening

rules

If

X

is

a

one

premise

rule

like

for

instance

A

-LRB-

R?W

-RRB-

A

-LRB-

L

:-RRB-

then

we

can

simplify

D

in

A

-LRB-

L?W

-RRB-

ffl

The

rule

X

is

also

a

weakening

rule

on

a

formula

B

and

A

and

B

are

both

active

in

the

rule

preceding

X

for

instance

R

A

-LRB-

R?W

-RRB-

A

B

-LRB-

R?W

-RRB-

A

B

-LRB-

R

-RRB-

Then

we

can

replace

D

by

the

simplified

derivation

A

B

-LRB-

R?W

-RRB-

Proposition

If

D

is

a

normal

derivation

of

S

then

P

-LRB-

D

-RRB-

is

a

path

for

S

minimal

for

inclusion

Proof

Let

D

be

a

derivation

of

S.

Let

us

show

by

induction

on

the

length

of

D

that

P

-LRB-

D

-RRB-

is

a

path

for

S.

ffl

If

D

is

an

axiom

the

result

is

clear

ffl

If

the

last

rule

of

D

has

one

premise

S

-LRB-

X

-RRB-

then

by

induction

hypothesis

P

-LRB-

-RRB-

is

a

path

for

-LRB-

since

unary

rules

do

not

generate

new

conjunctive

formulas

-RRB-

But

P

-LRB-

D

-RRB-

P

-LRB-

-RRB-

and

since

P

-LRB-

-RRB-

satisfies

the

conditions

-LRB-

a

-LCB-

f

-RRB-

then

P

-LRB-

D

-RRB-

too

ffl

If

the

last

rule

of

D

has

two

premises

for

instance

A

B

A

B

-LRB-

R

-RRB-

the

induction

hypothesis

can

be

applied

to

and

so

P

-LRB-

-RRB-

and

P

-LRB-

-RRB-

are

paths

for

and

respectively

Clearly

P

-LRB-

D

-RRB-

P

-LRB-

-RRB-

-LSB-

P

-LRB-

-RRB-

and

satisfies

-LRB-

a

-LCB-

c

-RRB-

Since

D

is

assumed

to

be

normal

then

P

-LRB-

D

-RRB-

satisfies

-LRB-

d

-RRB-

P

-LRB-

D

-RRB-

is

minimal

because

P

-LRB-

-RRB-

and

P

-LRB-

-RRB-

are

Axioms

of

P

-LRB-

-RRB-

and

P

-LRB-

-RRB-

are

distinct

so

P

-LRB-

D

-RRB-

satisfies

-LRB-

e

-RRB-

It

remains

to

verify

the

condition

-LRB-

f

-RRB-

Since

P

-LRB-

-RRB-

and

P

-LRB-

-RRB-

do

not

contain

any

conjunctive

cycle

by

hypothesis

let

us

consider

a

conjunctive

cycle

of

the

form

F

ffi

C

Yi

A

B

Zi

F

ffi

C

But

A

and

B

can

not

be

connected

-LRB-

condition

-LRB-

e

-RRB-

-RRB-

so

necessarily

all

Yi

must

be

subformulas

of

and

all

Zi

subformulas

of

But

F

ffi

C

can

not

belong

to

both

and

So

P

-LRB-

D

-RRB-

satisfies

-LRB-

f

-RRB-

Proof

of

the

theorem

-LRB-

only

if

part

-RRB-

Let

D

be

a

proof

of

S

-LSB-

oe

-RSB-

From

Proposition

P

-LRB-

D

-RRB-

is

a

path

for

S

-LSB-

oe

-RSB-

so

also

for

S.

And

the

condition

-LRB-

-RRB-

is

clearly

satisfied

since

axioms

are

of

the

form

A

-LRB-

u

-RRB-

B

-LRB-

u

-RRB-

-LRB-

Ax

-RRB-

with

-LRB-

B

A

-RRB-

P

-LRB-

D

-RRB-

Proof

of

the

theorem

if

part

The

if

part

of

the

theorem

is

more

subtle

Given

a

path

for

a

sequent

we

must

re-construct

a

proof

of

this

sequent

We

prove

it

by

induction

on

the

sum

of

the

sizes

of

the

sequent

and

the

path

and

it

gives

us

an

algorithm

for

the

decision

procedure

The

main

difficulty

appears

when

the

sequent

contains

only

conjunctive

formulas

so

that

we

have

to

choose

one

of

them

to

apply

the

corresponding

rule

We

first

establish

some

preliminaries

to

solve

this

critical

point

Preliminaries

Let

S

be

a

sequent

and

P

a

path

for

S.

Let

C

be

the

set

of

pairs

-LRB-

Ai

Bi

-RRB-

such

that

Ai

ffi

Bi

or

Bi

ffi

Ai

is

a

conjunctive

subformula

of

S

We

define

the

oriented

graph

G

-LRB-

V

E

-RRB-

by

ffl

V

C

ffl

-LRB-

-LRB-

A

B

-RRB-

-LRB-

C

D

-RRB-

-RRB-

E

if

and

only

if

-LRB-

P

P

-RRB-

P

with

P

OE

B

and

P

OE

C

-LRB-

i.e.

-RRB-

B

and

C

are

connected

If

x

-LRB-

A

B

-RRB-

is

an

vertex

of

G

we

denote

x

the

vertex

-LRB-

B

A

-RRB-

We

write

x

y

if

-LRB-

x

y

-RRB-

E

We

denote

the

transitive

closure

of

and

its

reflexive

transitive

closure

If

we

have

x

y

we

say

that

we

have

a

path

from

x

to

y

If

cn

is

a

path

we

say

that

it

is

pure

if

i

j

=-RRB-

ci

cj

ci

cj

We

write

x

p

y

in

that

case

When

y

x

or

y

x

we

still

say

that

the

path

from

x

to

y

is

pure

if

it

is

of

the

form

x

p

z

y

Then

we

allow

to

write

x

p

x

or

x

p

x

We

call

cycle

every

pure

path

x

p

x

and

loop

every

pure

path

x

p

x

The

main

property

of

this

graph

is

the

following

Proposition

P

has

a

conjunctive

cycle

if

and

only

if

G

has

a

cycle

Proof

Let

ffi

ffi

An

ffi

Bn

be

a

conjunctive

cycle

of

P

Then

it

is

clear

that

-LRB-

-RRB-

-LRB-

-RRB-

-LRB-

An

Bn

-RRB-

-LRB-

-RRB-

is

a

cycle

of

G.

On

the

opposite

if

-LRB-

-RRB-

-LRB-

-RRB-

-LRB-

An

Bn

-RRB-

-LRB-

-RRB-

is

a

cycle

of

G

then

we

have

i

j

=-RRB-

Ai

ffi

Bi

Aj

ffi

Bj

and

so

ffi

ffi

An

ffi

Bn

is

a

conjunctive

cycle

of

P.

Remarks

If

-LRB-

x

y

-RRB-

E

then

-LRB-

y

x

-RRB-

E

by

definition

of

E.

Consequently

if

we

have

a

path

from

u

to

v

then

we

have

a

path

from

v

to

u

-LRB-

more

exactly

if

we

have

the

path

cn

we

also

have

the

path

cn

-RRB-

If

the

path

y

p

z

p

z

is

not

pure

then

there

exists

a

cycle

in

G.

Indeed

if

y

p

z

p

z

is

not

pure

let

us

consider

the

smallest

suffix

of

this

path

w

p

z

p

z

which

is

not

pure

Two

cases

arise

ffl

either

y

w

z

w

z

with

w

z

w

pure

so

we

have

a

cycle

ffl

or

y

w

z

w

z

with

w

z

w

pure

We

have

w

p

z

so

by

the

previous

remark

we

have

z

p

w

so

z

p

w

p

z

If

this

path

were

not

pure

it

would

contradict

the

minimality

of

w

So

we

have

a

cycle

z

p

z

We

define

on

V

the

relation

o

by

x

y

def

-LRB-

-RRB-

x

p

z

y

z

where

z

y

z

is

pure

and

x

o

y

def

-LRB-

-RRB-

x

y

-LRB-

y

x

-RRB-

Lemma

If

G

has

no

cycle

then

o

is

a

strict

partial

order

Proof

The

relation

o

is

anti-reflexive

by

definition

To

show

the

transitivity

of

o

notice

that

is

sufficient

to

show

that

x

y

y

o

z

=-RRB-

x

z

Indeed

assume

that

this

fact

is

true

If

x

o

y

and

y

o

z

then

clearly

x

z

If

we

had

also

z

x

then

because

x

o

y

we

would

have

by

the

same

result

z

y

which

is

not

So

assume

that

x

y

and

y

o

z

and

let

us

show

x

z

We

have

the

paths

x

p

u

y

u

-LCB-

z

-RCB-

pure

and

y

p

v

z

v

-LCB-

z

-RCB-

pure

From

remark

those

two

paths

are

necessarily

pure

So

we

have

x

p

y

p

v

z

v

-LCB-

z

-RCB-

pure

and

we

aim

at

proving

x

z.

Suppose

x

p

y

p

v

is

not

pure

and

let

w

p

y

p

v

be

the

smallest

suffix

of

this

path

which

is

not

pure

Two

cases

arise

ffl

either

we

have

w

p

y

p

w

p

v

and

we

have

a

cycle

contradiction

ffl

or

we

have

w

p

t

p

w

p

v

z

v.

we

have

w

p

v

so

v

p

w

-LRB-

Remark

-RRB-

so

z

v

p

w

which

is

a

pure

path

because

w

p

v

z

v

is

So

we

have

z

p

w

y

w

with

w

y

w

pure

that

is

z

y

which

can

not

be

seen

y

o

z

In

the

end

we

have

the

path

x

p

v

z

v

-LCB-

z

-RCB-

pure

that

is

x

z.

Lemma

If

G

has

no

cycle

and

if

there

is

an

infinite

path

xn

with

xi

xi

then

the

relation

o

has

a

minimal

element

Proof

Since

G

has

no

cycle

o

is

a

strict

partial

order

from

the

previous

lemma

Therefore

seen

that

V

is

finite

o

has

a

minimal

element

if

and

only

if

o

is

not

empty

Let

xn

be

an

infinite

path

in

G

with

xi

xi

Let

xk

the

longest

pure

prefix

of

this

path

Two

cases

arise

ffl

either

we

have

xi

xk

p

xk

then

we

have

a

cycle

which

can

not

be

ffl

or

we

have

xi

xk

p

xk

and

then

o

xi

Proof

of

the

theorem

-LRB-

if

part

-RRB-

Let

P

be

a

path

for

S

-LSB-

oe

-RSB-

for

oe

a

substitution

such

that

the

condition

-LRB-

-RRB-

is

satisfied

Notice

that

P

is

also

a

path

for

S

The

condition

-LRB-

-RRB-

only

ensures

that

pairs

in

P

could

be

considered

as

axioms

in

the

following

So

we

wo

n't

mention

oe

anymore

to

clarify

the

proof

Let

us

show

by

induction

on

the

integer

t

w

that

P

corresponds

to

a

proof

of

S

where

t

is

the

size

of

S

-LRB-

the

number

of

symbols

-RRB-

and

w

the

number

of

atomic

subformulas

of

S

not

satisfied

in

P.

ffl

If

S

has

the

shape

P

P

with

-LRB-

P

P

-RRB-

P

then

we

can

apply

the

rule

Axiom

possibly

preceded

by

weakenings

ffl

If

S

has

the

shape

F

-LRB-

or

F

-RRB-

with

F

not

satisfied

in

P

then

the

induction

hypothesis

applies

to

and

we

use

the

weakening

rule

ffl

If

S

contains

a

disjunctive

formula

for

instance

S

then

the

induction

hypothesis

applies

to

A

B

for

the

same

path

P

and

we

get

a

derivation

of

S

by

R

Likewise

if

S

contains

a

negation

ffl

Otherwise

the

formulas

of

S

can

be

split

into

two

sets

and

where

is

a

set

of

atoms

-LRB-

atomic

formulas

-RRB-

and

a

nonempty

set

of

satisfied

conjunctive

formulas

Then

we

look

for

a

conjunctive

formulas

of

-LRB-

for

instance

-RRB-

on

which

we

can

apply

the

corresponding

rule

-LRB-

here

R

-RRB-

that

is

for

which

we

can

split

S

into

two

sequents

containing

and

and

find

two

paths

for

these

sequents

to

apply

the

induction

hypothesis

We

can

distinguish

two

cases

-LCB-

There

exists

a

conjunctive

formula

of

for

instance

such

that

is

connected

only

to

atoms

-LRB-

i.e.

-RRB-

if

-LRB-

P

P

-RRB-

P

and

P

OE

-LRB-

resp

P

OE

-RRB-

then

P

-LRB-

resp

P

-RRB-

Then

let

and

be

the

two

sequents

defined

by

-LSB-

and

-LRB-

-RRB-

-LSB-

-LSB-

where

f

P

j

g

and

n

We

restrict

the

path

P

to

and

by

Pi

f

-LRB-

P

P

-RRB-

P

j

P

OE

Si

g

Let

us

show

that

Pi

is

a

path

for

Si

Pi

satisfies

-LRB-

a

-RRB-

because

P

satisfies

-LRB-

d

-RRB-

so

P

and

P

Pi

satisfies

-LRB-

b

-LCB-

e

-RRB-

because

P

satisfies

-LRB-

b

-LCB-

e

-RRB-

Pi

satisfies

-LRB-

f

-RRB-

because

a

conjunctive

cycle

of

Pi

would

be

a

conjunctive

cycle

of

P

At

last

Pi

is

minimal

because

P

is

-LRB-

if

for

instance

ae

would

be

a

path

for

then

-LSB-

would

be

a

path

for

S

smaller

than

P

-RRB-

So

we

can

apply

the

induction

hypothesis

to

-LRB-

-RRB-

and

-LRB-

-RRB-

we

get

a

derivation

of

and

a

derivation

of

and

a

derivation

of

S

by

R

-LCB-

In

the

other

case

every

conjunctive

formula

of

is

connected

to

another

conjunctive

formula

of

From

the

lemma

there

exists

an

element

of

minimal

for

o.

Assume

that

and

let

i

fY

j

there

is

a

chain

from

Ai

to

Y

g

Since

there

is

no

cycle

and

is

minimal

for

o

we

have

Let

i

f

P

j

PkP?i

-LSB-

fAig

g.

P

satisfies

-LRB-

b

-RRB-

so

Suppose

there

exists

C

in

such

that

C

i

for

i

Then

let

f

-LRB-

P

P

-RRB-

P

j

P

OE

C

or

P

OE

C

g.

S

is

satisfied

so

Moreover

Pi

for

i

otherwise

C

would

be

connected

to

or

Then

it

's

clear

that

is

a

path

for

S

which

contradict

the

minimality

of

P.

Likewise

suppose

there

exists

P

such

that

P

i

for

i

The

rule

Axiom

has

not

been

applied

so

P

is

connected

to

a

conjunctive

formula

C

of

C

can

not

be

by

hypothesis

But

from

the

previous

remark

such

a

formula

C

must

belong

to

or

which

is

a

contradiction

So

we

have

-LSB-

-LSB-

and

-LSB-

Then

let

Si

i

-LSB-

i

-LSB-

fAig

and

Pi

f

-LRB-

P

P

-RRB-

P

j

P

or

P

appears

in

Si

g

It

's

clear

that

Pi

satisfies

-LRB-

b

-LCB-

f

-RRB-

since

P

satisfies

these

conditions

Moreover

Pi

is

minimal

because

P

is

At

last

P

satisfies

-LRB-

d

-RRB-

and

P

so

P

and

P

and

so

Pi

satisfies

-LRB-

a

-RRB-

So

we

can

apply

the

induction

hypothesis

to

-LRB-

Si

Pi

-RRB-

and

get

a

proof

of

and

then

a

proof

of

S

by

R

Skolemization

Definition

-LRB-

Herbrand

term

-RRB-

Let

F

be

a

formula

of

L

and

Qx

A

an

essentially

universal

subformula

of

F

which

lies

in

the

scope

of

essentially

existential

quantifiers

Qnxn

of

F

The

Herbrand

term

associated

with

Qx

is

fx

-LRB-

xn

-RRB-

where

fx

is

a

new

symbol

of

function

fx

is

called

the

Herbrand

function

associated

with

Qx

Definition

-LRB-

Herbrand

form

-RRB-

Let

F

be

a

formula

of

L

The

Herbrand

form

FH

-LRB-

xn

-RRB-

of

F

is

the

result

of

erasing

all

quantifiers

of

F

and

replacing

each

essentially

universal

variable

with

the

corresponding

Herbrand

term

Here

xn

are

all

the

essentially

existential

variables

in

F

In

the

following

we

will

consider

free

variables

as

-LRB-

implicitly

-RRB-

universally

quantified

It

is

the

same

as

considering

free

variables

as

constants

-LRB-

since

a

free

variable

do

not

lie

in

the

scope

of

any

existential

variable

so

it

is

replaced

by

a

new

function

symbol

with

no

argument

that

is

a

new

constant

symbol

-RRB-

Examples

ffl

If

F

:P

-LRB-

y

-RRB-

oe

:P

-LRB-

x

-RRB-

we

have

FH

-LRB-

y

-RRB-

P

-LRB-

y

-RRB-

oe

P

-LRB-

fx

-RRB-

ffl

If

F

A

-LRB-

y

-RRB-

B

oe

-LRB-

A

-LRB-

x

-RRB-

B

-RRB-

we

have

FH

-LRB-

x

-RRB-

A

-LRB-

fy

-RRB-

B

oe

A

-LRB-

x

-RRB-

B

ffl

If

F

x

-LRB-

P

-LRB-

y

-RRB-

oe

P

-LRB-

x

-RRB-

-RRB-

we

have

FH

-LRB-

y

-RRB-

P

-LRB-

y

-RRB-

oe

P

-LRB-

fx

-LRB-

y

-RRB-

-RRB-

ffl

If

F

y

-LRB-

A

-LRB-

x

y

-RRB-

oe

B

-LRB-

x

-RRB-

-RRB-

oe

-LRB-

A

-LRB-

u

z

-RRB-

oe

B

-LRB-

t

-RRB-

-RRB-

we

have

FH

-LRB-

x

t

z

-RRB-

-LRB-

A

-LRB-

x

fy

-LRB-

x

-RRB-

-RRB-

oe

B

-LRB-

x

-RRB-

-RRB-

oe

-LRB-

A

-LRB-

u

z

-RRB-

oe

B

-LRB-

t

-RRB-

-RRB-

The

interest

of

Herbrand

form

lies

in

the

following

result

Theorem

-LRB-

Skolem-Herbrand

-RRB-

Let

F

be

a

prenex

formula

Then

F

is

provable

in

DPC

if

and

only

if

there

exist

terms

tn

such

that

FH

-LRB-

tn

-RRB-

is

provable

in

DPC

-LRB-

more

exactly

in

Direct

Propositional

Calculus

that

is

without

the

rules

R

R

L

and

L

-RRB-

Remark

Before

giving

the

proof

of

this

theorem

let

us

notice

that

the

result

is

no

longer

true

for

nonprenex

formulas

For

instance

let

F

be

the

formula

A

-LRB-

y

-RRB-

B

oe

-LRB-

A

-LRB-

x

-RRB-

B

-RRB-

Its

Herbrand

form

is

FH

-LRB-

x

-RRB-

A

-LRB-

fy

-RRB-

B

oe

A

-LRB-

x

-RRB-

B

and

there

exists

a

term

t

fy

such

that

FH

-LRB-

t

-RRB-

is

provable

in

DPC

But

F

is

not

provable

in

DPC

Indeed

the

only

rule

that

we

can

apply

to

the

sequent

F

is

R

oe

and

then

we

must

prove

the

sequent

A

-LRB-

y

-RRB-

B

-LRB-

A

-LRB-

x

-RRB-

B

-RRB-

Two

rules

can

be

applied

a

priori

R

and

L

The

second

one

leads

to

a

sequent

of

the

form

A

-LRB-

y

-RRB-

or

B

which

is

not

provable

so

the

first

one

remains

So

we

look

for

a

term

t

and

a

proof

of

A

-LRB-

y

-RRB-

B

A

-LRB-

t

-RRB-

B.

Likewise

we

must

apply

here

R

which

leads

to

A

-LRB-

y

-RRB-

B

A

-LRB-

t

-RRB-

B

At

last

only

the

rule

L

can

be

applied

and

leads

to

A

-LRB-

y

-RRB-

A

-LRB-

t

-RRB-

which

is

not

provable

since

t

is

a

term

which

does

not

contain

y

-LRB-

y

is

a

bound

variable

when

we

introduce

t

with

R

-RRB-

However

notice

that

F

is

provable

in

LK

A

-LRB-

y

-RRB-

A

-LRB-

y

-RRB-

-LRB-

Ax

-RRB-

A

-LRB-

y

-RRB-

A

-LRB-

y

-RRB-

B

-LRB-

R?W

-RRB-

A

-LRB-

y

-RRB-

A

-LRB-

y

-RRB-

B

-LRB-

R

-RRB-

A

-LRB-

y

-RRB-

-LRB-

A

-LRB-

x

-RRB-

B

-RRB-

-LRB-

R

-RRB-

A

-LRB-

y

-RRB-

-LRB-

A

-LRB-

x

-RRB-

B

-RRB-

-LRB-

L

-RRB-

B

B

-LRB-

Ax

-RRB-

B

A

-LRB-

x

-RRB-

B

-LRB-

R?W

-RRB-

B

A

-LRB-

x

-RRB-

B

-LRB-

R

-RRB-

B

-LRB-

A

-LRB-

x

-RRB-

B

-RRB-

-LRB-

R

-RRB-

A

-LRB-

y

-RRB-

B

-LRB-

A

-LRB-

x

-RRB-

B

-RRB-

-LRB-

A

-LRB-

x

-RRB-

B

-RRB-

-LRB-

L

-RRB-

A

-LRB-

y

-RRB-

B

-LRB-

A

-LRB-

x

-RRB-

B

-RRB-

-LRB-

R?contract

-RRB-

A

-LRB-

y

-RRB-

B

oe

-LRB-

A

-LRB-

x

-RRB-

B

-RRB-

-LRB-

R?oe

-RRB-

Lemma

Let

F

be

a

formula

oe

a

substitution

and

t

a

term

Let

-LRB-

fu

-RRB-

be

function

symbols

appearing

in

F

and

-LRB-

f

u

-RRB-

new

function

symbols

such

that

for

all

u

of

U

we

have

ar

-LRB-

f

u

-RRB-

ar

-LRB-

fu

-RRB-

F

-LSB-

oe

-RSB-

is

provable

in

DPC

if

and

only

if

F

-LSB-

fu

f

u

-LRB-

t

-RRB-

-RSB-

-LSB-

oe

-RSB-

is

provable

in

DPC

Proof

F

-LSB-

fu

f

u

-LRB-

t

-RRB-

-RSB-

-LSB-

oe

-RSB-

is

equal

to

F

-LSB-

oe

-RSB-

-LSB-

fu

f

u

-LRB-

oe

-LRB-

t

-RRB-

-RRB-

-RSB-

so

it

's

sufficient

to

show

that

if

t

is

a

term

them

F

is

provable

if

and

only

if

F

-LSB-

fu

f

u

-LRB-

t

-RRB-

-RSB-

is

provable

The

proof

is

by

induction

on

the

length

of

the

derivation

showing

the

more

general

result

for

all

sequent

S

S

is

derivable

if

and

only

if

S

-LSB-

fu

f

u

-LRB-

t

-RRB-

-RSB-

is

derivable

The

reader

will

easily

convinced

himself

of

this

result

Notice

that

the

derivation

of

F

-LSB-

fu

f

u

-LRB-

t

-RRB-

-RSB-

is

the

derivation

of

F

in

which

we

apply

everywhere

the

substitution

-LSB-

fu

f

u

-LRB-

t

-RRB-

-RSB-

Lemma

Let

F

be

a

formula

x

a

free

variable

in

F

oe

a

substitution

such

that

oe

-LRB-

x

-RRB-

x

and

fx

a

function

symbol

which

does

not

occur

in

F

F

-LSB-

oe

-RSB-

is

provable

in

DPC

if

and

only

if

F

-LSB-

x

fx

-RSB-

-LSB-

oe

-RSB-

is

provable

in

DPC

Proof

The

proof

is

also

by

induction

on

the

length

of

the

derivation

to

show

that

for

every

sequent

S

such

that

x

is

free

in

S

and

fx

does

not

occur

in

S

S

-LSB-

oe

-RSB-

is

derivable

if

and

only

if

S

-LSB-

x

fx

-RSB-

-LSB-

oe

-RSB-

is

The

proof

is

trivial

since

we

notice

that

the

rules

R

L

R

and

L

can

not

be

applied

on

the

variable

x

-LRB-

because

we

assumed

that

x

is

free

in

S

and

it

's

always

possible

to

rename

the

bound

variables

of

S

with

names

other

than

x

-RRB-

Notice

that

the

derivation

of

F

-LSB-

x

fx

-RSB-

-LSB-

oe

-RSB-

is

the

derivation

of

F

-LSB-

oe

-RSB-

in

which

we

apply

everywhere

the

substitution

-LSB-

x

fx

-RSB-

Proposition

Let

F

be

a

prenex

formula

and

oe

a

substitution

If

FH

-LSB-

oe

-RSB-

is

provable

in

DPC

then

F

-LSB-

oe

-RSB-

is

provable

in

DPC

Proof

The

proof

is

by

induction

on

the

number

of

quantifiers

of

F

ffl

If

F

has

no

quantifier

then

F

FH

and

the

proposition

is

obvious

ffl

If

F

F

then

FH

F

H

-LSB-

fu

fu

-LRB-

x

-RRB-

-RSB-

for

every

essentially

universal

variable

u

in

F

-LRB-

We

write

fu

for

the

two

function

symbols

even

if

they

are

actually

different

symbols

-RRB-

By

hypothesis

FH

-LSB-

oe

-RSB-

-LRB-

i.e.

-RRB-

F

H

-LSB-

fu

fu

-LRB-

x

-RRB-

-RSB-

-LSB-

oe

-RSB-

is

provable

So

from

lemma

F

H

-LSB-

oe

-RSB-

is

provable

But

F

has

one

quantifier

less

than

F

so

the

induction

hypothesis

applies

to

F

and

F

-LSB-

oe

-RSB-

is

provable

-LRB-

i.e.

-RRB-

we

have

a

derivation

D

F

-LSB-

oe

-RSB-

and

so

there

is

a

derivation

of

F

-LSB-

oe

-RSB-

D

F

-LSB-

oe

-RSB-

-LRB-

F

-RRB-

-LSB-

oe

-RSB-

-LRB-

R

-RRB-

ffl

If

F

F

then

FH

F

H

-LSB-

x

fx

-RSB-

By

hypothesis

FH

-LSB-

oe

-RSB-

-LRB-

i.e.

-RRB-

F

H

-LSB-

x

fx

-RSB-

-LSB-

oe

-RSB-

is

provable

so

F

H

-LSB-

oenx

-RSB-

-LSB-

x

fx

-RSB-

is

provable

So

from

lemma

F

H

-LSB-

oenx

-RSB-

is

provable

and

the

induction

hypothesis

applies

to

F

F

-LSB-

oenx

-RSB-

is

provable

-LRB-

i.e.

-RRB-

we

have

a

derivation

D

F

-LSB-

oenx

-RSB-

from

which

we

get

D

F

-LSB-

oenx

-RSB-

-LRB-

F

-RRB-

-LSB-

oe

-RSB-

-LRB-

R

-RRB-

Proposition

Let

F

be

a

prenex

formula

If

F

is

provable

in

DPC

then

there

exist

a

substitution

oe

such

that

FH

-LSB-

oe

-RSB-

is

provable

in

DPC

Proof

The

proof

is

by

induction

on

the

number

of

quantifiers

of

F

ffl

If

F

has

no

quantifier

then

F

FH

and

the

result

is

obvious

ffl

If

F

F

then

FH

F

H

-LSB-

fu

fu

-LRB-

x

-RRB-

-RSB-

for

every

essentially

universal

variable

u

in

F

By

hypothesis

F

is

provable

so

there

exist

a

term

t

such

that

we

have

the

derivation

D

F

-LSB-

x

t

-RSB-

F

-LRB-

R

-RRB-

F

-LSB-

x

t

-RSB-

is

derivable

and

by

induction

hypothesis

there

exist

a

substitution

oe

such

that

-LRB-

F

-LSB-

x

t

-RSB-

-RRB-

H

-LSB-

oe

-RSB-

is

provable

But

-LRB-

F

-LSB-

x

t

-RSB-

-RRB-

H

F

H

-LSB-

x

t

-RSB-

so

F

H

-LSB-

x

t

-RSB-

-LSB-

oe

-RSB-

is

provable

and

from

lemma

F

H

-LSB-

fu

fu

-LRB-

x

-RRB-

-RSB-

-LSB-

x

t

-RSB-

-LSB-

oe

-RSB-

is

provable

-LRB-

i.e.

-RRB-

FH

-LSB-

-RSB-

is

provable

where

is

the

substitution

defined

by

-LRB-

x

-RRB-

t

and

-LRB-

y

-RRB-

oe

-LRB-

y

-RRB-

if

y

x.

ffl

If

F

F

then

FH

F

H

-LSB-

x

fx

-RSB-

By

hypothesis

F

is

provable

so

we

have

a

derivation

D

F

F

-LRB-

R

-RRB-

Induction

hypothesis

applies

to

F

and

so

there

exist

a

substitution

oe

such

that

F

H

-LSB-

oe

-RSB-

is

provable

So

from

lemma

F

H

-LSB-

x

fx

-RSB-

-LSB-

oe

-RSB-

is

provable

-LRB-

i.e.

-RRB-

FH

-LSB-

oe

-RSB-

is

provable

Proof

of

the

theorem

Let

F

be

a

prenex

formula

and

FH

-LRB-

xn

-RRB-

its

Herbrand

form

ffl

If

F

is

provable

in

DPC

then

from

proposition

there

exist

a

substitution

oe

such

that

FH

-LSB-

oe

-RSB-

is

provable

-LRB-

i.e.

-RRB-

FH

-LRB-

oe

-LRB-

-RRB-

oe

-LRB-

xn

-RRB-

-RRB-

is

provable

ffl

Conversely

assume

that

there

exist

terms

tn

such

that

FH

-LRB-

tn

-RRB-

is

provable

in

DPC

Let

oe

be

the

substitution

-LRB-

xi

ti

-RRB-

i

n.

FH

-LSB-

oe

-RSB-

is

provable

so

from

proposition

F

-LSB-

oe

-RSB-

is

provable

and

F

-LSB-

oe

-RSB-

F

The

decision

procedure

Let

F

Qnxn

G

be

a

prenex

formula

where

G

has

no

quantifier

We

are

going

to

apply

the

previous

theorem

to

find

derivations

of

F

Let

FH

-LRB-

xip

-RRB-

be

the

Herbrand

form

of

F

Let

A

-LRB-

resp

A

-RRB-

be

the

set

of

positive

-LRB-

resp

negative

-RRB-

atomic

subformulas

of

FH

First

we

consider

the

set

M

-LRB-

P

P

u

-RRB-

j

P

A

P

A

P

-LSB-

u

-RSB-

ss

P

-LSB-

u

-RSB-

where

u

is

a

principal

solution

of

the

unification

problem

P

ss

P

First-order

unification

is

decidable

and

has

pseudo-linear

solutions

-LRB-

see

for

instance

-LSB-

-RSB-

-RRB-

Then

we

consider

nonempty

subsets

P

of

M

satisfying

conditions

-LRB-

b

-RRB-

and

-LRB-

d

-RRB-

and

such

that

the

substitution

oe

-LRB-

P

;P

u

-RRB-

u

exists

therefore

conditions

-LRB-

a

-LCB-

d

-RRB-

and

-LRB-

-RRB-

are

already

satisfied

See

-LSB-

-RSB-

for

an

efficient

algorithm

to

find

such

subsets

Then

we

keep

the

subsets

who

also

satisfied

the

last

conditions

-LRB-

e

-RRB-

and

-LRB-

f

-RRB-

If

P

is

such

a

subset

-LRB-

actually

a

path

-RRB-

and

oe

the

above

substitution

the

proof

of

the

theorem

gives

a

way

to

construct

a

derivation

D

of

FH

-LSB-

oe

-RSB-

By

replacing

the

Herbrand

functions

fu

by

the

corresponding

variable

u

in

oe

we

get

a

substitution

and

by

doing

the

same

replacement

in

D

we

get

a

derivation

of

G

-LSB-

-RSB-

Then

G

-LSB-

-RSB-

Qnxn

G

-LSB-

-RSB-

-LRB-

R?Qn

-RRB-

Qnxn

G

-LSB-

-LRB-

-RRB-

-RSB-

Qnxn

G

-LRB-

-RRB-

is

a

derivation

of

F

Extensions

In

the

case

of

prenex

formulas

the

skolemization

expresses

the

relative

order

of

the

quantifiers

so

that

unification

respects

the

eigenvariable

condition

The

basic

idea

is

the

following

if

F

is

the

formula

y

:P

-LRB-

x

y

-RRB-

its

Herbrand

form

is

P

-LRB-

x

fy

-LRB-

x

-RRB-

-RRB-

Then

unification

can

not

lead

to

a

term

containing

fy

to

substitute

to

x

-LRB-

we

would

have

an

occur-check

-RRB-

As

a

consequence

the

term

substituted

to

x

does

not

contain

the

variable

y

which

is

the

correct

condition

But

unfortunately

in

the

case

of

non-prenex

formulas

the

skolemization

is

not

powerful

enough

For

instance

we

saw

that

the

formula

A

-LRB-

y

-RRB-

B

oe

-LRB-

A

-LRB-

x

-RRB-

B

-RRB-

has

the

Herbrand

form

FH

-LRB-

x

-RRB-

A

-LRB-

fy

-RRB-

B

oe

A

-LRB-

x

-RRB-

B

which

is

provable

for

the

substitution

oe

h

xfy

i

But

the

dependency

of

oe

-LRB-

x

-RRB-

over

y

-LRB-

fy

-RRB-

implies

that

L

must

be

applied

before

R

in

the

proof

which

is

not

possible

without

contraction

as

we

have

already

seen

So

skolemization

gives

a

necessary

condition

on

oe

but

not

a

sufficient

one

The

idea

for

extending

the

decision

procedure

in

the

case

of

non-prenex

formulas

is

the

following

we

keep

skolemization

and

the

search

for

paths

for

the

Herbrand

form

satisfying

the

condition

-LRB-

-RRB-

and

we

try

to

reconstruct

derivations

from

paths

like

we

did

in

the

prenex

case

But

now

this

step

can

lead

to

a

failure

the

path

does

not

necessarily

correspond

to

a

derivation

But

we

keep

the

completeness

of

the

method

if

a

formula

is

provable

in

DPC

then

there

is

at

least

one

path

for

it

on

which

the

algorithm

is

successful

Of

course

such

reconstructed

proofs

from

paths

have

a

certain

shape

depending

on

the

choices

we

made

when

applying

the

rules

But

all

the

proofs

we

can

construct

from

a

given

path

are

all

the

same

in

a

sense

we

are

going

to

define

below

Moreover

we

can

direct

the

construction

to

bring

out

intuitionnistic

proofs

when

they

exist

We

prove

the

existence

and

the

completeness

of

such

a

construction

that

is

if

a

formula

is

provable

in

intuitionnistic

DPC

then

there

is

at

least

one

path

for

it

on

which

the

algorithm

successfully

returns

an

intuitionnistic

proof

of

it

Canonical

proofs

Definition

-LRB-

potential

quantifier

-RRB-

Let

S

be

a

sequent

and

Qmxm

Fm

its

quantified

subformulas

xn

being

the

essentially

existential

variables

Let

D

be

a

derivation

of

S

and

oe

the

substitution

of

existential

variables

in

D

We

define

the

relation

on

fQigi

m

with

Qi

Qj

def

-LRB-

-RRB-

-LRB-

-LRB-

Qjxj

Fj

Fi

-RRB-

-LRB-

j

ng

xi

oe

-LRB-

xj

-RRB-

-RRB-

-RRB-

A

quantified

formula

Qx

F

of

S

is

said

to

be

potential

if

Q

is

minimal

for

It

just

means

that

the

corresponding

rule

can

be

applied

on

Qx

F

and

we

have

the

fact

Proposition

Let

D

be

a

derivation

of

S

and

Q

two

quantifiers

appearing

in

D

If

Q

then

Q

is

introduced

before

in

D

-LRB-

that

means

below

in

the

bottom-up

representation

we

chose

in

this

paper

-RRB-

Definition

-LRB-

potential

conjunction

-RRB-

Let

S

be

a

sequent

and

D

a

derivation

of

S

A

conjunctive

formula

A

ffi

B

of

S

is

said

to

be

potential

if

the

corresponding

rule

can

be

applied

on

A

ffi

B

keeping

the

same

path

P

-LRB-

D

-RRB-

for

the

resulting

proof

-LRB-

That

is

if

S

can

be

split

into

-LSB-

-LSB-

A

ffi

B

and

P

-LRB-

D

-RRB-

into

and

such

that

is

a

path

for

-LSB-

A

and

for

-LSB-

B

-RRB-

We

define

the

notion

of

canonical

derivation

by

induction

on

a

derivation

Definition

-LRB-

canonical

proof

-RRB-

A

derivation

D

of

a

sequent

S

is

said

to

be

canonical

if

ffl

either

D

is

an

axiom

ffl

or

D

is

of

the

form

-LRB-

R

-RRB-

or

-LRB-

R

-RRB-

with

and

canonical

and

-LCB-

If

a

formula

of

S

is

not

satisfied

in

D

then

R

is

a

weakening

rule

-LCB-

or

else

if

S

contains

a

potential

quantification

then

R

is

a

quantification

rule

-LCB-

or

else

if

contains

a

negation

then

R

R

-LCB-

or

else

if

S

contains

a

disjunction

then

R

is

a

disjunctive

rule

-LCB-

or

else

if

contains

a

potential

conjunction

then

R

R

-LCB-

or

else

if

contains

a

potential

conjunction

then

R

is

a

conjunctive

rule

-LCB-

or

else

if

contains

a

negation

then

R

L

This

choice

may

seem

arbitrary

and

we

could

have

chosen

another

but

it

will

be

justified

by

proposition

Definition

-LRB-

equivalent

derivations

-RRB-

Two

derivations

and

are

said

equivalent

if

P

-LRB-

-RRB-

P

-LRB-

-RRB-

-LRB-

i.e.

-RRB-

if

they

have

the

same

axioms

The

main

result

is

the

following

Proposition

Every

derivation

D

is

equivalent

to

a

canonical

derivation

D.

Proof

The

proof

is

by

induction

on

the

derivation

D

-LRB-

of

S

-RRB-

If

D

is

an

axiom

then

the

result

is

clear

with

D

D.

Otherwise

D

is

either

-LRB-

R

-RRB-

or

-LRB-

R

-RRB-

Then

we

reason

by

case

following

the

definition

of

a

canonical

derivation

-LRB-

a

-RRB-

If

a

formula

F

of

S

is

not

satisfied

in

D

Lemma

If

F

is

not

satisfied

in

a

derivation

D

of

S

F

then

there

is

an

equivalent

derivation

of

S

smaller

than

D.

Proof

The

proof

is

by

induction

on

the

length

of

D.

D

can

not

be

an

axiom

If

the

last

rule

of

D

is

a

weakening

on

F

then

the

result

is

clear

Otherwise

D

has

the

form

F

S

F

-LRB-

R

-RRB-

and

by

induction

hypothesis

there

is

an

equivalent

derivation

of

smaller

than

so

there

is

an

equivalent

derivation

of

S

by

R

smaller

than

D.

From

the

lemma

above

there

is

a

derivation

of

SnF

smaller

than

D

and

by

induction

hypothesis

there

is

an

equivalent

canonical

derivation

of

SnF

and

so

by

a

weakening

on

F

there

is

a

canonical

derivation

of

S

equivalent

to

D.

-LRB-

b

-RRB-

or

else

if

S

contains

a

potential

quantification

Qx

F

-LRB-

x

-RRB-

Lemma

If

D

is

a

derivation

of

:P

-LRB-

x

-RRB-

then

the

derivation

D

in

which

we

have

removed

the

rule

R

corresponding

to

:P

-LRB-

x

-RRB-

and

replaced

every

occurrence

of

:P

-LRB-

x

-RRB-

by

P

-LRB-

x

-RRB-

is

a

derivation

of

P

-LRB-

x

-RRB-

-LRB-

Likewise

for

:P

-LRB-

x

-RRB-

-RRB-

Proof

The

proof

is

an

easy

induction

on

the

derivation

D

as

above

Lemma

If

D

is

a

derivation

of

:P

-LRB-

x

-RRB-

where

:P

-LRB-

x

-RRB-

is

a

potential

quantifier

then

the

derivation

D

in

which

we

have

removed

the

rule

R

corresponding

to

:P

-LRB-

x

-RRB-

and

replaced

every

occurrence

of

:P

-LRB-

x

-RRB-

by

P

-LRB-

t

-RRB-

where

t

is

the

substituted

term

for

x

is

a

derivation

of

P

-LRB-

t

-RRB-

-LRB-

Likewise

for

:P

-LRB-

x

-RRB-

-RRB-

Proof

The

proof

is

an

easy

induction

on

the

derivation

D

as

above

Assume

that

S

is

of

the

form

Qx

F

-LRB-

x

-RRB-

Then

from

one

of

the

two

previous

lemmas

we

have

an

equivalent

derivation

of

F

-LRB-

x

-RRB-

-LRB-

or

F

-LRB-

t

-RRB-

-RRB-

smaller

than

D

so

by

induction

hypothesis

we

have

an

equivalent

canonical

derivation

of

F

-LRB-

x

-RRB-

-LRB-

or

F

-LRB-

t

-RRB-

-RRB-

from

which

we

get

an

equivalent

canonical

derivation

of

S

by

the

corresponding

rule

-LRB-

R

or

R

here

-RRB-

-LRB-

c

-RRB-

or

else

if

contains

a

negation

Lemma

If

D

is

a

derivation

of

F

in

which

F

is

satisfied

then

there

is

an

equivalent

derivation

of

F

smaller

than

D.

Proof

The

proof

is

an

easy

induction

on

the

derivation

D

as

above

Then

if

S

has

the

form

F

there

is

from

the

previous

lemma

an

equivalent

derivation

of

F

smaller

than

D

so

the

induction

hypothesis

gives

an

equivalent

canonical

derivation

of

F

So

we

get

an

equivalent

canonical

derivation

of

S

by

R

-LRB-

d

-RRB-

or

else

if

S

contains

a

disjunction

Lemma

If

D

is

a

derivation

of

in

which

is

satisfied

then

there

is

an

equivalent

derivation

of

A

B

smaller

than

D.

-LRB-

Likewise

for

A

oe

B

and

A

B

-RRB-

Proof

The

proof

is

an

easy

induction

on

the

derivation

D

as

above

Then

if

S

has

the

form

A

B

there

is

from

the

previous

lemma

an

equivalent

derivation

of

A

B

smaller

than

D

so

the

induction

hypothesis

gives

an

equivalent

canonical

derivation

of

A

B

So

we

get

an

equivalent

canonical

derivation

of

S

by

R

-LRB-

Likewise

for

A

oe

B

and

A

B

-RRB-

-LRB-

e

-RRB-

or

else

if

contains

a

potential

conjunction

Lemma

If

D

is

a

derivation

of

A

B

in

which

A

B

is

satisfied

and

potential

then

there

is

a

derivation

of

A

and

a

derivation

of

B

both

smaller

than

D

with

-LSB-

-LSB-

and

P

-LRB-

D

-RRB-

P

-LRB-

-RRB-

-LSB-

P

-LRB-

-RRB-

Proof

The

proof

is

by

induction

on

the

size

of

D.

D

can

not

be

an

axiom

If

the

last

rule

of

D

is

applied

to

A

B

then

the

result

is

obvious

Two

cases

remain

ffl

The

last

rule

of

D

has

one

premise

for

instance

F

A

B

F

A

B

-LRB-

L

:-RRB-

By

induction

hypothesis

there

exist

a

derivation

of

A

and

a

derivation

of

F

B

both

smaller

than

with

-LSB-

-LSB-

and

P

-LRB-

-RRB-

-LSB-

P

-LRB-

-RRB-

P

-LRB-

-RRB-

P

-LRB-

D

-RRB-

So

we

have

the

derivation

A

F

B

F

B

-LRB-

L

:-RRB-

F

A

B

-LRB-

R

-RRB-

where

the

derivation

of

F

B

is

smaller

than

D.

ffl

The

last

rule

of

D

has

two

premises

for

instance

A

B

oe

A

B

-LRB-

L?oe

-RRB-

By

induction

hypothesis

there

exist

a

derivation

of

A

and

a

derivation

of

B

both

smaller

than

with

-LSB-

-LSB-

and

P

-LRB-

-RRB-

-LSB-

P

-LRB-

-RRB-

P

-LRB-

-RRB-

So

we

have

the

derivation

A

B

oe

B

-LRB-

L?oe

-RRB-

oe

A

B

-LRB-

R

-RRB-

where

the

derivation

of

oe

B

is

smaller

than

D

because

is

smaller

than

Then

if

S

has

the

form

A

B

then

from

the

previous

lemma

there

exist

derivations

and

of

A

and

B

both

smaller

than

D

with

-LSB-

-LSB-

and

P

-LRB-

D

-RRB-

P

-LRB-

-RRB-

-LSB-

P

-LRB-

-RRB-

By

induction

hypothesis

there

exist

equivalent

canonical

derivations

and

so

we

have

an

equivalent

canonical

derivation

of

S

by

R

-LRB-

f

-RRB-

or

else

if

contains

a

potential

conjunction

The

proof

is

similar

to

the

previous

case

-LRB-

g

-RRB-

or

else

if

contains

a

negation

The

proof

is

similar

to

the

case

-LRB-

c

-RRB-

Application

The

idea

is

to

build

canonical

proofs

from

paths

For

this

purpose

we

refine

the

algorithm

given

in

let

P

be

a

path

for

SH

and

oe

a

substitution

such

that

the

condition

-LRB-

-RRB-

is

satisfied

We

construct

a

proof

of

S

by

induction

on

the

size

of

S

ffl

If

there

is

an

axiom

in

S

then

we

apply

the

rule

Axiom

possibly

preceded

by

a

sequence

of

weakening

rules

ffl

or

else

if

a

formula

of

S

is

not

satisfied

then

we

apply

the

corresponding

weakening

rule

ffl

or

else

if

there

is

a

potential

quantifier

in

S

we

apply

the

corresponding

rule

ffl

or

else

if

there

is

a

negation

in

we

apply

the

corresponding

rule

ffl

or

else

if

there

is

a

disjunction

in

S

we

apply

the

corresponding

rule

ffl

or

else

if

there

is

potential

conjunction

in

we

apply

the

corresponding

rule

ffl

or

else

if

there

is

potential

conjunction

in

we

apply

the

corresponding

rule

ffl

or

else

if

there

is

negation

in

we

apply

the

corresponding

rule

ffl

or

else

we

return

a

FAILURE

We

denote

A

-LRB-

P

-RRB-

the

resulting

proof

if

it

exists

Clearly

we

have

the

following

results

Proposition

-LRB-

-RRB-

If

A

-LRB-

P

-RRB-

exists

then

it

is

a

canonical

proof

-LRB-

-RRB-

A

-LRB-

P

-LRB-

D

-RRB-

-RRB-

exists

and

is

equivalent

to

D

As

a

consequence

of

the

proposition

we

obtain

the

completeness

of

our

algorithm

Theorem

-LRB-

Completeness

-RRB-

If

S

is

provable

in

DPC

then

there

exist

a

path

P

for

S

-LRB-

and

a

substitution

oe

-RRB-

such

that

A

-LRB-

P

-RRB-

is

defined

and

is

a

proof

of

S.

Intuitionnistic

proofs

The

corresponding

system

in

intuitionnistic

logic

that

we

can

call

Intuitionnistic

Direct

Predicate

Calculus

is

obtained

as

usual

by

considering

only

intuitionnistic

sequents

that

is

of

the

form

where

contains

at

most

one

formula

The

rules

are

slightly

modified

A

-LRB-

L?W

-RRB-

A

-LRB-

R?W

-RRB-

A

A

-LRB-

L

:-RRB-

A

A

-LRB-

R

:-RRB-

A

B

A

B

-LRB-

L

-RRB-

A

B

A

B

-LRB-

R

-RRB-

A

B

A

B

-LRB-

L

-RRB-

A

A

B

-LRB-

R

-RRB-

B

A

B

-LRB-

R

-RRB-

A

B

A

oe

B

-LRB-

L?oe

-RRB-

A

B

A

oe

B

-LRB-

R?oe

-RRB-

A

-LRB-

t

-RRB-

A

-LRB-

x

-RRB-

-LRB-

L

-RRB-

A

-LRB-

a

-RRB-

A

-LRB-

x

-RRB-

-LRB-

R

-RRB-

A

-LRB-

a

-RRB-

A

-LRB-

x

-RRB-

-LRB-

L

-RRB-

A

-LRB-

t

-RRB-

A

-LRB-

x

-RRB-

-LRB-

R

-RRB-

where

are

sequences

of

formulas

with

j?j

and

j

A

B

formulas

a

a

variable

not

appearing

in

-LSB-

and

t

a

term

Notice

that

it

is

equivalent

to

replace

the

rule

L

by

the

two

rules

A

B

A

B

-LRB-

L

-RRB-

A

B

A

B

-LRB-

L

-RRB-

since

in

L

we

have

j

The

multiplicative

form

of

the

rules

gives

to

the

rule

L

a

very

different

behaviour

than

the

additive

form

A

B

A

B

-LRB-

L

-RRB-

in

which

the

goal

is

the

same

on

each

side

If

a

formula

is

provable

in

Intuitionnistic

Direct

Predicate

Calculus

then

we

will

say

that

its

is

provable

in

DPCi

Definition

-LRB-

intuitionnistic

derivation

-RRB-

A

derivation

D

of

DPC

is

said

to

be

intuitionnistic

if

every

application

of

the

rule

R

on

is

immediately

followed

by

a

weakening

on

A

or

B

and

if

every

rule

has

at

most

one

formula

in

conclusion

Clearly

we

have

Proposition

F

is

provable

in

DPCi

if

and

only

if

there

is

an

intuitionnistic

derivation

of

F

in

DPC

Proof

Let

D

be

a

derivation

of

F

in

DPCi

Excepted

R

and

R

every

rule

of

DPCi

is

a

rule

of

DPC

and

remains

unchanged

The

rule

A

A

B

-LRB-

R

-RRB-

is

translated

into

A

A

B

-LRB-

R?W

-RRB-

A

B

-LRB-

R

-RRB-

Likewise

for

R

The

resulting

derivation

is

clearly

an

intuitionnistic

derivation

Conversely

if

there

exists

an

intuitionnistic

derivation

of

F

in

DPC

then

the

same

translation

clearly

gives

a

derivation

of

F

in

DPCi

The

choice

we

made

for

the

order

of

application

of

the

rules

in

the

previous

algorithm

is

not

innocent

The

idea

is

to

get

intuitionnistic

proofs

when

they

exist

Indeed

two

derivations

can

be

equivalent

the

one

being

intuitionnistic

the

other

not

For

instance

A

A

-LRB-

Ax

-RRB-

A

A

-LRB-

L

:-RRB-

A

A

-LRB-

R

:-RRB-

and

A

A

-LRB-

Ax

-RRB-

A

A

-LRB-

R

:-RRB-

A

A

-LRB-

L

:-RRB-

are

equivalent

but

only

the

first

one

is

intuitionnistic

That

's

the

reason

why

we

chose

to

apply

R

before

L

in

our

algorithm

Likewise

the

derivations

A

A

-LRB-

Ax

-RRB-

B

B

-LRB-

Ax

-RRB-

B

B

-LRB-

L

:-RRB-

A

oe

B

B

A

-LRB-

L?oe

-RRB-

A

oe

B

B

A

-LRB-

R

:-RRB-

C

C

-LRB-

Ax

-RRB-

A

oe

B

C

B

A

C

-LRB-

R

-RRB-

and

A

A

-LRB-

Ax

-RRB-

A

A

-LRB-

R

-RRB-

C

C

-LRB-

Ax

-RRB-

C

A

A

C

-LRB-

R

-RRB-

B

B

-LRB-

Ax

-RRB-

B

B

-LRB-

L

:-RRB-

A

oe

B

C

B

A

C

-LRB-

L?oe

-RRB-

are

equivalent

but

only

the

first

one

is

intuitionnistic

That

's

the

reason

why

we

chose

to

apply

R

before

L

oe

and

L

These

choices

are

justified

by

the

following

result

Proposition

If

a

derivation

D

is

intuitionnistic

then

the

derivation

D

is

intuitionnistic

too

Proof

The

proof

is

by

absurdum

assume

that

D

is

not

intuitionnistic

There

are

two

possible

reasons

ffl

either

we

have

an

application

of

R

not

followed

by

a

weakening

on

A

or

B

A

B

-LRB-

X

-RRB-

A

B

-LRB-

R

-RRB-

But

D

is

canonical

so

is

satisfied

in

D

so

in

D

too

But

D

is

intuitionnistic

so

the

application

of

R

on

in

D

is

followed

by

a

weakening

on

A

or

B

so

A

or

B

must

be

weakened

in

D

which

is

a

contradiction

ffl

or

there

is

a

non-intuitionnistic

sequent

in

D.

Let

us

consider

the

first

non-intuitionnistic

sequent

in

D

There

are

two

possibilities

-LCB-

the

corresponding

rule

is

A

F

A

F

-LRB-

L

:-RRB-

D

is

canonical

so

A

is

satisfied

in

D

so

in

D

too

and

F

is

a

quantifier

or

a

conjunction

not

potential

Let

us

consider

the

rule

in

D

where

A

is

principal

that

is

A

A

-LRB-

L

:-RRB-

since

D

is

intuitionnistic

But

this

contradicts

the

fact

that

F

were

not

potential

in

D.

-LCB-

the

corresponding

rule

is

F

A

B

A

oe

B

F

-LRB-

L?oe

-RRB-

D

is

canonical

so

F

is

a

non-potential

conjunction

or

an

atom

Then

let

us

consider

the

rule

in

D

where

A

oe

B

is

principal

that

A

B

F

A

oe

B

F

-LRB-

L?oe

-RRB-

Necessarily

F

must

be

F

otherwise

it

would

contradict

the

non

potentiality

of

F

in

the

above

rule

But

since

F

is

satisfied

and

connected

to

A

seen

the

derivation

D

this

application

is

not

possible

As

a

consequence

we

obtain

the

completeness

of

our

algorithm

with

respect

to

intuitionnistic

provability

Theorem

-LRB-

Completeness

-RRB-

If

a

sequent

S

is

provable

in

DPCi

then

there

exist

a

path

P

-LRB-

and

a

substitution

oe

-RRB-

such

that

A

-LRB-

P

-RRB-

is

defined

and

is

an

intuitionnistic

proof

of

S.

Implementation

in

the

system

Coq

An

implementation

of

the

decision

procedure

we

just

presented

has

been

realized

in

the

system

Coq

version

-LSB-

-RSB-

a

proof

assistant

developed

at

INRIA-Rocquencourt

and

ENS

Lyon

The

implementation

of

the

decision

procedure

itself

has

been

realized

in

Caml

Light

-LSB-

-RSB-

independently

of

the

system

Coq

with

its

own

representation

of

terms

and

proofs

The

interface

with

the

system

Coq

which

is

written

in

Caml

Light

is

then

just

a

translation

of

the

goal

to

prove

into

our

representation

of

terms

and

of

the

resulted

proof

-LRB-

if

it

exists

-RRB-

in

a

natural

deduction

proof

We

just

give

here

the

main

lines

of

this

implementation

and

we

wo

n't

focus

on

the

possible

algorithmic

optimizations

-LRB-

see

-LSB-

-RSB-

pages

-LCB-

-RRB-

Implementation

of

the

decision

procedure

in

Caml

Light

We

assume

that

we

have

types

term

formula

and

proof

to

represent

terms

formulas

and

proofs

of

Direct

Predicate

Calculus

A

possible

representation

of

terms

and

formulas

may

be

the

following

type

term

Var

of

string

Fun

of

string

-LRB-

term

list

-RRB-

type

formula

Atom

of

string

int

-LRB-

term

list

-RRB-

Neg

of

formula

Imp

of

formula

formula

Conj

of

formula

formula

Disj

of

formula

formula

ForAll

of

string

formula

Exists

of

string

formula

even

if

it

is

not

exactly

the

one

we

chose

Notice

that

atomic

formulas

are

of

the

form

Atom

-LRB-

name

n

tl

-RRB-

where

name

is

the

name

of

the

predicate

tl

the

list

of

terms

on

which

it

is

applied

and

n

an

integer

This

integer

n

allows

to

separate

formulas

formulas

of

are

represented

with

the

integer

and

separated

formulas

of

L

with

different

integers

for

each

occurrence

of

an

atomic

formula

We

define

the

following

functions

value

separate

formula

formula

value

formula

formula

where

pi

formula

is

the

canonical

projection

from

L

into

-LRB-

denoted

ss

-RRB-

and

separate

a

function

associating

to

a

formula

of

a

separated

formula

F

of

L

such

that

ss

-LRB-

F

-RRB-

-LRB-

by

doing

a

prefix

traversal

of

and

giving

increasing

integers

for

each

atomic

formula

-RRB-

Paths

search

We

consider

a

formula

F

of

L

for

which

we

want

to

know

if

it

is

provable

in

Direct

Predicate

Calculus

and

in

that

case

what

are

the

possible

derivations

The

first

step

of

the

decision

procedure

is

to

determine

the

Herbrand

form

of

F

The

function

value

Herbrand

formula

-LRB-

string

list

formula

-RRB-

takes

a

formula

F

and

returns

the

list

of

its

essentially

existential

variables

together

with

its

Herbrand

form

FH

The

next

step

is

to

look

for

pairs

-LRB-

oe

P

-RRB-

where

oe

is

a

substitution

and

P

a

path

for

FH

satisfying

the

condition

-LRB-

-RRB-

of

the

theorem

For

this

purpose

we

proceed

using

the

method

of

-LSB-

-RSB-

that

we

briefly

presented

in

We

first

determine

the

set

M

-LRB-

P

P

u

-RRB-

j

P

A

P

A

P

-LSB-

u

-RSB-

ss

P

-LSB-

u

-RSB-

where

A

is

the

set

of

positive

atomic

subformulas

of

FH

and

A

the

set

of

negative

ones

So

we

have

to

solve

the

unification

problems

u

v

where

Ai

-LRB-

u

-RRB-

and

Aj

-LRB-

v

-RRB-

are

two

atomic

subformulas

of

FH

respectively

appearing

positively

and

negatively

The

first-order

unification

is

decidable

A

lot

of

algorithms

are

known

and

we

used

Martelli

and

Montanari

's

one

-LRB-

see

-LSB-

-RSB-

and

also

-LSB-

-RSB-

pages

-LCB-

-RRB-

The

function

all

matches

compute

the

set

M

value

formula

-LRB-

formula

formula

unifier

-RRB-

list

Then

we

look

for

the

pairs

-LRB-

U

oe

-RRB-

where

U

is

a

subset

of

M

and

oe

a

substitution

such

that

ffl

U

is

not

empty

ffl

All

atomic

formulas

of

U

are

distinct

ffl

W

-LRB-

P

;P

u

-RRB-

u

is

defined

and

oe

W

-LRB-

P

;P

u

-RRB-

u

ffl

If

A

ffi

B

is

a

conjunctive

subformula

of

FH

then

A

and

B

are

not

connected

by

U

ffl

If

U

satisfies

a

conjunctive

formulas

A

ffi

B

then

U

satisfies

A

and

B

Such

a

pair

-LRB-

U

oe

-RRB-

clearly

satisfies

the

conditions

-LRB-

a

-LCB-

e

-RRB-

and

-LRB-

-RRB-

They

are

represented

by

the

type

type

path

-LRB-

formula

formula

unifier

-RRB-

list

unifier

and

the

function

value

paths

-LRB-

formula

formula

unifier

-RRB-

list

formula

path

list

compute

all

such

pairs

from

M

and

FH

We

do

not

compute

all

the

subsets

of

M

which

would

be

costly

but

we

use

the

method

described

in

-LSB-

-RSB-

page

It

remains

to

satisfy

the

condition

-LRB-

f

-RRB-

that

is

the

absence

of

conjunctive

cycle

For

this

purpose

we

build

the

graph

G

introduced

in

and

we

check

if

it

has

a

cycle

or

not

-LRB-

this

can

be

done

in

linear

time

-RRB-

The

function

value

formula

path

list

path

list

takes

the

formula

FH

a

list

of

potential

paths

for

FH

and

returns

the

set

of

paths

for

FH

-LRB-

those

without

conjunctive

cycle

-RRB-

So

we

can

now

build

proofs

from

paths

From

paths

to

proofs

Let

P

be

a

path

for

FH

and

oe

a

substitution

such

that

the

condition

-LRB-

-RRB-

is

satisfied

First

we

replace

in

P

and

oe

the

Herbrand

terms

by

the

corresponding

variables

-LRB-

they

are

no

longer

useful

-RRB-

that

is

we

replace

every

occurrence

of

fx

-LRB-

u

-RRB-

by

x

We

keep

the

notation

P

and

oe

for

the

resulting

path

and

substitution

The

making

of

a

derivation

from

P

follows

the

algorithm

given

in

The

function

value

formula

path

proof

applies

the

algorithm

and

returns

a

proof

of

F

or

raises

the

exception

FAILURE

Then

we

can

give

the

main

body

of

the

decision

procedure

exception

of

string

-LRB-

prove

formula

proof

-RRB-

let

prove

f

let

separate

f

in

let

-LRB-

ex

-RRB-

herbrand

in

let

M

in

if

M

-RSB-

then

raise

-LRB-

M

is

empty

-RRB-

else

let

ps

paths

M

in

if

ps

-RSB-

then

raise

-LRB-

No

path

-RRB-

else

let

vp

in

if

vp

-RSB-

then

raise

-LRB-

Every

path

has

a

conjunctive

cycle

-RRB-

else

let

rec

quant

function

p

rest

try

p

with

FAILURE

quant

rest

-LSB-

-RSB-

raise

-LRB-

Path

-LRB-

s

-RRB-

do

not

correspond

to

proofs

-RRB-

in

quant

vp

Complexity

Our

purpose

is

to

evaluate

the

complexity

of

the

decision

procedure

Let

F

be

a

formula

and

n

the

number

of

atomic

subformulas

of

F

This

number

n

is

of

the

size

of

F

-LRB-

even

if

it

can

be

very

less

like

in

A

-RRB-

and

we

will

consider

them

as

equal

Let

a

be

the

number

of

positive

atomic

subformulas

and

a

the

number

of

negative

ones

The

first

step

is

to

determine

the

set

M

-LRB-

i.e.

-RRB-

the

triplets

-LRB-

P

P

u

-RRB-

satisfying

-LRB-

c

-RRB-

and

-LRB-

-RRB-

There

are

at

most

pairs

-LRB-

P

P

-RRB-

with

P

A

and

P

A

and

so

the

computing

of

M

is

in

time

O

-LRB-

-RRB-

Then

we

look

for

paths

among

the

subsets

of

M.

For

a

subset

of

M

of

cardinal

k

we

must

check

the

conditions

on

paths

We

admit

that

this

check

can

be

done

in

time

kn

Let

pk

be

the

number

of

paths

of

cardinal

k

with

k

a

min

-LRB-

a

a

-RRB-

Seen

the

conditions

-LRB-

b

-RRB-

and

-LRB-

-RRB-

we

have

pk

k

Cka

Cka

The

search

for

all

paths

takes

a

total

time

Tn

a

X

k

k

n

pk

n

a

X

k

k

k

Cka

Cka

n

a

X

k

k

k

Ckn?a

Cka

But

we

have

a

n

so

Ckn?a

and

Cka

are

always

less

than

Cn

n

and

so

Tn

n

a

Cn

n

n

n

n

Cn

n

n

e

using

the

Stirling

formula

The

complexity

is

reasonably

exponential

when

we

remember

that

propositional

calculus

decidability

is

already

exponential

Overview

of

the

system

Coq

Coq

-LSB-

-RSB-

is

a

proof

assistant

for

higher-order

logic

It

allows

to

write

specifications

and

propositions

to

check

mathematical

proofs

and

to

automatically

synthesize

computer

programs

from

the

proof

of

their

specifications

The

language

of

Coq

is

the

Calculus

of

Inductive

Constructions

and

its

proof

system

is

an

intuitionnistic

natural

deduction

We

are

going

to

briefly

present

the

syntax

and

the

principles

of

Coq

in

order

to

explain

how

we

implemented

the

decision

procedure

for

Direct

Predicate

Calculus

in

Coq

Terms

and

propositions

In

Coq

all

types

are

terms

Given

basic

types

it

is

possible

to

build

other

types

from

three

elementary

constructions

ffl

application

of

a

term

f

to

a

term

x

denoted

-LRB-

f

x

-RRB-

ffl

abstraction

of

a

variable

x

of

type

T

in

a

term

F

denoted

-LSB-

x

T

-RSB-

F

ffl

product

of

a

type

and

a

type

denoted

-LRB-

x

-RRB-

When

the

product

is

not

dependent

-LRB-

that

is

x

does

not

appear

in

-RRB-

it

is

also

denoted

and

then

represents

the

type

of

functional

objects

Coq

allows

also

to

define

inductive

types

as

the

type

of

naturals

for

instance

In

a

language

of

the

ML

family

like

Caml

Light

it

is

possible

to

define

such

a

type

as

type

nat

O

S

of

nat

In

Coq

we

define

the

same

inductive

type

in

a

similar

way

Inductive

Set

nat

O

nat

S

nat

nat

The

function

associating

x

to

x

will

be

denoted

-LSB-

x

nat

-RSB-

-LRB-

S

-LRB-

S

x

-RRB-

-RRB-

and

it

has

the

type

nat

nat

In

Coq

logical

propositions

have

type

Prop

Atomic

propositions

are

obtained

as

the

application

of

predicate

to

terms

For

instance

if

P

is

a

predicate

of

type

nat

Prop

then

-LRB-

P

-LRB-

S

O

-RRB-

-RRB-

is

an

atomic

proposition

Propositions

are

built

from

the

usual

connectives

and

quantifiers

with

the

following

syntax

ffl

If

P

and

Q

are

two

propositions

then

P

Q

is

the

proposition

P

oe

Q

ffl

If

P

and

Q

are

two

propositions

then

P

Q

is

the

proposition

P

Q

ffl

If

P

and

Q

are

two

propositions

then

P\/Q

is

the

proposition

P

Q

ffl

True

is

the

tautological

proposition

False

the

absurd

proposition

ffl

If

P

is

a

proposition

then

P

is

the

proposition

:P

defined

as

P

oe

F

alse

ffl

If

P

is

a

proposition

in

which

x

is

a

free

variable

of

type

T

then

-LRB-

x

T

-RRB-

P

is

the

proposition

T

:P

ffl

If

P

is

a

proposition

in

which

x

is

a

free

variable

of

type

T

then

-LRB-

Ex

-LSB-

x

T

-RSB-

P

-RRB-

is

the

proposition

T

:P

We

can

also

write

higher-order

propositions

like

-LRB-

A

Prop

-RRB-

A

A

or

-LRB-

P

nat

Prop

-RRB-

-LRB-

Ex

-LSB-

x

nat

-RSB-

-LRB-

P

x

-RRB-

-RRB-

If

P

is

a

predicate

of

type

nat

Prop

the

drinkers

theorem

is

written

-LRB-

Ex

-LSB-

x

nat

-RSB-

-LRB-

y

nat

-RRB-

-LRB-

P

x

-RRB-

-LRB-

P

y

-RRB-

-RRB-

Let

us

show

now

how

to

prove

propositions

in

the

system

Coq

Tactics

and

proofs

If

we

want

to

prove

the

proposition

A

oe

-LRB-

A

oe

B

-RRB-

oe

B

in

Coq

we

write

for

instance

Coq

Lemma

-LRB-

A

B

Prop

-RRB-

A

-LRB-

A

B

-RRB-

B

We

obtain

the

following

goal

subgoal

-LRB-

A

B

Prop

-RRB-

-LRB-

A

-LRB-

A

B

-RRB-

B

-RRB-

In

a

goal

the

proposition

to

prove

is

below

the

double

line

and

the

context

in

which

we

do

the

proof

here

an

empty

context

for

the

moment

is

on

top

of

it

We

can

see

the

goal

as

the

sequent

P

where

is

the

context

-LRB-

also

called

environment

-RRB-

and

P

the

proposition

to

prove

We

call

tactic

every

Coq

command

which

applies

one

or

more

inference

rules

to

the

current

goal

To

each

tactic

is

associated

a

validation

that

is

a

structure

which

allows

to

verify

once

the

proof

is

done

that

the

inference

rules

have

been

correctly

used

Then

we

are

always

ensured

to

stay

in

a

coherent

state

and

to

have

a

sequent

which

can

be

derived

from

the

initial

one

The

tactic

Intro

for

instance

allows

to

introduce

universally

quantified

variables

and

hypothesis

in

the

context

Let

us

apply

the

tactic

Intro

to

our

goal

Intro

subgoal

A

Prop

-LRB-

B

Prop

-RRB-

-LRB-

A

-LRB-

A

B

-RRB-

B

-RRB-

By

applying

it

as

many

times

as

possible

-LRB-

Intros

does

it

-RRB-

we

get

the

goal

A

Prop

B

Prop

H

A

A

B

B

We

apply

an

hypothesis

-LRB-

or

a

lemma

an

axiom

-RRB-

with

the

tactic

Apply

Here

we

apply

the

hypothesis

with

the

command

Apply

subgoal

A

Prop

B

Prop

H

A

A

B

A

A

is

an

hypothesis

So

we

can

finish

the

proof

with

the

tactic

Assumption

Assumption

Subtree

proved

In

a

more

general

way

there

exist

for

each

connective

an

introduction

and

an

elimination

rule

The

elimination

of

a

conective

in

realized

through

the

tactic

Elim

For

instance

on

the

goal

A

Prop

B

Prop

C

Prop

H

A

B

C

the

command

Elim

H

produces

the

two

subgoals

subgoals

A

Prop

B

Prop

C

Prop

H

A

B

A

C

subgoal

is

B

C

Interface

with

the

system

Coq

We

are

now

in

position

to

interface

our

decision

procedure

with

the

system

Coq

For

this

purpose

we

must

first

translate

the

goal

in

the

language

L

and

then

translate

one

of

the

resulting

proofs

if

there

exist

into

a

sequence

of

Coq

tactics

The

translation

of

the

goal

to

prove

into

L

is

not

a

problem

It

is

a

purely

syntactic

translation

in

which

we

forget

the

types

of

terms

We

have

just

to

check

if

the

goal

is

a

first-order

proposition

For

this

it

is

sufficient

to

check

that

of

the

quantified

variables

is

a

predicate

or

a

function

applied

to

terms

Remark

The

proposition

-LRB-

A

oe

A

-RRB-

does

not

belong

to

first-order

logic

but

A

oe

A

is

trivially

provable

in

Direct

Predicate

Calculus

More

generally

if

we

can

prove

P

-LRB-

xn

-RRB-

in

DPC

then

we

can

prove

:P

-LRB-

xn

-RRB-

in

Coq

even

if

the

quantifiers

xn

are

not

first-order

ones

So

we

can

first

introduce

all

the

prenex

universal

quantifications

then

apply

the

decision

procedure

on

the

resulting

goal

-LRB-

in

which

xn

have

become

free

variables

that

is

constants

-RRB-

This

way

the

method

is

extended

to

a

certain

class

of

higher-order

formulas

Once

the

goal

is

translated

into

a

formula

F

of

L

we

can

apply

the

decision

procedure

If

it

fails

we

leave

the

goal

unchanged

and

we

just

warm

the

user

that

the

tactic

failed

which

does

not

mean

of

course

that

the

goal

is

not

provable

in

Coq

and

why

If

it

succeeds

we

get

a

set

of

derivations

of

F

in

DPC

from

which

we

keep

intuitionnistic

ones

If

there

is

almost

one

intuitionnistic

derivation

D

of

F

then

we

translate

it

into

Coq

tactics

In

the

practice

we

used

internal

Coq

functions

to

do

this

translation

but

to

clarify

this

step

we

will

give

here

the

corresponding

Coq

top-level

tactics

Axioms

Every

axiom

A

A

-LRB-

Ax

-RRB-

in

the

derivation

D

means

that

A

is

in

the

local

context

So

we

translate

the

rule

Axiom

by

the

tactic

Assumption

Structural

rules

The

weakening

rule

A

-LRB-

L?W

-RRB-

means

that

we

forget

the

hypothesis

A

We

just

do

nothing

and

continue

the

translation

On

the

other

hand

the

weakening

rule

A

-LRB-

R?W

-RRB-

means

that

we

replace

the

goal

to

prove

by

F

alse

The

command

ElimType

False

has

this

effect

Logical

rules

Here

is

the

translation

of

logical

rules

of

Intuitionnistic

Direct

Predicate

Calculus

into

Coq

tactics

We

assume

that

this

translation

is

recursively

called

on

the

generated

subgoals

We

denote

C

the

local

context

of

Coq

A

A

-LRB-

R

:-RRB-

Red

Intro

because

A

is

defined

as

A

oe

F

alse

A

A

-LRB-

L

:-RRB-

Apply

H

where

H

A

C

A

B

A

B

-LRB-

R

-RRB-

Split

A

B

A

B

-LRB-

L

-RRB-

Elim

H

Intro

Intro

where

H

A

B

C

A

A

B

-LRB-

R

-RRB-

Left

B

A

B

-LRB-

R

-RRB-

Right

A

B

A

B

-LRB-

L

-RRB-

Elim

H

then

ElimType

False

on

the

goal

i

such

that

i

and

Intro

on

the

other

where

H

A

B

C

A

B

A

oe

B

-LRB-

R?oe

-RRB-

Intro

A

B

A

oe

B

-LRB-

L?oe

-RRB-

Cut

B

then

Apply

H

on

the

second

subgoal

-LRB-

where

H

A

oe

B

C

-RRB-

and

Intro

on

the

first

one

P

:P

-LRB-

R

-RRB-

Intro

P

-LRB-

t

-RRB-

:P

-LRB-

x

-RRB-

-LRB-

L

-RRB-

Cut

P

-LSB-

x

t

-RSB-

then

Apply

-LRB-

H

t

-RRB-

on

the

second

subgoal

-LRB-

where

H

-LRB-

x

T

-RRB-

P

C

-RRB-

and

Intro

on

the

first

subgoal

P

-LRB-

t

-RRB-

:P

-LRB-

x

-RRB-

-LRB-

R

-RRB-

Exists

t

P

:P

-LRB-

L

-RRB-

Elim

H

Intro

Intro

where

H

-LRB-

Ex

-LSB-

x

T

-RSB-

P

-RRB-

C

The

resulting

tactic

is

called

Linear

and

thus

called

with

Coq

Linear

However

this

tactic

does

not

allow

to

use

previous

results

or

hypothesis

of

the

context

It

is

useful

to

use

lemmas

in

a

proof

when

some

subgoals

arise

frequently

or

when

we

need

to

do

a

part

of

the

proof

-LRB-

a

higher-order

reasoning

-RRB-

by

hand

and

to

finish

the

proof

with

the

tactic

Linear

For

this

purpose

we

extended

the

syntax

of

our

tactic

in

the

following

way

Assume

that

we

have

in

the

context

the

hypotheses

Hn

cn

and

the

goal

to

prove

-LRB-

-RRB-

-LRB-

-RRB-

-LRB-

xk

Tk

-RRB-

c

for

which

we

want

to

-LRB-

possibly

-RRB-

use

the

previous

hypotheses

The

idea

is

to

apply

the

decision

procedure

on

the

goal

oe

oe

oe

cn

oe

c

seen

we

have

cn

as

hypotheses

The

syntax

is

Coq

Linear

with

Hn

Examples

Let

us

illustrate

the

behaviour

of

the

tactic

Linear

on

some

examples

Assume

we

have

a

natural

a

predicate

P

Q

odd

even

of

type

nat

P

rop

and

a

function

f

of

type

nat

nat

Variable

a

nat

Variable

P

Q

odd

even

nat

Prop

Variable

f

nat

nat

We

can

show

the

following

facts

Theorem

-LRB-

x

nat

-RRB-

-LRB-

Ex

-LSB-

y

nat

-RSB-

-LRB-

-LRB-

P

x

-RRB-

-LRB-

P

y

-RRB-

-RRB-

-RRB-

Linear

Save

Theorem

-LRB-

Ex

-LSB-

x

nat

-RSB-

-LRB-

P

x

-RRB-

-RRB-

-LRB-

-LRB-

y

nat

-RRB-

-LRB-

P

y

-RRB-

-LRB-

Q

y

-RRB-

-RRB-

-LRB-

Ex

-LSB-

z

nat

-RSB-

-LRB-

Q

z

-RRB-

-RRB-

Linear

Save

Theorem

-LRB-

even

a

-RRB-

-LRB-

-LRB-

x

nat

-RRB-

-LRB-

-LRB-

even

x

-RRB-

-LRB-

odd

-LRB-

S

x

-RRB-

-RRB-

-RRB-

-RRB-

-LRB-

Ex

-LSB-

y

nat

-RSB-

-LRB-

odd

y

-RRB-

-RRB-

Linear

Save

Theorem

-LRB-

-LRB-

x

nat

-RRB-

-LRB-

-LRB-

and

-LRB-

P

x

-RRB-

-LRB-

odd

x

-RRB-

-RRB-

-LRB-

even

-LRB-

f

x

-RRB-

-RRB-

-RRB-

-RRB-

-LRB-

-LRB-

x

nat

-RRB-

-LRB-

-LRB-

even

x

-RRB-

-LRB-

odd

-LRB-

S

x

-RRB-

-RRB-

-RRB-

-RRB-

-LRB-

even

a

-RRB-

-LRB-

P

-LRB-

S

a

-RRB-

-RRB-

-LRB-

Ex

-LSB-

z

nat

-RSB-

-LRB-

even

-LRB-

f

z

-RRB-

-RRB-

-RRB-

Linear

Save

The

drinkers

theorem

is

more

delicate

to

prove

The

proof

by

case

-LRB-

we

have

either

Q

-LRB-

x

-RRB-

or

Q

-LRB-

x

-RRB-

-RRB-

is

done

by

hand

but

the

corresponding

subgoals

are

automatically

proved

by

the

tactics

Linear

-LRB-

with

a

lemma

for

the

second

one

-RRB-

Variable

U

Set

Variable

Q

U

Prop

Axiom

-LRB-

P

Prop

-RRB-

-LRB-

P

P

-RRB-

Lemma

-LRB-

x

U

-RRB-

-LRB-

Q

x

-RRB-

-LRB-

Q

x

-RRB-

Exact

-LSB-

x

U

-RSB-

-LRB-

-LRB-

Q

x

-RRB-

-RRB-

Save

Theorem

Drinker

's

theorem

-LRB-

x

U

-RRB-

-LRB-

Ex

-LSB-

x

U

-RSB-

-LRB-

-LRB-

Q

x

-RRB-

-LRB-

x

U

-RRB-

-LRB-

Q

x

-RRB-

-RRB-

-RRB-

Intro

Generalize

-LRB-

-LRB-

Ex

-LSB-

x

U

-RSB-

-LRB-

Q

x

-RRB-

-RRB-

-RRB-

Intro

H

Elim

H.

Linear

Intro

Exists

Linear

with

Save

To

illustrate

the

use

of

lemmas

in

the

decision

procedure

let

us

consider

a

specification

of

the

predicate

on

naturals

a

monotonic

function

f

of

type

nat

nat

and

let

us

show

f

-LRB-

a

-RRB-

f

-LRB-

b

-RRB-

Variable

le

nat

nat

Prop

Variable

f

nat

nat

Axiom

-LRB-

n

nat

-RRB-

-LRB-

le

n

n

-RRB-

Axiom

-LRB-

n

m

nat

-RRB-

-LRB-

le

n

m

-RRB-

-LRB-

le

n

-LRB-

S

m

-RRB-

-RRB-

Axiom

monoticity

-LRB-

n

m

nat

-RRB-

-LRB-

le

n

m

-RRB-

-LRB-

le

-LRB-

f

n

-RRB-

-LRB-

f

m

-RRB-

-RRB-

Lemma

-LRB-

x

nat

-RRB-

-LRB-

le

x

-LRB-

S

x

-RRB-

-RRB-

Linear

with

Save

Theorem

-LRB-

a

nat

-RRB-

-LRB-

Ex

-LSB-

b

nat

-RSB-

-LRB-

le

-LRB-

f

a

-RRB-

-LRB-

f

-LRB-

S

b

-RRB-

-RRB-

-RRB-

-RRB-

Linear

with

monoticity

Save

At

last

let

us

show

some

examples

on

which

the

tactic

fails

Parameter

A

B

C

D

Prop

Theorem

A

-LRB-

A

A

-RRB-

-LRB-

Error

Not

provable

in

DPC

-LRB-

No

path

-RRB-

during

command

Linear

-RRB-

Auto

Save

Theorem

-LRB-

-LRB-

or

A

B

-RRB-

C

-RRB-

-LRB-

or

-LRB-

D

A

-RRB-

-LRB-

D

B

-RRB-

-RRB-

D

C.

-LRB-

Error

Not

provable

in

DPC

-LRB-

No

path

-RRB-

during

command

Linear

-RRB-

Intros

H

Elim

Auto

Save

Conclusion

We

have

presented

a

decision

procedure

for

Direct

Predicate

Calculus

Starting

from

-LSB-

-RSB-

we

have

extended

the

decision

procedure

to

non-prenex

formulas

and

to

intuitionnistic

proofs

This

work

can

be

related

with

-LSB-

-RSB-

but

it

differs

on

two

points

first

we

do

not

consider

explicitly

rules

permutabilities

but

we

construct

a

particular

proof

-LRB-

discarding

the

others

which

are

equivalent

-RRB-

secondly

we

do

not

wait

to

reach

the

axioms

rules

to

fail

in

proof

search

but

we

first

look

for

potential

axioms

and

then

we

construct

a

proof

from

axioms

References

-LSB-

-RSB-

G.

Bellin

and

J.

Ketonen

A

decision

procedure

revisited

Notes

on

direct

logic

linear

logic

and

its

implementation

Theoretical

Computer

Science

-LCB-

-LSB-

-RSB-

C.

Cornes

J.

Courant

J.-C

Filli

atre

G.

Huet

P.

Manoury

C.

Paulin-Mohring

C.

Mu

noz

C.

Murthy

C.

Parent

A.

Sa

bi

and

B.

Werner

The

Coq

Proof

Assistant

Reference

Manual

Version

Technical

Report

INRIA

July

-LSB-

-RSB-

J.

Gallier

Constructive

Logics

Part

I

A

Tutorial

on

Proof

Systems

and

Typed

-LCB-

Calculi

Research

Report

Digital

Equipment

Corporation

May

-LSB-

-RSB-

J.

Gallier

Constructive

Logics

Part

II

Linear

Logic

and

Proof

Nets

Research

Report

Digital

Equipment

Corporation

May

-LSB-

-RSB-

J.-Y

Girard

Y.

Lafont

and

P.

Taylor

Proofs

and

Types

Cambridge

Tracts

in

Theoretical

Computer

Science

Cambridge

University

Press

-LSB-

-RSB-

J.

Ketonen

and

R.

Weyhrauch

A

decidable

fragment

of

Predicate

Calculus

Theoretical

Computer

Science

-LCB-

-LSB-

-RSB-

R.

Lalement

Logique

r?eduction

r?esolution

Etudes

et

recherches

en

Informatique

MASSON

-LSB-

-RSB-

X.

Leroy

and

P.

Weis

Manuel

de

r?ef?erence

du

langage

Caml

InterEditions

-LSB-

-RSB-

P.

D.

Lincoln

and

N.

Shankar

Proof

search

in

first-order

linear

logic

and

other

cut-free

sequent

calculi

In

Symposium

on

Logic

in

Computer

Science

IEEE

Computer

Society

Press

-LSB-

-RSB-

A.

Martelli

and

U.

Montanari

An

efficient

unification

algorithm

ACM

Trans

Prog

Lang

Syst.

-LRB-

-RRB-

-LCB-

April

-LSB-

-RSB-

P.

Weis

and

X.

Leroy

Le

langage

Caml

InterEditions

intuitionnistic logic
predicate calculus
proof search
sequent calculus