Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Isabelle/HOL/Nitpick_Examples/   (Isabelle Prover Version 2025-1©)  Datei vom 16.11.2025 mit Größe 2 kB image not shown  

Quelle  Hotel_Nits.thy   Sprache: Isabelle

 

(*  Title:      HOL/Nitpick_Examples/Hotel_Nits.thy
    Author:     Jasmin Blanchette, TU Muenchen
    Copyright   2010-2011

Nitpick example based on Tobias Nipkow's hotel key card formalization.
*)


section ‹Nitpick Example Based on Tobias Nipkow's Hotel Key Card
 Formalization
›

theory Hotel_Nits
imports Main
begin

nitpick_params [verbose, max_potential = 0, sat_solver = MiniSat,
                max_threads = 1, timeout = 240]

typedecl guest
typedecl key
typedecl room

type_synonym keycard = "key × key"

record state =
  owns :: "room → guest option"
  currk :: "room → key"
  issued :: "key set"
  cards :: "guest → keycard set"
  roomk :: "room → key"
  isin :: "room → guest set"
  safe :: "room → bool"

inductive_set reach :: "state set" where
init:
"inj initk ==>
 (owns = (λr. None), currk = initk, issued = range initk, cards = (λg. {}),
  roomk = initk, isin = (λr. {}), safe = (λr. True)) ∈ reach" |
check_in:
"[s ∈ reach; k ∉ issued s] ==>
 s(currk := (currk s)(r := k), issued := issued s ∪ {k},
   cards := (cards s)(g := cards s g ∪ {(currk s r, k)}),
   owns := (owns s)(r := Some g), safe := (safe s)(r := False)) ∈ reach" |
enter_room:
"[s ∈ reach; (k,k') ∈ cards s g; roomk s r ∈ {k,k'}] ==>
 s(isin := (isin s)(r := isin s r ∪ {g}),
   roomk := (roomk s)(r := k'),
   safe := (safe s)(r := owns s r = Some g ∧ isin s r = {} 🚫‹∧ k' = currk s r›
                         ∨ safe s r)) ∈ reach" |
exit_room:
"[s ∈ reach; g ∈ isin s r] ==> s(isin := (isin s)(r := isin s r - {g})) ∈ reach"

theorem safe: "s ∈ reach ==> safe s r ==> g ∈ isin s r ==> owns s r = Some g"
nitpick [card room = 1, card guest = 2, card "guest option" = 3,
         card key = 4, card state = 6, show_consts, format = 2,
         expect = genuine]
(* nitpick [card room = 1, card guest = 2, expect = genuine] *) (* slow *)
oops

end

Messung V0.5 in Prozent
C=92 H=72 G=82

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-09-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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.