Skip to Content.
Sympa Menu

coq-club - [Coq-Club] eval compute rule

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] eval compute rule


chronological Thread 
  • From: Fl�vio Leonardo Cavalcanti de Moura <flaviomoura AT unb.br>
  • To: coq-club AT pauillac.inria.fr
  • Subject: [Coq-Club] eval compute rule
  • Date: Mon, 19 Oct 2009 15:41:46 -0200
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

Hi,

 I am building an exercise in proposicional logic for undergraduate
students. I defined a recursive function to propagate negations over
conjunctions and disjunction (de Morgan laws) and to eliminate double
negations. Here is the function:

 Function nnf (t:fprop) {measure flength t}: fprop :=
  match t with
    | neg(neg F) => nnf F
    | con F G => con (nnf F) (nnf G)
    | dis F G => dis (nnf F) (nnf G)
    | neg(con F G) => dis (nnf (neg F)) (nnf (neg G))
    | neg(dis F G) => con (nnf (neg F)) (nnf (neg G))
    | _ => t
  end.

The type fprop is inductive. The proof of termination of nnf is simple;
when I try to use "Eval compute" to run some examples the reduction is
not performed...

When I try 

Eval compute in (nnf(neg(con (var "p") (var "q")))). 

I get

  = let (v, _) := nnf_terminate (neg (con (var "p") (var "q"))) in v
     : fprop

What should I do in order to get (dis (neg (var "p")) (neg (var "q")))?

Thanks in advance, 

Flavio.






Archive powered by MhonArc 2.6.16.

Top of Page