Beispiel #1
0
 /// <summary>
 /// Returns matrix multiplication of matrices dd1 and dd2
 /// [Calculates the product of two matrices represented as ADDs.]
 /// Description [Calculates the product of two matrices, A and B,
 /// represented as ADDs. This procedure implements the quasiring multiplication
 /// algorithm.  A is assumed to depend on variables x (rows) and z
 /// (columns).  B is assumed to depend on variables z (rows) and y
 /// (columns).  The product of A and B then depends on x (rows) and y
 /// (columns).  Only the z variables have to be explicitly identified;
 /// they are the "summation" variables.  Returns a pointer to the
 /// result if successful; NULL otherwise.]
 /// [ REFS: 'result', DEREFS: 'dd1, dd2' ]
 /// </summary>
 /// <param name="dd1"></param>
 /// <param name="dd2"></param>
 /// <param name="vars">variable are shared by both dd1, dd2. Normally dd1 row + column, dd2 only column</param>
 /// <param name="method"></param>
 /// <returns></returns>
 public static CUDDNode MatrixMultiply(CUDDNode dd1, CUDDNode dd2, CUDDVars vars, int method)
 {
     return(new CUDDNode(PlatformInvoke.DD_MatrixMultiply(manager, dd1.Ptr, dd2.Ptr, vars.GetArrayPointer(), vars.GetNumVars(), method)));
 }
        public NondetModelChecker(NonDetModel model)
            : base(model)
        {
            allNondetVars = model.allNondetVars;

            FilterStates();

            CUDD.Ref(trans01, reach);
            nondetMask = CUDD.Function.And(CUDD.Function.Not(CUDD.Abstract.ThereExists(trans01, allColVars)), reach);

            Debug.WriteLine("States: " + CUDD.GetNumMinterms(reach, allRowVars.GetNumVars()) + " (" + CUDD.GetNumMinterms(start, allRowVars.GetNumVars()) + " initial)");
            Debug.WriteLine("Transitions: " + CUDD.GetNumMinterms(trans01, allRowVars.GetNumVars() * 2 + allNondetVars.GetNumVars()));
            Debug.WriteLine("Transition matrix: " + CUDD.Print.GetInfoString(trans, allRowVars.GetNumVars() * 2 + allNondetVars.GetNumVars()) +
                            ", vars: " + allRowVars.GetNumVars() + "r/" + allColVars.GetNumVars() + "c/" + allNondetVars.GetNumVars() + "nd");
        }
Beispiel #3
0
 /// <summary>
 /// Generates 0-1 ADD for the function x = y
 /// where x, y are num_vars-bit numbers encoded by variables x_vars, y_vars
 /// [ REFS: 'result', DEREFS: 'none' ]
 /// </summary>
 public static CUDDNode Identity(CUDDVars rVars, CUDDVars cVars)
 {
     return(new CUDDNode(PlatformInvoke.DD_Identity(manager, rVars.GetArrayPointer(), cVars.GetArrayPointer(), rVars.GetNumVars())));
 }
Beispiel #4
0
 /// <summary>
 /// Returns transpose of matrix dd
 /// [ REFS: 'result', DEREFS: 'dd' ]
 /// </summary>
 public static CUDDNode Transpose(CUDDNode dd, CUDDVars rVars, CUDDVars cVars)
 {
     return(new CUDDNode(PlatformInvoke.DD_Transpose(manager, dd.Ptr, rVars.GetArrayPointer(), cVars.GetArrayPointer(), rVars.GetNumVars())));
 }
Beispiel #5
0
 /// <summary>
 /// // sets element in 3d matrix dd
 /// [ REFS: 'result', DEREFS: 'dd' ]
 /// </summary>
 public static CUDDNode Set3DMatrixElement(CUDDNode dd, CUDDVars rVars, CUDDVars cVars, CUDDVars lVars, int rIndex, int cIndex, int lIndex, double value)
 {
     return(new CUDDNode(PlatformInvoke.DD_Set3DMatrixElement(manager, dd.Ptr, rVars.GetArrayPointer(), rVars.GetNumVars(), cVars.GetArrayPointer(), cVars.GetNumVars(), lVars.GetArrayPointer(), lVars.GetNumVars(), rIndex, cIndex, lIndex, value)));
 }
Beispiel #6
0
 /// <summary>
 /// Get element in vector dd
 /// [ REFS: 'none', DEREFS: 'none' ]
 /// </summary>
 public static double GetVectorElement(CUDDNode dd, CUDDVars vars, int index)
 {
     return(PlatformInvoke.DD_GetVectorElement(manager, dd.Ptr, vars.GetArrayPointer(), vars.GetNumVars(), index));
 }
