Example #1
0
        public Abs()
        {
            Left = new Node(
                $"Abs@{Id}:L",
                (self, g, v) =>
            {
                switch (v)
                {
                case Int i:
                    var g2 = g.BindVal(Right, Val.Int(Math.Abs(i.Value)));
                    return(g2, v);

                case Choice c:
                    var results = c.Values.Select(vv => self(self, g, vv)).ToArray();
                    throw new NotImplementedException();

                case Any _:
                    return(g, g.GetVal(Left));
Example #2
0
 public Constant(int value) : this(Val.Int(value))
 {
 }