Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IMP - Not this old chestnut again
#11
Well Tempodi, seems Gossip IMP Nudity. Takes my Girl/Boy IMP  Pink/Blue to a new level. Did you notice how many males in that video wore blue?

I liked that Wikipedia article as well. Seems to agree that IMP works better with numeric than normal language logic.

I gather you are not a fan of Gemini??
Reply
#12
(10-19-2024, 08:21 PM)Dimster Wrote: Well Tempodi, seems Gossip IMP Nudity. Takes my Girl/Boy IMP  Pink/Blue to a new level. Did you notice how many males in that video wore blue?

I liked that Wikipedia article as well. Seems to agree that IMP works better with numeric than normal language logic.

I gather you are not a fan of Gemini??

yeah (Gossip = true) IMP (Nudity = true)   --> IsAGirl = ( (Girl = Pink) IMP (gender = Pink))  XOR  IsABoy = ((Boy = Blue) IMP (gender = Blue))

here a simple example
Code: (Select All)

Rem  demo getting gender from choosen color
pink = -1
Girl = pink
blue = 0
Boy = blue
Print "I'll say your gender if you answer correctly to the following question.."
Input "What color do you choose? pink/blue--> ", col$
col$ = LCase$(col$)
If col$ = "pink" Then
    gender = -1
ElseIf col$ = "blue" Then
    gender = 0
Else
    Print " wrong input...quitting"
    End
End If


IsAGirl = (Girl = pink) Imp (gender = pink)
IsABoy = ((Boy = blue) Imp (gender = blue))
Print "Gender      Girl          Boy"
Print gender, IsAGirl, IsABoy
If gender = 0 Then
    Print " Boy ";
ElseIf gender = -1 Then
    Print " Girl";
End If


If IsAGirl = 0 Then
    Print "        False ";
ElseIf IsAGirl = -1 Then
    Print "        True ";
End If

If IsABoy = 0 Then
    Print "        False  "
ElseIf IsABoy = -1 Then
    Print "        True  "
End If

please copy, paste, save and then run it.

About AI, I cannot say more about them because I haven't ever used them (Chatgpt, Gemini, Aria and others).
It is a sentiment and not a rational think my position for now. Thinking in general lines: AI is all you put into it and you can fall in the mistake of sillogism, a wrong hypothesis generates a wrong deduction.
This lead the thinking from Aristotele to Hume and then to Kant and Wittingstein, ending with Popper.

Who don't know the tell of the turkey?.
A coscient and thinking turkey was born in a farm, and day after day it get the truth that the farmer was a good man and he was loving it.
The rule got by deduction method was every day the sun goes up in the sky and the farmer loves it giving it food.
This rule was true for all the days of its life until the thanksgiving day! 
Wink

Aristotele (Aristotle english)
Hume
Kant
Wittgenstein
Popper
Reply
#13
I appreciate the IMP code, I have added it to my collection of IMP sample codes. By the way, do you recall this one?

Code: (Select All)
'IMP demo in multiple cases
Randomize Timer
_Title "IMProbable Demonstrations of the IMPossible Logic Operator named IMP..."
'demo  OutOfRange  InTheRange Lowest Uppest
Do
    n$ = UCase$(InKey$)
    If n$ = Chr$(27) Then End
    If n$ <> "" And InStr("OILU", n$) Then
        Cls
        For a = 1 To 10
            b = Int(Rnd * 40) + 1
            c = Int(Rnd * 30) + 2 + b
            d = Int(Rnd * 79) + 1
            Locate (a - 1) * 2 + 1, 1
            Print b; "  "; c; "  "; d; "  ";
            If n$ = "O" Then If outheRange(b, c, d) Then Print "out of range "; ' Else Print "in the range ";
            If n$ = "I" Then If intheRange(b, c, d) = -1 Then Print "In the range<---";
            If n$ = "L" Then If Lowest(b, c, d) Then Print "lowest  is "; d
            If n$ = "U" Then If Uppest(b, c, d) Then Print "Uppest  is "; d
            ' graphic rappresentation
            Color 2, 0: Locate (a - 1) * 2 + 2, b: Print ">";: Locate , c: Print "<";: Color 14, 0: Locate , d: Print "O";: Color 7, 0
        Next a
    End If
    Locate 23, 1: Print " Outherange Intherange Lowest Uppest, Escape to quit"
    Color 14, 0: Locate 23, 2: Print "O";: Locate 23, 13: Print "I";: Locate 23, 24: Print "L";: Locate 23, 31: Print "U";: Color 7, 0
    _Limit 10
Loop


' SUB and FUNCTION area  / area delle SUB e delle FUNCTION
Function outheRange (min As Integer, max As Integer, value As Integer)
    outheRange = 0
    outheRange = (min <= value Imp value >= max)
End Function

Function intheRange (min As Integer, max As Integer, value As Integer)
    intheRange = 0
    intheRange = (value <= max) Imp (value <= min)
    intheRange = Not intheRange
End Function

Function Lowest (a1%, a2%, T%)
    'NOT a OR b
    '3 8 1 -> F imp F = T
    '3 8 4 -> T imp F = F  no lowest
    '5 3 2 -> F imp T = T
    '6 4 9 -> T imp T = T  --> bug that it solves ordering a1% vs a2%
    If a1% > a2% Then Swap a1%, a2%
    Lowest = a1% < T% Imp a1% > a2%
End Function

Function Uppest (a1%, a2%, T%)
    'NOT a OR b
    '3 8 9 -> F imp T = T
    '3 2 6 -> F imp F = T
    '5 6 2 -> T imp T = T  -->bug  that it solves ordering a1% vs a2%
    '6 4 2 -> T imp F = F no uppest
    If a1% < a2% Then Swap a1%, a2%
    Uppest = a1% > T% Imp a1% < a2%
End Function
I get an error on the "Function intheRange" but love the Title of the program.

In terms of using AI, I'm afraid that train has left the station, we are going to be inundated with it.
Interesting you have mentioned Popper, it is his falsification theory that I find my computer understands the most ( ie A theory is Valid Until Proven False). Trouble is my computer is suggesting more of my theories are proven false than true. New Theory, I think my computer has a drinking problem.
Reply
#14
(10-22-2024, 04:51 PM)Dimster Wrote: I appreciate the IMP code, I have added it to my collection of IMP sample codes. By the way, do you recall this one?

Code: (Select All)
'IMP demo in multiple cases
Randomize Timer
_Title "IMProbable Demonstrations of the IMPossible Logic Operator named IMP..."
'demo  OutOfRange  InTheRange Lowest Uppest
Do
    n$ = UCase$(InKey$)
    If n$ = Chr$(27) Then End
    If n$ <> "" And InStr("OILU", n$) Then
        Cls
        For a = 1 To 10
            b = Int(Rnd * 40) + 1
            c = Int(Rnd * 30) + 2 + b
            d = Int(Rnd * 79) + 1
            Locate (a - 1) * 2 + 1, 1
            Print b; "  "; c; "  "; d; "  ";
            If n$ = "O" Then If outheRange(b, c, d) Then Print "out of range "; ' Else Print "in the range ";
            If n$ = "I" Then If intheRange(b, c, d) = -1 Then Print "In the range<---";
            If n$ = "L" Then If Lowest(b, c, d) Then Print "lowest  is "; d
            If n$ = "U" Then If Uppest(b, c, d) Then Print "Uppest  is "; d
            ' graphic rappresentation
            Color 2, 0: Locate (a - 1) * 2 + 2, b: Print ">";: Locate , c: Print "<";: Color 14, 0: Locate , d: Print "O";: Color 7, 0
        Next a
    End If
    Locate 23, 1: Print " Outherange Intherange Lowest Uppest, Escape to quit"
    Color 14, 0: Locate 23, 2: Print "O";: Locate 23, 13: Print "I";: Locate 23, 24: Print "L";: Locate 23, 31: Print "U";: Color 7, 0
    _Limit 10
Loop


' SUB and FUNCTION area  / area delle SUB e delle FUNCTION
Function outheRange (min As Integer, max As Integer, value As Integer)
    outheRange = 0
    outheRange = (min <= value Imp value >= max)
End Function

Function intheRange (min As Integer, max As Integer, value As Integer)
    intheRange = 0
    intheRange = (value <= max) Imp (value <= min)
    intheRange = Not intheRange
End Function

Function Lowest (a1%, a2%, T%)
    'NOT a OR b
    '3 8 1 -> F imp F = T
    '3 8 4 -> T imp F = F  no lowest
    '5 3 2 -> F imp T = T
    '6 4 9 -> T imp T = T  --> bug that it solves ordering a1% vs a2%
    If a1% > a2% Then Swap a1%, a2%
    Lowest = a1% < T% Imp a1% > a2%
End Function

Function Uppest (a1%, a2%, T%)
    'NOT a OR b
    '3 8 9 -> F imp T = T
    '3 2 6 -> F imp F = T
    '5 6 2 -> T imp T = T  -->bug  that it solves ordering a1% vs a2%
    '6 4 2 -> T imp F = F no uppest
    If a1% < a2% Then Swap a1%, a2%
    Uppest = a1% > T% Imp a1% < a2%
End Function
I get an error on the "Function intheRange" but love the Title of the program.

In terms of using AI, I'm afraid that train has left the station, we are going to be inundated with it.
Interesting you have mentioned Popper, it is his falsification theory that I find my computer understands the most ( ie A theory is Valid Until Proven False). Trouble is my computer is suggesting more of my theories are proven false than true. New Theory, I think my computer has a drinking problem.
Hey Boy
do you bring me a code that is familiar to me!  Smile

You get error after pasting this code into QB64peIDE because it had been written when there was an issue about Function parsing.
After correction of that issue the line of code
Code: (Select All)

InTheRange = NOT InTheRange
activates an error warning of calling InTheRange without parameters.
So to use NOT on the result of IMP operator we must use a TeMPorary variable tmp and then assign to the function InTheRange the correct result.

here code:
Code: (Select All)

Function intheRange (min As Integer, max As Integer, value As Integer)
    intheRange = 0
    tmp = (value <= max) Imp (value <= min)
    intheRange = Not tmp
    '  intheRange = Not intheRange        REM <----------- this instruction is an error now that compiler solved the issue about functions
End Function

So do you like my little IMProbable IMP library? Thanks

Dear Dimster about Karl Popper
he said that a theory is true if you can falsificate it! So it is true when you prove that it is false. Falsification by Popper

these ideas are born for correcting the affirmations of the Vienna Circle, that starting from Wittgenstein's Tractatus, about  the verification (finding proves to confirm a theory) is at the root of the scientific research.  Vienna Circle
Neopositivism

Fine to talk about phylosophy in an ocean of bits 0/1!

Thanks moreover to let me correct my IMProbale IMP library.
Reply
#15
(10-16-2024, 02:57 PM)Dimster Wrote: While Gemini was thinking the above was an issue for IMP dealing with string values it told me QB64PE could have a bug in its application of IMP after the following code using IMP was tested :

Code: (Select All)
Input "Enter your age: ", age
isADULT = age >= 18

If isADULT Imp True Then
    Print "You are an Adult"
Else
    Print "You are a minor"
End If
 
The above code was Gemini's answer to a previous attempt on the use of IMP and touts that this code gives the correct answer.
And even that doesn't require IMP:

Code: (Select All)
Input "Enter your age: ", age
isADULT = age >= 18

If isADULT Then
    Print "You are an Adult"
Else
    Print "You are a minor"
End If
This also works and requires no "unusual" features. Unusual in that I've never needed an "implies" operator.
While 1
   Fix Bugs
   report all bugs fixed
   receive bug report
end while
Reply
#16
When it comes to a Logical approach for code to solve a problem it's uncanny how the use of a "Logical Operator" .. IMP... becomes so redundant as you have demonstrated TDarcos. 

Do you feel however that there is a subtle difference between IMPLYING someone's age from a given statement v's a concrete IF/Else choice of two outcomes? 

Tempodibasic replies here have introduced Popper's Falisification Theory. I'm looking at it as that which appears to the left side of an IMP statement. 
Popper would Falsify the left side of IMP if there is a logical chance that the unlaying theory/math of the left side might be false. But the only way to find out if the left side is False would be to act like it is True until your program hits a scenario where the Left side is indeed False. This is the point where your program actually becomes better or more advanced (also according to Popper). This implies (IMP) you really only learn by your mistakes.  Especially believing a Boy has 3 knees.

Thanks for the discussion (again).
Reply
#17
@TDarcos
IMP has its range of action and utility, surely this range is different from AND, OR, XOR, NOT
let's think like we are comparing multiplication with elevation to power, how many times do you use the first operation towards how many times you use the second operation?
My little IMProbable IMP library has the goal to show that it is possible using IMP if you understand its way to work. Not that the use of IMP is common.

@TDarcos, @Pete @AllReaders
pay attention!

in this code made by Gemini 
Code: (Select All)

INPUT "enter your age "; age
IsAdult = age >=18

IF IsAdult IMP True then
    PRINT "You are an adult"
ELSE
    PRINT "You are a minor"
END IF

the use of IMP is fake! Let's remember the truth table of IMP
Boolean1 IMP boolean2

IMP returns False only IF boolean2 is False!
So boolean1 IMP True = True also when boolean1 is False 

run this to verify
Code: (Select All)

'Input "enter your age "; age
false = 0
true = Not false

age = 8 ' is a minor
IsAdult = age >= 18
If IsAdult Imp true Then
    Print "You are an adult"
Else
    Print "You are a minor"
End If


age = 30 ' is an adult
IsAdult = age >= 18
If IsAdult Imp true Then
    Print "You are an adult"
Else
    Print "You are a minor"
End If

in the sum it is clear because IMP is unuseful in the previous code and we get better results using only IsAdult in the IF statement.

@Dimster
yeah
True IMP True = True  --> Verification
False IMP True = True --> Falsification

maybe here Popper enter in the coding world.
Reply




Users browsing this thread: 1 Guest(s)