Beispiel #7
0
 /// <summary>
 /// Sets element in matrix dd and return value.
 /// Note that this is a function, not a procedure
 /// [ REFS: 'result', DEREFS: 'dd' ]
 /// </summary>
 public static CUDDNode SetMatrixElement(CUDDNode dd, CUDDVars rVars, CUDDVars cVars, int rIndex, int cIndex, double value)
 {
     return new CUDDNode(PlatformInvoke.DD_SetMatrixElement(manager, dd.Ptr, rVars.GetArrayPointer(), rVars.GetNumVars(), cVars.GetArrayPointer(), cVars.GetNumVars(), rIndex, cIndex, value));
 }
Beispiel #8
0
 /// <summary>
 /// Set the value of i.th element in vector. i is allowed to be negative. -1 is the last element.
 /// Note that this is a function, not a procedure
 /// [ REFS: 'result', DEREFS: 'dd' ]
 /// </summary>
 public static CUDDNode SetVectorElement(CUDDNode dd, CUDDVars vars, int index, double value)
 {
     return(new CUDDNode(PlatformInvoke.DD_SetVectorElement(manager, dd.Ptr, vars.GetArrayPointer(), vars.GetNumVars(), index, value)));
 }
Beispiel #9
0
 /// <summary>
 /// Returns matrix multiplication of matrices dd1 and dd2
 /// [Calculates the product of two matrices represented as ADDs.]
 /// Description [Calculates the product of two matrices, A and B,
 /// represented as ADDs. This procedure implements the quasiring multiplication
 /// algorithm.  A is assumed to depend on variables x (rows) and z
 /// (columns).  B is assumed to depend on variables z (rows) and y
 /// (columns).  The product of A and B then depends on x (rows) and y
 /// (columns).  Only the z variables have to be explicitly identified;
 /// they are the "summation" variables.  Returns a pointer to the
 /// result if successful; NULL otherwise.]
 /// [ REFS: 'result', DEREFS: 'dd1, dd2' ]
 /// </summary>
 /// <param name="dd1"></param>
 /// <param name="dd2"></param>
 /// <param name="vars">variable are shared by both dd1, dd2. Normally dd1 row + column, dd2 only column</param>
 /// <param name="method"></param>
 /// <returns></returns>
 public static CUDDNode MatrixMultiply(CUDDNode dd1, CUDDNode dd2, CUDDVars vars, int method)
 {
     return new CUDDNode(PlatformInvoke.DD_MatrixMultiply(manager, dd1.Ptr, dd2.Ptr, vars.GetArrayPointer(), vars.GetNumVars(), method));
 }
Beispiel #10
0
 /// <summary>
 /// Generates 0-1 ADD for the function x = y
 /// where x, y are num_vars-bit numbers encoded by variables x_vars, y_vars
 /// [ REFS: 'result', DEREFS: 'none' ]
 /// </summary>
 public static CUDDNode Identity(CUDDVars rVars, CUDDVars cVars)
 {
     return new CUDDNode(PlatformInvoke.DD_Identity(manager, rVars.GetArrayPointer(), cVars.GetArrayPointer(), rVars.GetNumVars()));
 }
Beispiel #11
0
 /// <summary>
 /// Get element in vector dd
 /// [ REFS: 'none', DEREFS: 'none' ]
 /// </summary>
 public static double GetVectorElement(CUDDNode dd, CUDDVars vars, int index)
 {
     return PlatformInvoke.DD_GetVectorElement(manager, dd.Ptr, vars.GetArrayPointer(), vars.GetNumVars(), index);
 }
Beispiel #12
0
 /// <summary>
 /// Returns transpose of matrix dd
 /// [ REFS: 'result', DEREFS: 'dd' ]
 /// </summary>
 public static CUDDNode Transpose(CUDDNode dd, CUDDVars rVars, CUDDVars cVars)
 {
     return new CUDDNode(PlatformInvoke.DD_Transpose(manager, dd.Ptr, rVars.GetArrayPointer(), cVars.GetArrayPointer(), rVars.GetNumVars()));
 }
Beispiel #13
0
 /// <summary>
 /// Set the value of i.th element in vector. i is allowed to be negative. -1 is the last element.
 /// Note that this is a function, not a procedure
 /// [ REFS: 'result', DEREFS: 'dd' ]
 /// </summary>
 public static CUDDNode SetVectorElement(CUDDNode dd, CUDDVars vars, int index, double value)
 {
     return new CUDDNode(PlatformInvoke.DD_SetVectorElement(manager, dd.Ptr, vars.GetArrayPointer(), vars.GetNumVars(), index, value));
 }