to decide... and "is not"?

Hi. There’s something here I don’t quite get. This might get embarrassing, but here we go:

Start out with a “to decide” phrase such as

To decide if the moon is gibbous:
	if the fullness of the moon is greater than 50, decide yes;
	decide no.

Now you can use it straight away in, for example, a description, using a [if the moon is gibbous] expression. But you can’t use a [if the moon is not gibbous], unless you also add

the moon can be gibbous or not gibbous.

Is the “not” in “if X is not Y” not a negation? It behaves more like “if it is true that x is not y”, rather than “if it is not true that x is y”. And I guess this makes sense given that you can declare stuff like “the moon can be full, gibbous, not gibbous or new” but it’s a bit confusing - it looks like a boolean test but it’s more of a comparison, is that it?

I guess you can do it like this:

if the moon is gibbous:

Is there some other way to do the boolean-type negation I was expecting in I7?

You don’t want to add that to your existing code. If you do, you’ll end up with a property (which is manually changeable) and a calculated value (defined in the decide phrase) which are unrelated (not linked together) but have the same conflicting syntax. This is a perfect time for a new adjective definition (see ch. 11.16. “New conditions, new adjectives” – bottom of page). Try:

[code]The description of the moon is “The moon is[if not gibbous] not gibbous.[else] gibbous.”

Definition: the moon is gibbous:
if the fullness of it is greater than 50, decide yes;
decide no.[/code]

Oh, I forgot to answer your actual question. With decide phrases like that, sometimes it’s where you place the “not” that mixes up the compiler’s parser. You could have kept your “to decide” phrase the way it was and just changed this:

The description of the moon is "The moon is[if not the moon is gibbous] not gibbous.[else] gibbous."

… but that isn’t very natural language-y. (Cue a chorus of groans.) :slight_smile:

You can also use “unless”.

Wow, thanks!

That’s several ways to do it, and my version was wrong.

So three ways to create a gibbous moon - with a property (“the moon can be gibbous”), a value (“to decide if the moon is gibbous:”) or an adjective (“definition: the moon is gibbous:”). I never saw it outlined like that. Are these the right words for it? Are there more ways to do this?

Any way will work, but pick one of them. Of course you define the “gibbousness” as a kind of value too, but then you’re still in the property business.

It seems like “unless” is a very good idea here to test for negatives - not only does it read more like english, it also works regardless of how you set it up.

What I’m getting is this:

  • value = “to decide” – works with “if not the moon is gibbous” or “unless the moon is gibbous”
  • adjective = “definition” – works with “if the moon is not gibbous” or “unless the moon is gibbous”
  • property - “the moon can be gibbous” – "works with “if the moon is not gibbous” or “unless the moon is gibbous”

I’m learning…

I think of the first thing as a phrase, or possibly a “phrase returning a value” or a “phrase to work out a value” or a “to decide which” phrase.

Not directly related, but very handy… If you have a phrase like this:

To decide whether foo with (parameter A - a value) and (parameter B - a value)

you can make it much more flexible by turning it into a conditional relation:

[code]Fooness relates a value (called parameter A) to a value (called parameter B) when foo with parameter A and parameter B.

The verb to be foo with implies the fooness relation.[/code]

The difference is that a phrase has to take a variable as an argument, while a relation can either take a variable or a description (“if A is foo with a frobbing B”). Plus, you can inflect the verb for pretty grammar and use the relation as part of a more complex description. (“Any blorbed A that is foo with a frobbing B”)