/**CFile*********************************************************************** FileName [ctlpCmd.c] PackageName [ctlp] Synopsis [Command to read in a file containing CTL formulas.] Author [Tom Shiple, In-Ho Moon] Copyright [Copyright (c) 1994-1996 The Regents of the Univ. of California. All rights reserved. Permission is hereby granted, without written agreement and without license or royalty fees, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following two paragraphs appear in all copies of this software. IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.] ******************************************************************************/ #include "ctlpInt.h" static char rcsid[] UNUSED = "$Id: ctlpCmd.c,v 1.14 2005/05/19 02:35:25 awedh Exp $"; /**AutomaticStart*************************************************************/ /*---------------------------------------------------------------------------*/ /* Static function prototypes */ /*---------------------------------------------------------------------------*/ static int CommandCtlpTest(Hrc_Manager_t ** hmgr, int argc, char ** argv); static int FormulaArrayCountSubformulae(array_t *formulaArray); static void FormulaVisitUnvisitedSubformulae(Ctlp_Formula_t *formula, int *ptr); /**AutomaticEnd***************************************************************/ /*---------------------------------------------------------------------------*/ /* Definition of exported functions */ /*---------------------------------------------------------------------------*/ /**Function******************************************************************** Synopsis [Initializes the CTL parser package.] SideEffects [] SeeAlso [Ctlp_End] ******************************************************************************/ void Ctlp_Init(void) { Cmd_CommandAdd("_ctlp_test", CommandCtlpTest, 0); } /**Function******************************************************************** Synopsis [Ends the CTL parser package.] SideEffects [] SeeAlso [Ctlp_Init] ******************************************************************************/ void Ctlp_End(void) { } /*---------------------------------------------------------------------------*/ /* Definition of internal functions */ /*---------------------------------------------------------------------------*/ /**Function******************************************************************** Synopsis [Sets the field states in every subformula of formula to NULL.] Description [The function sets the field states in every subformula of formula to NULL.] SideEffects [] ******************************************************************************/ void CtlpFormulaSetStatesToNULL( Ctlp_Formula_t *formula) { if(formula!=NIL(Ctlp_Formula_t)) { formula->states = NIL(mdd_t); if(formula->type != Ctlp_ID_c) { CtlpFormulaSetStatesToNULL(formula->left); CtlpFormulaSetStatesToNULL(formula->right); } } } /*---------------------------------------------------------------------------*/ /* Definition of static functions */ /*---------------------------------------------------------------------------*/ /**Function******************************************************************** Synopsis [Implements the _ctlp_test command.] Description [Implements the _ctlp_test command. This command is only meant to test the CTL command parser.] CommandName [_ctlp_test] CommandSynopsis [test the CTL parser] CommandArguments [\[-h\] <file_name>] CommandDescription [Test the CTL parser. If the entire file of CTL formulas is successfully parsed, then each formula is printed to stdout, followed by the equivalent existential normal form formula. The formulas read are not stored. For the input file containing:
AG(foo=bar);the following is produced:
original formula: AG(foo=bar) => equivalent existential formula: !(E(TRUE U !(foo=bar)))For the syntax of CTL formulas, refer to the VIS CTL and LTL syntax manual. Command options: