Relation between first order and propositional logic; Herbrand theorem.
Function or value | Description | ||
|
It is a variant of the notion of propositional evaluation
Prop.eval where the input propositional
valuation
Example
Evaluates to true .
Example
Evaluates to false .
Example
Throws System.Exception: Not part of propositional logic. .
|
Function or value | Description |
Full Usage:
groundterms cntms funcs n
Parameters:
term list
-
The input list of constant terms.
funcs : (string * int) list
-
The input list of function name-arity pairs.
n : int
-
The number of function symbols the resulting ground terms will contain.
Returns: term list
The input cntms itself, if n is 0 ; otherwise, all
the ground terms that can be created with the give funcs and
that contain only n function symbols.
|
If
Example
Evaluates to
Example
Evaluates to
Example
Evaluates to
|
Full Usage:
groundtuples cntms funcs n m
Parameters:
term list
-
The input list of constant terms.
funcs : (string * int) list
-
The input list of function name-arity pairs.
n : int
-
The number of function symbols the resulting ground terms will contain.
m : int
-
The number of element of the resulting ground terms tuples.
Returns: term list list
All the m -tuples of ground terms that can be created from then
input cntms and funcs where each ground term contain
only n function symbols.
|
Example
Evaluates to
Example
Evaluates to
|
|
Example
Evaluates to ([("c", 0)], [("f", 1); ("g", 2)]) .
|
Function or value | Description |
Full Usage:
herbloop mfn tfn fl0 cntms funcs fvs n fl tried tuples
Parameters:
'a -> (formula<fol> -> formula<fol>) -> formula<fol> list list -> formula<fol> list list
-
The modification function that augments the ground instances with a new instance.
tfn : formula<fol> list list -> bool
-
The satisfiability test to be done.
fl0 : 'a
-
The input set of clauses: i.e. a formula in some transformed list representation.
cntms : term list
-
The constant terms to generate the ground terms.
funcs : (string * int) list
-
The function symbols (name, arity) to generate the ground terms.
fvs : string list
-
The free variables to instantiate to generate the ground terms.
n : int
-
The number of function symbols the new ground terms to be generated should contain.
fl : formula<fol> list list
-
The set of ground instances so far.
tried : term list list
-
The instances tried.
tuples : term list list
-
The remaining ground instances in the current level.
Returns: term list list
The list of ground tuples generated and prints to the stdout how
many ground instances were tried, if the procedure terminates (thus
indicating that the formula is valid); otherwise, loops generating and
testing larger and larger ground instances till the memory is full.
|
This is a generic function to be used with different 'herbrand procedures'. It tests larger and larger conjunctions of ground instances for unsatisfiability, iterating the given modifier functionmfn over
ground terms till the given test function tfn fails.
NoteSee the specific implementations Herbrand.gilmore_loop, Herbrand.dp_loop, Herbrand.dp_refine_loop for examples. |
Function or value | Description |
Full Usage:
gilmore fm
Parameters: Returns: int
The number of ground tuples generated and prints to the stdout
how many ground instances were tried, if the procedure terminates (thus
indicating that the formula is valid); otherwise, loops indefinitely
till the memory is full.
|
NoteThe procedure loops infinitely if the initial formula is not valid and even if it is, it is not guaranteed to end. Example
Evaluates to 2 and print to the stdout :
type 'T list = List<'T>
|
Full Usage:
gilmore_loop fl0 cntms funcs fvs n fl tried tuples
Parameters:
formula<fol> list list
-
The input set of clauses.
cntms : term list
-
The constant terms to generate the ground terms.
funcs : (string * int) list
-
The function symbols (name, arity) to generate the ground terms.
fvs : string list
-
The free variables to instantiate to generate the ground terms.
n : int
-
The number of function symbols the new ground terms to be generated should contain.
fl : formula<fol> list list
-
The set of ground instances so far.
tried : term list list
-
The instances tried.
tuples : term list list
-
The remaining ground instances in the current level.
Returns: term list list
The list of ground tuples generated and prints to the stdout how
many ground instances were tried, if the procedure terminates (thus
indicating that the formula is valid); otherwise, loops generating and
testing larger and larger ground instances till the memory is full.
|
The input set of clauses
Example
Evaluates to [[``c``; ``f_z(c)``]; [``c``; ``c``]] and print to
the stdout :
type 'T list = List<'T>
|
Full Usage:
gilmore_mfn djs0 ifn djs
Parameters:
formula<fol> list list
-
The input formula in DNF 'clausal' form.
ifn : formula<fol> -> formula<fol>
-
The instantiation function.
djs : formula<fol> list list
-
The ground instance of the input formula so far.
Returns: formula<fol> list list
The updated ground instance of the input formula.
|
Updates the ground instance
Example
In this example each conjunct in the original formula
Evaluates to
Corresponding to the formula `P(f(c)) \/ P(f(c)) /\ ~P(c) \/ ~P(c) /\ ~P(f(c))` .
Note that the input ground instance [["P(f(c))"]; ["~P(c)"]]
must have been generated by an instantiation that mapped both x
and y to c while the new given instantiation
maps y to f(c) .
Note also that the conjunct [`P(f(c))`; `~P(f(c))`] has been
removed from the output, since contradictory.
|
Full Usage:
gilmore_tfn djs
Parameters:
'a list
-
The input formula (more precisely its ground instance so far) in a DNF 'clausal' form.
Returns: bool
true, if the input is nonempty; otherwise, false
|
It simply tests that the set of DNF 'clauses' is nonempty, because the contradiction checking is done by the modification function.
Example
Evaluates to true .
Example
Evaluates to false .
|
Function or value | Description |
Full Usage:
davisputnam fm
Parameters: Returns: int
The number of ground tuples generated and prints to the stdout
how many ground instances were tried, if the procedure terminates (thus
indicating that the formula is valid); otherwise, loops indefinitely
till the memory is full.
|
NoteThe procedure loops infinitely if the initial formula is not valid and even if it is, it is not guaranteed to end. Example
Evaluates to 2 and print to the stdout :
type 'T list = List<'T>
|
Full Usage:
dp_loop fl0 cntms funcs fvs n fl tried tuples
Parameters:
formula<fol> list list
-
The input set of clauses.
cntms : term list
-
The constant terms to generate the ground terms.
funcs : (string * int) list
-
The function symbols (name, arity) to generate the ground terms.
fvs : string list
-
The free variables to instantiate to generate the ground terms.
n : int
-
The number of function symbols the new ground terms to be generated should contain.
fl : formula<fol> list list
-
The set of ground instances so far.
tried : term list list
-
The instances tried.
tuples : term list list
-
The remaining ground instances in the current level.
Returns: term list list
The list of ground tuples generated and prints to the stdout how
many ground instances were tried, if the procedure terminates (thus
indicating that the formula is valid); otherwise, loops generating and
testing larger and larger ground instances till the memory is full.
|
The input set of clauses
Example
Evaluates to [[``f_y(c)``; ``c``]; [``c``; ``f_y(c)``]; [``c``; ``c``]] and print to
the stdout :
type 'T list = List<'T>
|
Full Usage:
dp_mfn cjs0 ifn cjs
Parameters:
'a list list
-
The initial formula in a list of list representation of conjunctive normal.
ifn : 'a -> 'b
-
The instantiation to be applied to the formula to generate ground instances.
cjs : 'b list list
-
The set of ground instances so far.
Returns: 'b list list
The set of ground instances incremented.
|
ExampleThis example shows the first generation of ground instance when the set is initially empty.
Evaluates to [[`P(c)`]; [`~P(f_y(c))`]] .
ExampleThis example shows the second generation of ground instance when the nonempty set is augmented.
Evaluates to [[`P(c)`]; [`P(f_y(c))`]; [`~P(f_y(c))`]; [`~P(f_y(f_y(c)))`]] .
|
Function or value | Description |
Full Usage:
davisputnam002 fm
Parameters: Returns: int
The number of ground tuples needed to prove the validity and prints to
the stdout how many ground instances were tried, if the
procedure terminates (thus indicating that the formula is valid);
otherwise, loops indefinitely till the memory is full.
|
The difference with Herbrand.davisputnam is just that the number returned is not the number of ground instance generated but that of those that are really needed.
NoteThe procedure loops infinitely if the initial formula is not valid and even if it is, it is not guaranteed to end. Example
Evaluates to 3 and print to the stdout :
type 'T list = List<'T>
|
Full Usage:
dp_refine cjs0 fvs dunno need
Parameters:
formula<fol> list list
-
The input set of clauses.
fvs : string list
-
The free variables to instantiate to generate the ground terms.
dunno : term list list
-
The list of possibly-needed instances.
need : term list list
-
The list of really needed instances.
Returns: term list list
The list of really needed instances to refute the input set of clauses,
if there is one; otherwise, the input dunno itself in reverse
order.
|
Example
Evaluates to [[``f_y(c)``]; [``c``]] .
|
Full Usage:
dp_refine_loop cjs0 cntms funcs fvs n cjs tried tuples
Parameters:
formula<fol> list list
cntms : term list
-
The constant terms to generate the ground terms.
funcs : (string * int) list
-
The function symbols (name, arity) to generate the ground terms.
fvs : string list
-
The free variables to instantiate to generate the ground terms.
n : int
-
The number of function symbols the new ground terms to be generated should contain.
cjs : formula<fol> list list
tried : term list list
-
The instances tried.
tuples : term list list
-
The remaining ground instances in the current level.
Returns: term list list
The list of ground tuples needed to refute the input and prints to the
stdout how many ground instances were tried, if the procedure
terminates (thus indicating that the formula is valid); otherwise,
loops generating and testing larger and larger ground instances till
the memory is full.
|
The difference with Herbrand.dp_loop is just that the list returned is not the number of ground tuples generated but of those that are really needed to refute the input.
Example
Evaluates to [[``f_y(c)``; ``c``]] and print to
the stdout :
type 'T list = List<'T>
|