Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Isabelle/Archive-of-Formal-Proofs/thys/Auto2_HOL/   (Sammlung formaler Beweise Version 2026-5©)  Datei vom 31.4.2026 mit Größe 1 kB image not shown  

Quelle  consts.ML

  Sprache: SML
 

(*
  File: consts.ML
  Author: Bohua Zhan

  Dealing with constants.
*)


signature CONSTS =
sig
  val add_const_data: string * (term -> bool) -> theory -> theory
  val detect_const: theory -> term -> string option
  val detect_const_ctxt: Proof.context -> term -> string option
  val is_const: theory -> term -> bool
  val is_const_ctxt: Proof.context -> term -> bool
  val neq_const: theory -> term * term -> bool
  val neq_const_ctxt: Proof.context -> term * term -> bool
end;

structure Consts : CONSTS =
struct

(* Table of detectors for constants, each registered under a
   descriptive name.
 *)

structure Data = Theory_Data
(
  type T = ((term -> bool) * serial) Symtab.table;
  val empty = Symtab.empty;
  val merge = Symtab.merge (eq_snd op =);
)

fun add_const_data (str, f) =
    Data.map (Symtab.update_new (str, (f, serial ())))

fun detect_const thy t =
    let
      val data = Symtab.dest (Data.get thy)
    in
      get_first (fn (str, (f, _)) => if f t then SOME str else NONE) data
    end

fun detect_const_ctxt ctxt t =
    detect_const (Proof_Context.theory_of ctxt) t

fun is_const thy t =
    is_some (detect_const thy t)

fun is_const_ctxt ctxt t =
    is_const (Proof_Context.theory_of ctxt) t

(* Whether two constants are of the same type and not equal. If either
   input is not a constant, return false.
 *)

fun neq_const thy (t1, t2) =
    let
      val ty1 = the (detect_const thy t1)
      val ty2 = the (detect_const thy t2)
    in
      ty1 = ty2 andalso not (t1 aconv t2)
    end
    handle Option.Option => false

fun neq_const_ctxt ctxt (t1, t2) =
    neq_const (Proof_Context.theory_of ctxt) (t1, t2)

end  (* structure Consts. *)

Messung V0.5 in Prozent
C=93 H=98 G=95

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-06-10) ¤

*© 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.