Skip to Content.
Sympa Menu

coq-club - RE: [Coq-Club] Coq's performance over destruct tactic

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

RE: [Coq-Club] Coq's performance over destruct tactic


Chronological Thread 
  • From: "Soegtrop, Michael" <michael.soegtrop AT intel.com>
  • To: "coq-club AT inria.fr" <coq-club AT inria.fr>
  • Subject: RE: [Coq-Club] Coq's performance over destruct tactic
  • Date: Tue, 8 May 2018 07:34:35 +0000
  • Accept-language: de-DE, en-US
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=michael.soegtrop AT intel.com; spf=Pass smtp.mailfrom=michael.soegtrop AT intel.com; spf=None smtp.helo=postmaster AT mga04.intel.com
  • Dlp-product: dlpe-windows
  • Dlp-reaction: no-action
  • Dlp-version: 11.0.200.100
  • Ironport-phdr: 9a23:hxNW1x2kr9TCyu6xsmDT+DRfVm0co7zxezQtwd8ZseISLPad9pjvdHbS+e9qxAeQG9mDsLQc06L/iOPJYSQ4+5GPsXQPItRndiQuroEopTEmG9OPEkbhLfTnPGQQFcVGU0J5rTngaRAGUMnxaEfPrXKs8DUcBgvwNRZvJuTyB4Xek9m72/q99pHPbQhEniaxba9vJxiqsAvdsdUbj5F/Iagr0BvJpXVIe+VSxWx2IF+Yggjx6MSt8pN96ipco/0u+dJOXqX8ZKQ4UKdXDC86PGAv5c3krgfMQA2S7XYBSGoWkx5IAw/Y7BHmW5r6ryX3uvZh1CScIMb7S60/Vza/4KdxUBLmiDkJOSMl8G/ZicJwgqBUoBO9qBNw2IPbep2ZOf5kc6/BYd8XR2xMVdtRWSxbBYO8apMCA+QcM+ZfsYb9qEcOrQG5BQm0HO/k1zhGhn7q0q06yesuDwXG0AI9FN8JtXTUrcn6NKcIXu+ryKnE1y7Db/RI1jfy9IjIaBchoemXULJxd8rR1VcgFwffglqMrozlOiqY2+IQuGaV6OpgUPigi28hqwxpozivwNsshZfNho4P11/L6yN0y5s2K92gUEN3fNqpHIVKuyyaN4Z6WMMvT39ytCon1LEKpYa3cDULxZkp3RLSZfKKf5KW7h/tUOudOyp0iXF7dL6nmhq/8EytxvfiWsS031tGtDRJnsPSun0C0xHe7NWMROFn8Ue7wzmP0hje6uFaLkAwkqrWM5shwrEqmZYPvknPBC72mEPqjKCIckUo4PSn6+PiYrn+p5+cMZF7ih3mP6gznsGzH/40PwgOUmSB+emwyqfv8VDnTLlWlvE2l7PWsJHeJcQVvK65BApV354m6xa+Ezim0M4XkmcDLF5fYxKHiJbmO17SIPDiCve/m0+hkDZtx/DaILLhBo/BIWTEkLfkZbp98VJTyBIvzdBD4JJZEq0OIPXqWkPoqNPYCgI5PBevzub8CNR905seVniVDq+YNqPSq16I6fg1L+mCfo9G8Ar6frIu4Oerhnskk3cce7Oo1N0ZcjrwSv9hOgCSZWfmqtYHC2YD+AQkGr/EklqHBHRoYHu9Q7g7/nVzLYOtDY7OQsrl1LmA1yeyE5kQfWdLBUyWFm/AdoOYVvNKYyWXdJwy2gcYXKSsHtdynSqlsxX3nuI+f7jkvxYAvJem7+BboujalBU87ztxVp3P0meRQmUylWQNFWZvgPJP5Hdlw1LG6pBWxuRCHIUKtfJPTgo+c5Xbyr4iUo2gakf6Zt6MDW2ebJCmDDU2F41jxtAHOxo7GtO+gxSF1C2vUecY

Dear Wilayat,

 

> I am wondering, if there is any systemic study/analysis assessing the

> performance of Coq over *destruct* tactic (in particular case analysis

> on inductive type bool) and comparing Coq (or interactive theorem

> provers in general) with automatic solvers.

 

Since the number of cases obviously rises exponentially with the number of variables destructed in parallel, it is obvious that the compute time rises exponentially as well. Destructing increasing numbers of variables in Coq is not a really fruitful approach. You should try to take some shortcuts, e.g. see that after destructing 2 variables you see that the others need only be destructed in one case. With 14 variables you end up with 16.384 cases – 14s is not bad for this – less than 1ms per case.

 

What helps me in many cases is a tactic I wrote which destructs the argument of the first match in the goal. This usually helps to destruct only those variables which need to be destructed in order to make progress and keep the number of cases reasonably small.

 

Best regards,

 

Michael

 

P.S.: The tactic I am using looks something like below. It is a bit cut down – my version contains some additional boiler plate code to avoid backwards rewriting with destruct equations.

 

(* In nested matches, get the argument of the inner most match *)

 

Local Ltac GetInnerMatch term :=

  match term with

  | context [match ?inner with _ => _ end] => GetInnerMatch inner

  | _ => term

  end.

 

(**  Destruct the argument of a match in the goal or hypothesis *)

 

Ltac DestructMatchArg :=

  match goal with

  | |- context [match ?term with _ => _ end] =>

    let EQ:=fresh "EQ_DestructMatchArg" in

    let inner:=GetInnerMatch term in

    destruct inner eqn:EQ;

  | H: context [match ?term with _ => _ end] |- _ =>

    let EQ:=fresh "EQ_DestructMatchArgInHyp" in

    let inner:=GetInnerMatch term in

    destruct inner eqn:EQ;

  end.

 

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928




Archive powered by MHonArc 2.6.18.

Top of Page