On Saturday, 26 March 2016 at 22:11:53 UTC, Nordlöw wrote:
Partial implementation at
https://github.com/nordlow/justd/blob/master/fuzzy.d#L15
moved to
https://github.com/nordlow/justd/blob/master/nstate.d#L15
On Saturday, 26 March 2016 at 22:39:58 UTC, Alex Parrill wrote:
On Saturday, 26 March 2016 at 22:11:53 UTC, Nordlöw wrote:
I can think of many variants of for this. What about
{ yes, // 1 chance
no, // 0 chance
likely, // > 1/2 chance
unlikely, // < 1/2 chance
On Sunday, 27 March 2016 at 02:36:47 UTC, Alex Parrill wrote:
...
a && b == min(a, b)
a || b == max(a, b)
~a == N-1-a
why to optimize it more?
That's incorrect for the `unknown` value.
Lets say you represented true as 1f, false as 0f, and unknown
as NaN...
std.algorithm.max(0, 0f/0f) = 0,
On Saturday, 26 October 2013 at 21:05:36 UTC, Andrei Alexandrescu
wrote:
One challenge in Tristate (or the as-of-yet-unwritten
Fourstate) is to define the primitives |, &, ^, and ~ with
minimum of operations. For example Tristate still has
conditionals in two of them, which I think could be
On 03/26/2016 10:36 PM, Alex Parrill wrote:
N-state logic isn't just about probabilities either. According to
Wikipedia, Bochvar's three-valued logic has an "internal" state, where
any operation with `internal` results in `internal` (similar to NaN).
More broadly, the values and operations
On Sunday, 27 March 2016 at 02:19:56 UTC, crimaniak wrote:
On Saturday, 26 March 2016 at 22:39:58 UTC, Alex Parrill wrote:
...
If we're going down that route, might as well use state tables.
...
For Boolean, Ternary, and N-state logic:
a && b == min(a, b)
a || b == max(a, b)
~a == N-1-a
On Saturday, 26 March 2016 at 22:39:58 UTC, Alex Parrill wrote:
...
If we're going down that route, might as well use state tables.
...
For Boolean, Ternary, and N-state logic:
a && b == min(a, b)
a || b == max(a, b)
~a == N-1-a
why to optimize it more?
On Saturday, 26 March 2016 at 22:11:53 UTC, Nordlöw wrote:
On Saturday, 26 October 2013 at 15:41:32 UTC, Andrei
Alexandrescu wrote:
While messing with std.allocator I explored the type below. I
ended up not using it, but was surprised that implementing it
was quite nontrivial. Should we add it
On Saturday, 26 October 2013 at 15:41:32 UTC, Andrei Alexandrescu
wrote:
While messing with std.allocator I explored the type below. I
ended up not using it, but was surprised that implementing it
was quite nontrivial. Should we add it to stdlib?
I can think of many variants of for this. What
On 10/26/13, 17:42, Andrei Alexandrescu wrote:
unittest
{
Tristate a;
assert(a == Tristate.no);
Why not have '0' map to unknown? Seems to more useful, like float.nan
and the like.
L.
On 10/31/13 2:35 AM, Lionello Lunesu wrote:
On 10/26/13, 17:42, Andrei Alexandrescu wrote:
unittest
{
Tristate a;
assert(a == Tristate.no);
Why not have '0' map to unknown? Seems to more useful, like float.nan
and the like.
So logical operations are closer to the built-in Boolean
On 10/27/13, 11:07, Timon Gehr wrote:
On 10/27/2013 02:11 AM, Andrei Alexandrescu wrote:
On 10/26/13 5:13 PM, Timon Gehr wrote:
The following implementation does not use conditionals; probably
not minimal.
Thanks! Fixed two minor bugs:
this(bool b) { value = b; }
void opAssign(bool b) {
On 10/30/2013 04:43 PM, Lionello Lunesu wrote:
On 10/27/13, 11:07, Timon Gehr wrote:
On 10/27/2013 02:11 AM, Andrei Alexandrescu wrote:
On 10/26/13 5:13 PM, Timon Gehr wrote:
The following implementation does not use conditionals; probably
not minimal.
...
Couldn't this be optimized
27.10.2013 4:08, Timon Gehr пишет:
On 10/26/2013 05:42 PM, Andrei Alexandrescu wrote:
While messing with std.allocator I explored the type below. I ended up
not using it, but was surprised that implementing it was quite
nontrivial. Should we add it to stdlib?
Theory:
On 10/27/2013 02:11 AM, Andrei Alexandrescu wrote:
On 10/26/13 5:13 PM, Timon Gehr wrote:
The following implementation does not use conditionals; probably not
minimal.
Thanks! Fixed two minor bugs:
this(bool b) { value = b; }
void opAssign(bool b) { value = b; }
These should
While messing with std.allocator I explored the type below. I ended up
not using it, but was surprised that implementing it was quite
nontrivial. Should we add it to stdlib?
Theory: http://en.wikipedia.org/wiki/Three-state_logic
struct Tristate
{
private ubyte value;
private static
On 10/26/2013 8:42 AM, Andrei Alexandrescu wrote:
While messing with std.allocator I explored the type below. I ended up not using
it, but was surprised that implementing it was quite nontrivial. Should we add
it to stdlib?
Theory: http://en.wikipedia.org/wiki/Three-state_logic
When I worked
On 10/26/13 12:17 PM, Walter Bright wrote:
On 10/26/2013 8:42 AM, Andrei Alexandrescu wrote:
While messing with std.allocator I explored the type below. I ended up
not using
it, but was surprised that implementing it was quite nontrivial.
Should we add
it to stdlib?
Theory:
On 10/26/2013 05:42 PM, Andrei Alexandrescu wrote:
While messing with std.allocator I explored the type below. I ended up
not using it, but was surprised that implementing it was quite
nontrivial. Should we add it to stdlib?
Theory: http://en.wikipedia.org/wiki/Three-state_logic
The term
On 10/26/2013 11:06 PM, Andrei Alexandrescu wrote:
On 10/26/13 12:17 PM, Walter Bright wrote:
On 10/26/2013 8:42 AM, Andrei Alexandrescu wrote:
While messing with std.allocator I explored the type below. I ended up
not using
it, but was surprised that implementing it was quite nontrivial.
On 10/26/13 5:13 PM, Timon Gehr wrote:
The following implementation does not use conditionals; probably not
minimal.
Thanks! Fixed two minor bugs:
this(bool b) { value = b; }
void opAssign(bool b) { value = b; }
These should shift b so it becomes 2 if true.
Pushed your code
21 matches
Mail list logo