Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Roqc/test-suite/success/   (Beweissystem des Inria Version 9.1.0©)  Datei vom 15.8.2025 mit Größe 1 kB image not shown  

Quelle  tryif.v   Sprache: Coq

 
Require Import TestSuite.admit.

(** [not tac] is equivalent to [fail tac "succeeds"] if [tac] succeeds, and is equivalent to [idtac] if [tac] fails *)
Tactic Notation "not" tactic3(tac) :=
  (tryif tac then fail 0 tac "succeeds" else idtac); (* error if the tactic solved all goals *) [].

(** Test if a tactic succeeds, but always roll-back the results *)
Tactic Notation "test" tactic3(tac) := tryif not tac then fail 0 tac "fails" else idtac.

Goal Set.
Proof.
  not fail.
  not not idtac.
  not fail 0.
  (** Would be nice if we could get [not fail 1] to pass, maybe *)
  not not admit.
  not not test admit.
  not progress test admit.
  (* test grouping *)
  not (not idtac; fail).
  assert True.
  all:not fail.
  2:not fail.
  all:admit.
Defined.

Goal Set.
Proof.
  test idtac.
  test try fail.
  test admit.
  test match goal with |- Set => idtac end.
  test (idtacmatch goal with |- Set => idtac end).
  (* test grouping *)
  first [ (test idtac; fail); fail 1 | idtac ].
  try test fail.
  try test test fail.
  test test idtac.
  test test admit.
  Fail test fail.
  test (idtac; []).
  test (assert True; [|]).
  (* would be nice, perhaps, if we could catch [fail 1] and not just [fail 0] this *)
  try ((test fail); fail 1).
  assert True.
  all:test idtac.
  all:test admit.
  2:test admit.
  all:admit.
Defined.

Messung V0.5
C=93 H=96 G=94

¤ Dauer der Verarbeitung: 0.9 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.