Beispiel #1
0
 public ImmutableHashSet <object> VisitZenIfExpr <T>(ZenIfExpr <T> expression, Unit parameter)
 {
     return(LookupOrCompute(expression, () =>
     {
         var g = expression.GuardExpr.Accept(this, parameter);
         var t = expression.TrueExpr.Accept(this, parameter);
         var f = expression.FalseExpr.Accept(this, parameter);
         return g.Union(t).Union(f);
     }));
 }
Beispiel #2
0
        public Expression VisitZenIfExpr <T>(ZenIfExpr <T> expression, ExpressionConverterEnvironment parameter)
        {
            return(LookupOrCompute(expression, () =>
            {
                var guardExpr = expression.GuardExpr.Accept(this, parameter);

                var trueExpr = CodeGenerator.CompileToBlock(
                    expression.TrueExpr,
                    parameter,
                    this.SubexpressionCache,
                    this.currentMatchUnrollingDepth,
                    this.maxMatchUnrollingDepth);

                var falseExpr = CodeGenerator.CompileToBlock(
                    expression.FalseExpr,
                    parameter,
                    this.SubexpressionCache,
                    this.currentMatchUnrollingDepth,
                    this.maxMatchUnrollingDepth);

                return Expression.Condition(guardExpr, trueExpr, falseExpr);
            }));
        }
Beispiel #3
0
 public SymbolicValue <TModel, TVar, TBool, TInt, TString> VisitZenIfExpr <T1>(ZenIfExpr <T1> expression, SymbolicEvaluationEnvironment <TModel, TVar, TBool, TInt, TString> parameter)
 {
     return(LookupOrCompute(expression, () =>
     {
         var v = (SymbolicBool <TModel, TVar, TBool, TInt, TString>)expression.GuardExpr.Accept(this, parameter);
         var vtrue = expression.TrueExpr.Accept(this, parameter);
         var vfalse = expression.FalseExpr.Accept(this, parameter);
         return vtrue.Merge(v.Value, vfalse);
     }));
 }