(* Title: BDD Author: Veronika Ortner and Norbert Schirmer, 2004 Maintainer: Norbert Schirmer, norbert.schirmer at web de License: LGPL *) (* General.thy Copyright (C) 2004-2008 Veronika Ortner and Norbert Schirmer Some rights reserved, TU Muenchen This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *) section ‹General Lemmas on BDD Abstractions› theory General imports BinDag begin definition subdag_eq:: "dag ⇒ dag ⇒ bool" where "subdag_eq t⇩1 t⇩2 = (t⇩1 = t⇩2 ∨ subdag t⇩1 t⇩2)" (*"subtree_eq Tip t = (if t = Tip then True else False)" "subtree_eq (Node l a r) t = (t=(Node l a r) ∨ subtree_eq l t ∨ subtree_eq r t)"*) primrec root :: "dag ⇒ ref" where "root Tip = Null" | "root (Node l a r) = a" fun isLeaf :: "dag ⇒ bool" where "isLeaf Tip = False" | "isLeaf (Node Tip v Tip) = True" | "isLeaf (Node (Node l v⇩1 r) v⇩2 Tip) = False" | "isLeaf (Node Tip v⇩1 (Node l v⇩2 r)) = False"