From 97fefe1fcca363a1317e066e7f4b99b9c1e9987b Mon Sep 17 00:00:00 2001 From: Stephane Glondu Date: Thu, 12 Jan 2012 16:02:20 +0100 Subject: Imported Upstream version 8.4~beta --- test-suite/complexity/guard.v | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test-suite/complexity/guard.v (limited to 'test-suite/complexity/guard.v') diff --git a/test-suite/complexity/guard.v b/test-suite/complexity/guard.v new file mode 100644 index 00000000..ceb7835a --- /dev/null +++ b/test-suite/complexity/guard.v @@ -0,0 +1,30 @@ +(* Examples to check that the guard condition does not evaluate + irrelevant subterms *) +(* Expected time < 1.00s *) +Require Import Bool. + +Fixpoint slow n := + match n with + | 0 => true + | S k => andb (slow k) (slow k) + end. + +Timeout 5 Time Fixpoint F n := + match n with + | 0 => 0 + | S k => + if slow 100 then F k else 0 + end. + +Fixpoint slow2 n := + match n with + | 0 => 0 + | S k => slow2 k + slow2 k + end. + +Timeout 5 Time Fixpoint F' n := + match n with + | 0 => 0 + | S k => + if slow2 100 then F' k else 0 + end. -- cgit v1.2.3