sbv-13.1: SMT Based Verification: Symbolic Haskell theorem prover using SMT solving.
Copyright(c) Levent Erkok
LicenseBSD3
Maintainererkokl@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Documentation.SBV.Examples.TP.Kleene

Description

Example use of the TP layer, proving some Kleene algebra theorems.

Based on http://www.philipzucker.com/bryzzowski_kat/

Synopsis

Documentation

data Kleene Source #

An uninterpreted sort, corresponding to the type of Kleene algebra strings.

Instances

Instances details
Arbitrary Kleene Source # 
Instance details

Defined in Documentation.SBV.Examples.TP.Kleene

Num SKleene Source #

The Num instance for Kleene makes it easy to write regular expressions in the more familiar form.

Instance details

Defined in Documentation.SBV.Examples.TP.Kleene

SymVal Kleene Source # 
Instance details

Defined in Documentation.SBV.Examples.TP.Kleene

HasKind Kleene Source # 
Instance details

Defined in Documentation.SBV.Examples.TP.Kleene

cv2Kleene :: String -> [CV] -> Kleene Source #

Conversion from SMT values to Kleene values.

_undefiner_Kleene :: a Source #

Autogenerated definition to avoid unused-variable warnings from GHC.

type SKleene = SBV Kleene Source #

Symbolic version of the type Kleene.

star :: SKleene -> SKleene Source #

Star operator over kleene algebras. We're leaving this uninterpreted.

(<=) :: SKleene -> SKleene -> SBool Source #

The set of strings matched by one regular expression is a subset of the second, if adding it to the second doesn't change the second set.

kleeneProofs :: IO () Source #

A sequence of Kleene algebra proofs. See http://www.cs.cornell.edu/~kozen/Papers/ka.pdf

We have:

>>> kleeneProofs
Axiom: par_assoc
Axiom: par_comm
Axiom: par_idem
Axiom: par_zero
Axiom: seq_assoc
Axiom: seq_zero
Axiom: seq_one
Axiom: rdistrib
Axiom: ldistrib
Axiom: unfold
Axiom: least_fix
Lemma: par_lzero                        Q.E.D.
Lemma: par_monotone                     Q.E.D.
Lemma: seq_monotone                     Q.E.D.
Lemma: star_star_1
  Step: 1 (unfold)                      Q.E.D.
  Step: 2 (factor out x * star x)       Q.E.D.
  Step: 3 (par_idem)                    Q.E.D.
  Step: 4 (unfold)                      Q.E.D.
  Result:                               Q.E.D.
Lemma: subset_eq                        Q.E.D.
Lemma: star_star_2_2                    Q.E.D.
Lemma: star_star_2_3                    Q.E.D.
Lemma: star_star_2_1                    Q.E.D.
Lemma: star_star_2                      Q.E.D.