• PHPPROLOG-com Coming Soon !

    From Graham Cooper@21:1/5 to All on Sat Jun 11 14:22:13 2022
    I got these 9 queries working
    Im going to PORT IT to PHP


    www.PHPPROLOG.com




    menu
    -echo newline
    -button query q2
    -button query q3
    -button query q4
    -button query q5
    -button query q6
    -button query q7
    -button query q8
    -button query q9
    -button query q10



    addvar S T TT
    -let FOUND false
    -let CONSIS false
    -let Q true
    -let R true
    -if
    -var S ANY E
    -let FOUND true
    -if
    -eq E T
    -let CONSIS true
    -endif
    -if
    -eq FOUND true
    -if
    -eq CONSIS false
    -clear M
    -clear N
    -if
    -f E M
    -if
    -f T N
    -if
    -eq M N
    -let CONSIS true
    -endif
    -if
    -eq FOUND true
    -if
    -eq CONSIS false
    -echo CON
    -let Q false
    -let R false
    -endif
    -if
    -eq Q true
    -assert var S TT T
    -endif

    unify S T TTTT
    -let R false
    -let Q true
    -if
    -eq S T
    -let R true
    -endif
    -if
    -eq R false
    -if
    -bigger S y
    -print S
    -print T
    -addvar S T TTTT
    -echo newline
    -endif
    -if
    -eq R false
    -if
    -bigger T y
    -print T
    -print S
    -addvar T S TTTT
    -echo newline
    -endif
    -if
    -eq Q false
    -let R false
    -endif
    -if
    -eq Q true
    -if
    -eq R false
    -unifyarg S T TTTT
    -endif

    unifyarg U V TTT
    -let R false
    -clear G
    -clear H
    -clear I
    -clear J
    -clear K
    -clear L
    -if
    -q U TTT G H I
    -if
    -f V J K L
    -if
    -eq G J
    -unify H K TTT
    -if
    -eq R true
    -unify I L TTT
    -endif


    solve F A B TTTTT
    -let Z false
    -echo QUERY
    -print F
    -print A
    -print B
    -print TTTTT
    -echo newline
    -clear P
    -clear C
    -clear D
    -f P F C D
    -let FPFCD true
    -remove var TTTTT
    -if
    -eq FPFCD true
    -echo HEADR
    -print F
    -print C
    -print D
    -echo newline
    -unify A C TTTTT
    -if
    -eq R true
    -unify B D TTTTT
    -if
    -eq R true
    -checksub P
    -if
    -eq Z true
    -checktail Q TT
    -endif
    -if
    -eq FPFCD true
    -if
    -eq Z false
    -clear P
    -clear C
    -clear D
    -next
    -let R R
    -solve F A B TTTTT
    -let R R
    -endif
    -echo FINSOLVE
    -print F
    -print A
    -print B
    -print TTTTT
    -echo newline





    subquery Q TT
    -let Z false
    -echo subquery
    -print Q
    -print TT
    -echo newline
    -clear F
    -clear A
    -clear B
    -if
    -q Q TT F A B
    -solve F A B TT
    -print Z
    -echo newline
    -else
    -let Z true
    -endif



    query Q
    -let Z false
    -subquery Q 1
    -echo newline
    -print Z


    checksub PP
    -if
    -q PP 1
    -echo subtail
    -print PP
    -echo newline
    -subquery PP 1
    -else
    -let Z true
    -endif




    checktail PP TTTTTTT
    -echo CHECKTAIL
    -print PP
    -print TTTTTTT
    -echo newline
    -add T2 TTTTTTT 1
    -if
    -q PP T2
    -echo foundtail
    -print T2
    -echo newline
    -subquery PP T2
    -else
    -let Z true
    -endif








    head fa fa1
    q q2 1 fa fb1 1
    q fb1 1 fb 7 1
    f fa1 fa fb2 1
    f fb2 fb z1 1
    c c
    head f f1
    f f1 f a1 c
    f a1 a b z1
    q q3 1 f a2 z2
    q a2 1 a b d
    c c
    head f f2
    f f2 f a3 d
    f a3 a b1 c
    f b1 b x y
    q q4 1 f a4 d
    q a4 1 a z1 c
    c c
    head learn l1
    f l1 learn zSTUD miniBASE
    q q5 1 learn chris zTOPIC
    c c
    head g g1
    head g g2
    f g1 g 1 2
    f g2 g 3 3
    q q6 1 g z1 z1
    c c
    head h h1
    f h1 h i1 i2
    f i1 i 1 1
    f i2 i 1 1
    q q7 1 h z1 z1
    c c
    head check check1
    f check1 check 1 2
    q q8 1 check 2 2
    c c
    head rich rich1
    head prty prty1
    f rich1 rich gaga 1
    f prty1 prty gaga 1
    q q9 1 rich gaga 1
    q q9 2 prty gaga 1
    c c
    f num1 number 1 1
    f num2 number 2 1
    f num3 number 3 1
    f equ1 equals 1 1
    f equ2 equals 2 2
    f equ3 equals 3 3
    f tst1 testal z 1
    q tst1 1 number z 1
    q tst1 2 equals z 2
    q q10 1 testal zN 1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)