Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dktactics
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Francois THIRE
dktactics
Commits
75dd3560
Commit
75dd3560
authored
May 05, 2018
by
Raphael Cauderlier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a typo in the word "literal"
parent
f255878e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
35 deletions
+35
-35
fol/clauses.dk
fol/clauses.dk
+4
-4
manual.org
manual.org
+4
-4
meta/resolution.dk
meta/resolution.dk
+27
-27
No files found.
fol/clauses.dk
View file @
75dd3560
...
...
@@ -3,13 +3,13 @@
atom : Type.
mk_atom : p : fol.predicate -> fol.terms (fol.pred_domain p) -> atom.
lit
t
eral : Type.
pos_lit : atom -> lit
t
eral.
neg_lit : atom -> lit
t
eral.
literal : Type.
pos_lit : atom -> literal.
neg_lit : atom -> literal.
clause : Type.
empty_clause : clause.
cons_clause : lit
t
eral -> clause -> clause.
cons_clause : literal -> clause -> clause.
qclause : Type.
qc_base : clause -> qclause.
...
...
manual.org
View file @
75dd3560
...
...
@@ -764,13 +764,13 @@ combinator) and then uses the classical lemma
that it does not handle the full syntax of first-order formulae but
only the CNF (clausal normal form) fragment.
A *lit
teral* is either an atom (a positive lit
teral) or the
negation of an atom (a negative lit
t
eral), a *clause* is a
disjunction of lit
terals. Lit
terals and clauses may contain free
A *lit
eral* is either an atom (a positive li
teral) or the
negation of an atom (a negative literal), a *clause* is a
disjunction of lit
erals. Li
terals and clauses may contain free
variables which are to be interpreted as universally quantified. A
*quantified clause* is an explicitly universally quantified clause.
The types for atoms, lit
t
erals, clauses, and quantified clauses are
The types for atoms, literals, clauses, and quantified clauses are
declared with their constructors in [[./fol/clauses.dk][fol/clauses.dk]]. However, the
simplest way to define a clause is by parsing the corresponding
proposition using the partial function
...
...
meta/resolution.dk
View file @
75dd3560
...
...
@@ -61,23 +61,23 @@ def unify_atoms_pb : clauses.atom -> clauses.atom -> unif.unify_problem.
def unify_atoms (a : clauses.atom) (a' : clauses.atom) : subst :=
get_subst (unif.unify' (unify_atoms_pb a a')).
(; a positive lit
teral is an atom, a negative lit
teral is the negation
(; a positive lit
eral is an atom, a negative li
teral is the negation
of an atom. ;)
def lprop : clauses.lit
t
eral -> prop.
def lprop : clauses.literal -> prop.
[a] lprop (clauses.pos_lit a) --> aprop a
[a] lprop (clauses.neg_lit a) --> not (aprop a).
def lproof (l : clauses.lit
t
eral) := proof (lprop l).
def lproof (l : clauses.literal) := proof (lprop l).
def unify_lit
terals : clauses.litteral -> clauses.lit
teral -> subst.
[a,a'] unify_lit
t
erals (clauses.pos_lit a) (clauses.pos_lit a') --> unify_atoms a a'
[a,a'] unify_lit
t
erals (clauses.neg_lit a) (clauses.neg_lit a') --> unify_atoms a a'.
def unify_lit
erals : clauses.literal -> clauses.li
teral -> subst.
[a,a'] unify_literals (clauses.pos_lit a) (clauses.pos_lit a') --> unify_atoms a a'
[a,a'] unify_literals (clauses.neg_lit a) (clauses.neg_lit a') --> unify_atoms a a'.
def unify_opposite_lit
terals : clauses.litteral -> clauses.lit
teral -> subst.
[a,a'] unify_opposite_lit
t
erals (clauses.pos_lit a) (clauses.neg_lit a') --> unify_atoms a a'
[a,a'] unify_opposite_lit
t
erals (clauses.neg_lit a) (clauses.pos_lit a') --> unify_atoms a a'.
def unify_opposite_lit
erals : clauses.literal -> clauses.li
teral -> subst.
[a,a'] unify_opposite_literals (clauses.pos_lit a) (clauses.neg_lit a') --> unify_atoms a a'
[a,a'] unify_opposite_literals (clauses.neg_lit a) (clauses.pos_lit a') --> unify_atoms a a'.
(; a clause is a list of lit
t
erals (interpreted as their disjuction) ;)
(; a clause is a list of literals (interpreted as their disjuction) ;)
def cprop : clauses.clause -> prop.
[] cprop clauses.empty_clause --> false
...
...
@@ -85,7 +85,7 @@ def cprop : clauses.clause -> prop.
def cproof (C : clauses.clause) := proof (cprop C).
(; /!\ nth_lit n C does not fully reduce if n ≥ lenght(C) ;)
def nth_lit : nat -> clauses.clause -> clauses.lit
t
eral.
def nth_lit : nat -> clauses.clause -> clauses.literal.
[l] nth_lit nat.O (clauses.cons_clause l _) --> l
[n,C] nth_lit (nat.S n) (clauses.cons_clause _ C) --> nth_lit n C.
...
...
@@ -129,20 +129,20 @@ def clause_append_correct : C : clauses.clause -> D : clauses.clause -> proof (o
(HD => or_intro_2 (lprop l) (cprop (clause_append C D))
(clause_append_correct C D (or_intro_2 (cprop C) (cprop D) HD))).
(; /!\ very partial function, reduces only if l and l' are opposite lit
t
erals ;)
def magic_imp : l : clauses.lit
teral -> l' : clauses.lit
teral -> lproof l -> lproof l' -> proof false.
(; /!\ very partial function, reduces only if l and l' are opposite literals ;)
def magic_imp : l : clauses.lit
eral -> l' : clauses.li
teral -> lproof l -> lproof l' -> proof false.
[a,H,H'] magic_imp (clauses.pos_lit a) (clauses.neg_lit a) H H' --> fol.imp_elim (aprop a) false H' H
[a,H,H'] magic_imp (clauses.neg_lit a) (clauses.pos_lit a) H H' --> fol.imp_elim (aprop a) false H H'.
(; /!\ magic_or_imp l C H only reduces if l ∈ C ;)
def magic_or_imp : l : clauses.lit
t
eral -> C : clauses.clause -> lproof l -> cproof C.
def magic_or_imp : l : clauses.literal -> C : clauses.clause -> lproof l -> cproof C.
[l,C] magic_or_imp l (clauses.cons_clause l C) -->
or_intro_1 (lprop l) (cprop C)
[l1,l2,C] magic_or_imp l1 (clauses.cons_clause l2 C) -->
H => or_intro_2 (lprop l2) (cprop C) (magic_or_imp l1 C H).
(; /!\ magic_remove l C H only reduces if l ∈ C ;)
def magic_remove (l : clauses.lit
t
eral) (C : clauses.clause) (H : cproof (clauses.cons_clause l C)) : cproof C :=
def magic_remove (l : clauses.literal) (C : clauses.clause) (H : cproof (clauses.cons_clause l C)) : cproof C :=
fol.or_elim (lprop l) (cprop C) (cprop C) H
(magic_or_imp l C) (HC => HC).
...
...
@@ -333,7 +333,7 @@ def remove_nth_q : nat -> clauses.qclause -> clauses.qclause.
[n,A,p] remove_nth_q n (clauses.qc_all A p) -->
clauses.qc_all A (x => remove_nth_q n (p x)).
(; /!\ remove_nth_q_correct only reduces if the nth clauses.lit
t
eral in Q appears twice ;)
(; /!\ remove_nth_q_correct only reduces if the nth clauses.literal in Q appears twice ;)
def remove_nth_q_correct : n : nat -> Q : clauses.qclause -> qcproof Q -> qcproof (remove_nth_q n Q).
[n,C,H] remove_nth_q_correct n (clauses.qc_base C) H -->
magic_remove (nth_lit n C) (remove_nth n C) (cycle_nth_correct n C H)
...
...
@@ -341,12 +341,12 @@ def remove_nth_q_correct : n : nat -> Q : clauses.qclause -> qcproof Q -> qcproo
fol.all_intro A (x => qcprop (remove_nth_q n (p x)))
(x => remove_nth_q_correct n (p x) (fol.all_elim A (x => qcprop (p x)) H x)).
(; only reduces if the ith and jth lit
t
erals are unifiable ;)
def unify_lit
t
erals_q : nat -> nat -> Q : clauses.qclause -> qc_subst Q.
[i,j,C] unify_lit
t
erals_q i j (clauses.qc_base C) -->
unify_lit
t
erals (nth_lit i C) (nth_lit j C)
[i,j,P] unify_lit
t
erals_q i j (clauses.qc_all _ P) -->
x => unify_lit
t
erals_q i j (P x).
(; only reduces if the ith and jth literals are unifiable ;)
def unify_literals_q : nat -> nat -> Q : clauses.qclause -> qc_subst Q.
[i,j,C] unify_literals_q i j (clauses.qc_base C) -->
unify_literals (nth_lit i C) (nth_lit j C)
[i,j,P] unify_literals_q i j (clauses.qc_all _ P) -->
x => unify_literals_q i j (P x).
(; remove useless quantifications, that is quantifications on unused variables ;)
(; removes quantifers on unused variables ;)
...
...
@@ -366,12 +366,12 @@ def unquantify_correct : Q : clauses.qclause -> qcproof Q -> qcproof (unquantify
(x => unquantify_correct (P x) (fol.all_elim A (x => qcprop (P x)) H x)).
def factor (i : nat) (j : nat) (Q : clauses.qclause) : clauses.qclause :=
remove_nth_q j (qclause_specialize Q (lqc_subst Q (unify_lit
t
erals_q i j Q))).
remove_nth_q j (qclause_specialize Q (lqc_subst Q (unify_literals_q i j Q))).
def factor_correct (i : nat) (j : nat) (Q : clauses.qclause) (H : qcproof Q) : qcproof (factor i j Q) :=
remove_nth_q_correct j
(qclause_specialize Q (lqc_subst Q (unify_lit
t
erals_q i j Q)))
(qclause_specialize_correct Q (lqc_subst Q (unify_lit
t
erals_q i j Q)) H).
(qclause_specialize Q (lqc_subst Q (unify_literals_q i j Q)))
(qclause_specialize_correct Q (lqc_subst Q (unify_literals_q i j Q)) H).
(; Universally quantified pairs of clauses (of the form
∀x₁…∀xₙ. C∧D). This is usefull as an intermediate shape for the
...
...
@@ -443,7 +443,7 @@ def qclause_merge_correct : Q : clauses.qclause -> Q' : clauses.qclause -> qcpro
def biclause_unify : nat -> nat -> B : biclause -> bc_subst B.
[i,j,C,D] biclause_unify i j (bc_base (bclause_i C D)) -->
unify_opposite_lit
t
erals (nth_lit i C) (nth_lit j D)
unify_opposite_literals (nth_lit i C) (nth_lit j D)
[i,j,A,P] biclause_unify i j (bc_all A P) -->
x => biclause_unify i j (P x).
...
...
@@ -634,7 +634,7 @@ def atom_of_prop_correct : p : prop -> proof p -> aproof (atom_of_prop p).
def atom_of_prop_complete : p : prop -> aproof (atom_of_prop p) -> proof p.
[H] atom_of_prop_complete (fol.apply_pred _ _) H --> H.
def lit_of_prop : prop -> clauses.lit
t
eral.
def lit_of_prop : prop -> clauses.literal.
[p] lit_of_prop (fol.imp p fol.false) --> clauses.neg_lit (atom_of_prop p)
[p] lit_of_prop p --> clauses.pos_lit (atom_of_prop p).
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment