Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PROLOG TESTING SEQUENCE - Getting Your ROBOT Off The Ground!

11 views
Skip to first unread message

Graham Cooper

unread,
May 20, 2013, 1:37:54 AM5/20/13
to ant...@popsci.com.au

STEP 1: START UP YOUR FAVORITE PROLOG EDITOR!

ENTER: http://www.BLoCKPROLOG.com
[LIST]

STEP 2: ENTER THE FOLLOWING TEST CODE!

[NEW]
test1 a.
test1 b.
test2 X.
test3 [sub a b c].


STEP 3: CHECK THE FOLLOWING COMMAND RESULTS!

test1 a ? CONFIRM!
test1 b ? CONFIRM!
test1 c ? NOT FOUND!
test1 V ?

>V = a

test2 a ? CONFIRM!
test2 V ?

>V = X1

test2 [sub a b c] ? CONFIRM!
test2 [sub x y z] ? CONFIRM!

test3 [sub a b c] ? CONFIRM!
test3 [sub x y z] ? NOT FOUND!
test3 V ?

>V = sub a b c

------------

ALL SYSTEMS CHECK!

Herc
--
www.BLOCKPROLOG.com (b)eta

Graham Cooper

unread,
May 21, 2013, 7:17:31 PM5/21/13
to
On May 22, 8:54 am, Charlie-Boo <shymath...@gmail.com> wrote:
> On May 20, 1:33 am, Graham Cooper <grahamcoop...@gmail.com> wrote:
>
>
>
> > STEP 1:  START UP YOUR FAVORITE PROLOG EDITOR!
>
> >    ENTER:  www.BLoCKPROLOG.com
> >    [LIST]
>
> > STEP 2:  ENTER THE FOLLOWING TEST CODE!
>
> >    [NEW]
> >    test1 a.
> >    test1 b.
> >    test2 X.
> >    test3 [sub a b c].
>
> > STEP 3:  CHECK THE FOLLOWING COMMAND RESULTS!
>
> >    test1 a ?  CONFIRM!
> >    test1 b ?  CONFIRM!
> >    test1 c ?  NOT FOUND!
> >    test1 V ?
>
> >    >V = a
>
> >    test2 a ?  CONFIRM!
> >    test2 V ?
>
> >    >V = X1
>
> >    test2 [sub a b c] ?  CONFIRM!
> >    test2 [sub x y z] ?  CONFIRM!
>
> >    test3 [sub a b c] ?  CONFIRM!
> >    test3 [sub x y z] ?  NOT FOUND!
> >    test3 V ?
>
> >    >V = sub a b c
>
> > -------------
>
> > ALL SYSTEMS CHECK!
>
> > Herc
> > --www.BLOCKPROLOG.com (b)eta
>
> 1. Do you think Prolog is logically different from any other
> programming language?
>


PROLOG uses a MATCHING algorithm rather than EQUALITY '='

Consider ZFC SET EQUALITY by extension.

SET EQUALITY

SUBSET( S , T ) <-> AxeS->xeT

EQUALS( S , T ) <-> AxeS->xeT & AxeT->xeS


-----------------------------

What if S has a set of its own?

S = { Q , 4 , 3, 6 }

T = { {7} , 4 , 3 , 6}


-----------------------------

AXIOM of Equality will not be able to work out if S=T.

PROLOG goes a step further and BINDS Q={7}


> 2. Can you list the prime numbers between A and B for any A,B in it?
> (by typing A and B in somewhere)
> 3. Can you tell if A is a factor of B for any A,B in it? (by typing A
> and B in somewhere)
>
> C-B


Why not? As |input| increases you need more iterations.

You might be able to search "Arithmetic Space" for equations of the
form:

+(-(/(23.33),23)+(23,#(23,32..........)))) X +(-(/(23.33),
23)+(23,#(23,32..........))))

The Public Key maker must have generated his 2 primes somehow!

Herc
--
www.BLOCKPROLOG.com

Charlie-Boo

unread,
May 22, 2013, 6:58:07 PM5/22/13
to
Since you have not exhibited such functions I take it that the answer
is yes, prolog is different in that it can't calculate simple number
theoretic functions, and no, it is unable to list prime numbers or
tell if one number is a factor of another. Then it is a toy rather
than a serious endeavor.

C-B

> Herc
> --www.BLOCKPROLOG.com

Graham Cooper

unread,
May 22, 2013, 9:06:27 PM5/22/13
to
What are you blowing smoke about?

Prolog is UTM equivalent recursion wise, 3GL wise, Peano Arithmetic
wise, token matching wise, lambda instantiation and several other
computation methods it handles with ease.

Any commercial prolog interpreter and any prolog notes anywhere on the
net will detail the maths functions add-on.

its something like

X is 9+2

but I will be sticking with PREFIX functions.

I'm not doing an arithmetic until I've done HTML FORMS and GROUP_BY
operators.

I already listed a C like loop with 2 identical function declarations.


casea( A ) :-
less( A , 2 ) ,
write( concat( final , A ))
.
casea( A ) :-
less( 1 , A ) ,
write( concat( looping , A )) ,
minus( A , 1 , B ) ,
casea( B ) .

------------------

The Output (in PROLOG) for

casea(5) ?

looping5
looping4
looping3
looping2
final1



--------------


I should have s(s(s(0))) arithmetic going this week!

Until then, maybe you should try and understand how the
TRACE (PROOF)

DOG+1 = ?

is _SUPPOSED_ TO WORK!

http://blockprolog.com/nat-s-dog.png

Herc
0 new messages