当前位置: 首页>>代码示例>>C#>>正文


C# Z3Provider.MkListSort方法代码示例

本文整理汇总了C#中Z3Provider.MkListSort方法的典型用法代码示例。如果您正苦于以下问题:C# Z3Provider.MkListSort方法的具体用法?C# Z3Provider.MkListSort怎么用?C# Z3Provider.MkListSort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Z3Provider的用法示例。


在下文中一共展示了Z3Provider.MkListSort方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Const

 public Const(ConstDef def, FastTransducerInstance fti, Z3Provider z3p)
 {
     this.z3p = z3p;
     this.name = def.id.text;
     switch (def.sort.kind)
     {
         case (FastSortKind.Real):
             {
                 sort = z3p.RealSort;
                 break;
             }
         case (FastSortKind.Bool):
             {
                 sort = z3p.BoolSort;
                 break;
             }
         case (FastSortKind.Int):
             {
                 sort = z3p.IntSort;
                 break;
             }
         case (FastSortKind.String):
             {
                 sort = z3p.MkListSort(z3p.CharSort);
                 break;
             }
         case (FastSortKind.Tree):
             {
                 foreach (var enumSort in fti.enums)
                 {
                     if (enumSort.name == def.sort.name.text)
                     {
                         sort = enumSort.sort;
                         break;
                     }
                 }
                 break;
             }
     }
     this.value = GenerateZ3ExprFromExpr(def.expr, fti).Simplify();
 }
开发者ID:AutomataDotNet,项目名称:Automata,代码行数:41,代码来源:TransducersGenerator.cs

示例2: RankedAlphabetSort

        public RankedAlphabetSort(AlphabetDef def, Z3Provider z3p, FastTransducerInstance fti)
        {
            this.z3p = z3p;

            List<string> alphSymbols = new List<string>();
            List<int> alphArities = new List<int>();

            // Create list of symbols with corresponding arities
            foreach (var sym in def.symbols)
            {
                alphSymbols.Add(sym.name.text);
                alphArities.Add(sym.arity - 1);
            }

            alphFieldsSorts = new List<Sort>();
            tupleKeys = new List<String>();

            foreach (var field in def.attrSort.fieldSorts)
            {
                tupleKeys.Add(field.Key);
                switch (field.Value.kind)
                {
                    case (FastSortKind.Char):
                        {
                            alphFieldsSorts.Add(z3p.CharSort);
                            break;
                        }
                    case (FastSortKind.Real):
                        {
                            alphFieldsSorts.Add(z3p.RealSort);
                            break;
                        }
                    case (FastSortKind.Bool):
                        {
                            alphFieldsSorts.Add(z3p.BoolSort);
                            break;
                        }
                    case (FastSortKind.Int):
                        {
                            alphFieldsSorts.Add(z3p.IntSort);
                            break;
                        }
                    case (FastSortKind.String):
                        {
                            alphFieldsSorts.Add(z3p.MkListSort(z3p.CharSort));
                            break;
                        }
                    case (FastSortKind.Tree):
                        {
                            foreach (var enumSort in fti.enums)
                            {
                                if (enumSort.name == field.Value.name.text)
                                {
                                    alphFieldsSorts.Add(enumSort.sort);
                                    break;
                                }
                            }
                            break;
                        }
                }
            }

            this.tupleName = "$" + def.id.text;
            this.tupleTests = new FuncDecl[alphFieldsSorts.Count];
            var tupsymbs = new Symbol[tupleKeys.Count];
            int j = 0;
            foreach(var v in tupleKeys){
                tupsymbs[j]= z3p.Z3.MkSymbol(v);
                j++;
            }
            var tup = z3p.Z3.MkTupleSort(z3p.Z3.MkSymbol(tupleName), tupsymbs, alphFieldsSorts.ToArray());
            this.tupleSort = tup;
            this.tupleFuncDec = tup.MkDecl;
            this.tupleTests = tup.FieldDecls;

            this.alph = z3p.TT.MkRankedAlphabet(def.id.text, this.tupleSort, alphSymbols.ToArray(), alphArities.ToArray());
            this.alphName = def.id.text;
            this.alphSort = this.alph.AlphabetSort;
        }
开发者ID:AutomataDotNet,项目名称:Automata,代码行数:79,代码来源:TransducersGenerator.cs


注:本文中的Z3Provider.MkListSort方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。