latix
coniugazione verbi latini
/* latix.pro */ /* analisi verbo latino e ricava radici */ /* desinenze richiamate da disco */ /* prima coniugazione ind e cong */
nowarnings include "a:/latino/desix.pro"
domains Lunga,Lungap,tempo = integer Radix,Radixp,Verbo,Verpop =string f =symbol predicates stampa(f,f,f,f,f,f) presente(string) imperfetto(string) futuro(string) perfetto(string) piuccheperfetto(string) futuroanteriore(string) cpresente(string) cimperfetto(string) cperfetto(string) cpiuccheperfetto(string) fine scelta(integer,string,string) finestra coniuga(string) azione goal finestra,azione.
clauses finestra:-makewindow(1,7,1,"",0,0,25,80). azione:- attribute(5), write("scrivi infinito verbo latino 1 con.ne"),nl, write("da coniugare:es.laudare "),nl, readln(Verbo), str_len(Verbo,Lunga), Radice=Lunga-3, frontstr(Radice,Verbo,Radix,Des), nl, write("scrivi perfetto indicativo "),nl, write("da coniugare:es.laudavi "),nl, readln(Verbop), write("----------------------------"),nl, attribute(6), str_len(Verbop,Lungap), Radicep=Lungap-1, frontstr(Radicep,Verbop,Radixp,Desp), write("----------------------------"),nl, write("infinito..............",Verbo),nl, write("radice indicativo.....",Radix),nl, write("radice perfetto.......",Radixp),nl, write("premi enter "),readchar(H), clearwindow, write("premi 1 ..presente indicativo"),nl, write("premi 2 ..imperfetto indicativo"),nl, write("premi 3 ..futuro semplice"),nl, write("premi 4 ..perfetto "),nl, write("premi 5 ..piuccheperfetto "),nl, write("premi 6 ..futuro anteriore "),nl, write("premi 7 ..presente cong."),nl, write("premi 8 ..imperfetto cong. "),nl, write("premi 9 ..perfetto cong. "),nl, write("premi 10 .piuccheperfetto cong. "),nl,
write("premi 11 ..fine"),nl, readint(Tempo), clearwindow, scelta(Tempo,Radix,Radixp). scelta(1,Radix,Radixp):- write("presente "),nl,presente(Radix). scelta(2,Radix,Radixp):- write("imperfetto"),nl,imperfetto(Radix). scelta(3,Radix,Radixp):- write("futuro semplice"),nl,futuro(Radix). scelta(4,Radix,Radixp):- write("perfetto"),nl,perfetto(Radixp). scelta(5,Radix,Radixp):- write("piuccheperfetto"),nl,piuccheperfetto(Radixp). scelta(6,Radix,Radixp):- write("futuro anteriore"),nl,futuroanteriore(Radixp). scelta(7,Radix,Radixp):- write("congiuntivo pres."),nl,cpresente(Radix). scelta(8,Radix,Radixp):- write("congiuntivo imp."),nl,cimperfetto(Radix). scelta(9,Radix,Radixp):- write("congiuntivo per."),nl,cperfetto(Radixp). scelta(10,Radix,Radixp):- write("congiuntivo pper."),nl,cpiuccheperfetto(Radixp).
scelta(11,Radix,Radixp):-fine.
presente(Radix):- dati(1,D1,D2,D3,D4,D5,D6), coniuga(Radix).
coniuga(Radix):- dati(1,D1,D2,D3,D4,D5,D6), dati(2,D1,D2,D3,D4,D5,D6), dati(3,D1,D2,D3,D4,D5,D6), dati(4,D1,D2,D3,D4,D5,D6), dati(5,D1,D2,D3,D4,D5,D6), dati(6,D1,D2,D3,D4,D5,D6), dati(7,D1,D2,D3,D4,D5,D6), dati(8,D1,D2,D3,D4,D5,D6), dati(9,D1,D2,D3,D4,D5,D6), dati(10,D1,D2,D3,D4,D5,D6),
concat(Radix,D1,R1),concat(Radix,D2,R2), concat(Radix,D3,R3),concat(Radix,D4,R4), concat(Radix,D5,R5),concat(Radix,D6,R6), stampa(R1,R2,R3,R4,R5,R6).
stampa(R1,R2,R3,R4,R5,R6):- attribute(3), write(R1),nl,write(R2),nl,write(R3),nl, write(R4),nl,write(R5),nl,write(R6),nl, attribute(4),write("premi enter"),nl,beep, readchar(_),clearwindow,azione.
imperfetto(Radix):- dati(2,D1,D2,D3,D4,D5,D6), coniuga(Radix).
futuro(Radix):- dati(3,D1,D2,D3,D4,D5,D6), concat(Radix,D1,R1), concat(Radix,D2,R2), concat(Radix,D3,R3),concat(Radix,D4,R4), concat(Radix,D5,R5),concat(Radix,D6,R6), stampa(R1,R2,R3,R4,R5,R6).
perfetto(Radix):- dati(4,D1,D2,D3,D4,D5,D6), concat(Radix,D1,R1), concat(Radix,D2,R2), concat(Radix,D3,R3),concat(Radix,D4,R4), concat(Radix,D5,R5),concat(Radix,D6,R6), stampa(R1,R2,R3,R4,R5,R6).
piuccheperfetto(Radix):- dati(5,D1,D2,D3,D4,D5,D6), concat(Radix,D1,R1),concat(Radix,D2,R2), concat(Radix,D3,R3),concat(Radix,D4,R4), concat(Radix,D5,R5),concat(Radix,D6,R6), stampa(R1,R2,R3,R4,R5,R6).
futuroanteriore(Radix):- dati(6,D1,D2,D3,D4,D5,D6), concat(Radix,D1,R1),concat(Radix,D2,R2), concat(Radix,D3,R3),concat(Radix,D4,R4), concat(Radix,D5,R5),concat(Radix,D6,R6), stampa(R1,R2,R3,R4,R5,R6).
cpresente(Radix):- dati(7,D1,D2,D3,D4,D5,D6), concat(Radix,D1,R1),concat(Radix,D2,R2), concat(Radix,D3,R3),concat(Radix,D4,R4), concat(Radix,D5,R5),concat(Radix,D6,R6), stampa(R1,R2,R3,R4,R5,R6).
cimperfetto(Radix):- dati(8,D1,D2,D3,D4,D5,D6), concat(Radix,D1,R1),concat(Radix,D2,R2), concat(Radix,D3,R3),concat(Radix,D4,R4), concat(Radix,D5,R5),concat(Radix,D6,R6), stampa(R1,R2,R3,R4,R5,R6).
cperfetto(Radix):- dati(9,D1,D2,D3,D4,D5,D6), concat(Radix,D1,R1),concat(Radix,D2,R2), concat(Radix,D3,R3),concat(Radix,D4,R4), concat(Radix,D5,R5),concat(Radix,D6,R6), stampa(R1,R2,R3,R4,R5,R6).
cpiuccheperfetto(Radix):- dati(10,D1,D2,D3,D4,D5,D6), concat(Radix,D1,R1),concat(Radix,D2,R2), concat(Radix,D3,R3),concat(Radix,D4,R4), concat(Radix,D5,R5),concat(Radix,D6,R6), stampa(R1,R2,R3,R4,R5,R6).
fine:- write("premi enter"),readchar(H),exit.
/* DESIx.PRO */
domains des= symbol predicates dati(integer,des,des,des,des,des,des)
clauses dati(1,"o","as","at","amus","atis","ant"). dati(2,"abam","abas","abat","abamus","abatis","abant"). dati(3,"abo","abis","abit","abimus","abitis","abunt"). dati(4,"i","isti","it","imus","istis","erunt"). dati(5,"eram","eras","erat","eramus","eratis","erant"). dati(6,"ero","eris","erit","erimus","eritis","erint"). dati(7,"em","es","et","emus","etis","ent"). dati(8,"arem","ares","aret","aremus","aretis","arent"). dati(9,"erim","eris","erit","erimus","eritis","erint"). dati(10,"issem","isses","isset","issemus","issetis","issent").