1
0
forked from GitHub/gf-core

added Ann-Charlotte's grammars

This commit is contained in:
aarne
2005-06-27 12:20:33 +00:00
parent b9e13711db
commit 3c508f4f89
122 changed files with 687204 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
--# -path=.:../../Resource/Media:../../Resource/Time:
abstract DB = TVStations, Time, Weekday ** {
}

View File

@@ -0,0 +1,5 @@
--# -path=.:../../Resource/Media:../../Resource/Time:
concrete DBEng of DB = TVStationsEng, TimeEng, WeekdayEng ** {
}

View File

@@ -0,0 +1,5 @@
--# -path=.:../../Resource/Media:../../Resource/Time:
concrete DBPro of DB = TVStationsPro, TimeProlog, WeekdayProlog ** {
}

View File

@@ -0,0 +1,5 @@
--# -path=.:../../Resource/Media:../../Resource/Time:
concrete DBSwe of DB = TVStationsSwe, TimeSwe, WeekdaySwe ** {
}

View File

@@ -0,0 +1,64 @@
--# -path=.:../:../../../Resource/Time:../Shared:../../../Core:../../../Core/Shared:
abstract sharedDomain = sharedCore, DB, Time, Weekday ** {
fun
-- ANSWERS
--makeAddLocAnswer : Location -> Proposition addTask;
--makeRemLocAnswer : Location -> Proposition removeTask;
makeAddEventAnswer : Event -> Proposition addTask;
makeRemEventAnswer : Event -> Proposition removeTask;
makeCheckupAnswer : Event -> Proposition checkupTask;
makeCheckTimeAnswer : Event -> Proposition checkTimeTask;
makeAddInfoAnswer : Event -> Proposition addInfoTask;
makeAddEventTimeAnswer : Time -> Proposition addTask;
makeRemEventTimeAnswer : Time -> Proposition removeTask;
makeCheckupTimeAnswer : Time -> Proposition checkupTask;
makeCheckTimeTimeAnswer : Time -> Proposition checkTimeTask;
makeAddInfoTimeAnswer : Time -> Proposition addInfoTask;
makeAddEventDayAnswer : Weekday -> Proposition addTask;
makeRemEventDayAnswer : Weekday -> Proposition removeTask;
makeCheckupDayAnswer : Weekday -> Proposition checkupTask;
makeCheckTimeDayAnswer : Weekday -> Proposition checkTimeTask;
makeAddInfoDayAnswer : Weekday -> Proposition addInfoTask;
makeCheckAnswer : Location -> Proposition checkupTask;
makeAddInfoLocAnswer : Location -> Proposition addInfoTask;
makeCheckTimeLocAnswer : Location -> Proposition checkTimeTask;
-- LEXICON
addTask : Task;
removeTask : Task;
changeTask : Task;
addInfoTask : Task;
checkupTask : Task; -- "har jag"
checkTimeTask : Task;
addEntry : Action addTask; -- "lägga till", "anteckna", "göra en anteckning", "boka", "boka in"
removeEntry : Action removeTask; -- "ta bort", "radera", "ta bort en anteckning", "ta bort anteckningen"
changeEntry : Action changeTask; -- "ändra anteckningen" - "request(change_info)"
augmentEntry : Action addInfoTask; -- "lägga till mer information" - "request(more_info)
checkupEntry : Action checkTimeTask;
checkup : Ask checkupTask; -- "vad har jag"
}

View File

@@ -0,0 +1,148 @@
--# -path=.:../:../Artist:../Numbers
concrete sharedDomainEng of sharedDomain = sharedCoreEng, numbersEng, orderNumEng, englishDBEng **
open SpecResEng in {
lin
-- ANSWERS
answerSongPlay song = {s = variants {
( song.s );
( (itemForm ! Song) ++ song.s )
}
};
answerSongAdd song = {s = variants {
( song.s );
( (itemForm ! Song) ++ song.s )
}
};
answerSongRemove song = {s = variants {
( song.s );
( (itemForm ! Song) ++ song.s )
}
};
questionSong song = {s = variants {
( song.s );
( (itemForm ! Song) ++ song.s )
}
};
answerArtistPlay artist = {s = variants {
( artist.s );
( (itemForm ! Artist) ++ artist.s )
}
};
answerArtistAdd artist = {s = variants {
( artist.s );
( (itemForm ! Artist) ++ artist.s )
}
};
answerArtistRemove artist = {s = variants {
( artist.s );
( (itemForm ! Artist) ++ artist.s )
}
};
questionArtist artist = { s = variants {
( artist.s );
( (itemForm ! Artist) ++ artist.s )
}
};
answerStationPlay station = {s = variants {
( station.s);
( ["the station"] ++ station.s)
}
};
answerStationAdd station = {s = variants {
( station.s);
( ["the station"] ++ station.s)
}
};
answerStationRemove station = {s = variants {
( station.s);
( ["the station"] ++ station.s)
}
};
-- LIST RELATED ANSWERS
-- nummer fem
-- fem
answerNumberInListPlay numb = {s = variants {
( (listForm ! Numeric) ++ numb.s );
( numb.s )
}
};
answerNumberInListRemove numb = {s = variants {
( (listForm ! Numeric) ++ numb.s );
( numb.s )
}
};
-- den femte låten
-- den femte
answerOrderInListPlay ordNum =
{s = variants {
("the" ++ ordNum.s ++ (itemForm ! Post));
("the" ++ ordNum.s)
}
};
answerOrderInListRemove ordNum =
{s = variants {
("the" ++ ordNum.s ++ (itemForm ! Post));
("the" ++ ordNum.s)
}
};
-- LEXICON
pattern
play_spec = (variants {["play"] ; ["listen to"] ; "hear"});
play_spec_alone = variants {["play a specific"] ; ["play a specific song"] ; ["listen to a specific song"] ; ["hear a specific song"]};
play = (variants {["start from the beginning"] ; ["play"] ; ["start"]});
stop = (variants {["stop"]});
pause = ["pause"];
resume = (variants {["resume"] ; ["resume playing"]});
next = "next";
previous = "previous";
raise_volume = ["raise the volume"] ;
lower_volume = ["lower the volume"];
shift = "shift" ++ variants{ ["the balance"] ; ""};
right = variants{"" ; ["to the"]} ++ "right";
left = variants{"" ; ["to the"]} ++ "left";
center = variants{"" ; ["to the"]} ++ "middle";
show_list = ["show the list"];
add = ["add"];
remove = ["remove"];
handle_list = ["manage the playlist"];
handle_player = ["talk to the player"];
handle_stations = ["choose a station"];
}

View File

@@ -0,0 +1,77 @@
-- SWEDISH VERSION, UNCOMMENT AS NEEDED
--# -path=.:../:../DBase/Swedish:../DBase:../Shared:../System:../Numbers
concrete sharedDomainPro of sharedDomain = sharedCorePro, numbersEng, orderNumEng, swedishDBPro ** {
-- ENGLISH VERSION, UNCOMMENT AS NEEDED
-- --# -path=.:../:../DBase/English:../DBase:../Shared:../System:../Numbers
-- concrete sharedDomainPro of sharedDomain = sharedCorePro, numbersEng, orderNumEng, englishDBPro ** {
flags lexer=code ; unlexer=code ;
lin
-- ANSWERS
answerSongPlay song = { s = "item" ++ "(" ++ song.s ++ ")"};
answerSongAdd song = { s = "item" ++ "(" ++ song.s ++ ")"};
answerSongRemove song = { s = "item" ++ "(" ++ song.s ++ ")"};
questionSong song = { s = "item" ++ "(" ++ song.s ++ ")"};
answerArtistPlay artist = { s = "group" ++ "(" ++ artist.s ++ ")"};
answerArtistAdd artist = { s = "group" ++ "(" ++ artist.s ++ ")"};
answerArtistRemove artist = { s = "group" ++ "(" ++ artist.s ++ ")"};
questionArtist artist = {s = "group" ++ "(" ++ artist.s ++ ")"};
answerStationPlay station = { s = "station" ++ "(" ++ station.s ++ ")"};
answerStationAdd station = { s = "station" ++ "(" ++ station.s ++ ")"};
answerStationRemove station = { s = "station" ++ "(" ++ station.s ++ ")"};
answerNumberInListPlay numb = {s = "index" ++ "(" ++ "[" ++ numb.s ++ "]" ++ ")"};
answerNumberInListRemove numb = {s = "index" ++ "(" ++ "[" ++ numb.s ++ "]" ++ ")"};
answerOrderInListPlay ordNum = {s = "index" ++ "(" ++ "[" ++ ordNum.s ++ "]" ++ ")"};
answerOrderInListRemove ordNum = {s = "index" ++ "(" ++ "[" ++ ordNum.s ++ "]" ++ ")"};
-- LEXICON
pattern
play_spec = "start_specific";
play_spec_alone = "start_specific";
play = "start";
stop = "stop";
pause = "pause";
resume = "resume";
next = "next";
previous = "previous";
raise_volume = "vol_up" ;
lower_volume = "vol_down" ;
shift = "set_balance";
right = "1.0";
left = "-1.0";
center = "0.0";
show_list = "show_list";
add = "playlist_add";
remove = "playlist_del";
handle_list = "handle_playlist";
handle_player = "handle_player";
handle_stations = "handle_stations";
askArtist = "songs_by_artist";
askSong = "artists_song";
askCurrent = "current_song";
}

View File

@@ -0,0 +1,42 @@
--# -path=.:../:../../../Resource/Time:../Shared:../../../Core:../../../Core/Shared:
concrete sharedDomainSwe of sharedDomain = sharedCoreSwe, DBSwe, TimeSwe, WeekdaySwe ** open SpecResSwe in{
lin
-- ANSWERS
makeAddEventAnswer event = {s = event.s};
makeRemEventAnswer event = {s = event.s};
makeCheckupAnswer event = {s = "om" ++ event.s};
makeCheckTimeAnswer event = {s = event.s};
makeAddInfoAnswer event = {s = "om" ++ event.s};
makeAddEventTimeAnswer time = {s = time.s};
makeRemEventTimeAnswer time = {s = time.s};
makeCheckupTimeAnswer time = {s = time.s};
makeCheckTimeTimeAnswer time = {s = time.s};
makeAddInfoTimeAnswer time = {s = time.s};
makeAddEventDayAnswer weekday = {s = "på" ++ weekday.s};
makeRemEventDayAnswer weekday = {s = "på" ++ weekday.s};
makeCheckupDayAnswer weekday = {s = "på" ++ weekday.s};
makeCheckTimeDayAnswer weekday = {s = "på" ++ weekday.s};
makeAddInfoDayAnswer weekday = {s = "på" ++ weekday.s};
makeCheckAnswer location = {s = location.s};
makeAddInfoLocAnswer location = {s = "om" ++ location.s};
makeCheckTimeLocAnswer location = {s = location.s};
-- LEXICON
pattern
addEntry = varaints {["lägga till"] ; ["anteckna"] ; ["göra en anteckning om"]};
removeEntry = variants{ ["ta bort"] ; ["radera en anteckning"]};
changeEntry = ["ändra en anteckning om"];
augmentEntry = ["lägga till mer information"];
checkupEntry = ["kolla tiden för"];
checkup = ["vad har jag uppskrivet"];
}

View File

@@ -0,0 +1,53 @@
-- SWEDISH VERSION, UNCOMMENT AS NEEDED
--# -path=.:../:../DBase/Swedish:../DBase:../Shared:../System:../Numbers
-- ENGLISH VERSION, UNCOMMENT AS NEEDED
-- --# -path=.:../:../DBase/English:../DBase:../Shared:../System:../Numbers
abstract systemDomain = sharedDomain, systemCore ** {
cat
Proposition;
fun
-- PROPOSITIONS.
--
songProp : Song -> Proposition;
itemProp : Song -> Proposition;
currentSongProp : Song -> Proposition;
whatToPlayPropNum : Number -> Proposition;
whatToPlayPropOrd : Number -> Proposition;
itemRemPropNum : Number -> Proposition;
itemRemPropOrd : Number -> Proposition;
groupToAddProp : Artist -> Proposition;
artistProp : Artist -> Proposition;
groupProp : Artist -> Proposition;
songArtistProp : Artist -> Proposition;
albumProp : Album -> Proposition;
artistsSongProp : Artist -> Proposition;
artistsAlbumProp : Artist -> Proposition;
albumArtistProp : Album -> Proposition;
songsArtistProp : Song -> Proposition;
stationProp : Station -> Proposition;
}

View File

@@ -0,0 +1,74 @@
--# -path=.:../:../DBase/English:../DBase:../Shared:../System:../Numbers
concrete systemDomainEng of systemDomain = sharedDomainEng, systemCoreEng ** {
lin
-- PROPOSITIONS
songProp song = { s = song.s };
itemProp song = { s = song.s };
currentSongProp song = { s = song.s };
whatToPlayPropNum number = { s = number.s };
whatToPlayPropOrd order = { s = order.s };
itemRemPropNum number = { s = number.s };
itemRemPropOrd order = { s = order.s };
groupToAddProp artist = { s = artist.s };
artistProp artist = { s = artist.s};
groupProp artist = { s = artist.s };
songArtistProp artist = { s = artist.s };
albumProp album = { s = album.s };
artistsSongProp artist = { s = artist.s };
artistsAlbumProp artist = { s = artist.s };
albumArtistProp album = { s = album.s };
songsArtistProp song = { s = song.s };
stationProp station = { s = station.s };
-- sort_restr( song(X) ):- sem_sort(X,item).
-- sort_restr( item(X) ):- sem_sort(X,item).
-- sort_restr( current_song(X) ):- sem_sort(X,song).
-- sort_restr( what_to_play(X) ):- sem_sort(X,index).
-- sort_restr( itemRem(X) ):- sem_sort(X,index).
-- sort_restr( itemRem(X) ):- sem_sort(X,index).
-- sort_restr( groupToAdd(X) ):- group( X ).
-- sort_restr( artist(X) ):- group( X ).
-- sort_restr( group(X) ):- group( X ).
-- sort_restr( song_artist(X) ):- group( X ).
-- sort_restr( album(X) ):- album( X ).
-- sort_restr( artists_song(X) ):- group_atom( X ).
-- sort_restr( artists_album(X) ):- group_atom( X ).
-- sort_restr( albums_by_artist(X) ):- album_atom( X ).
-- sort_restr( songs_by_artist(X) ):- song_atom( X ).
-- sort_restr( station(X) ):- radio_station( X ).
-- sort_restr( year(X) ):- sem_sort( X, year ).
-- sort_restr( path(X) ):- atomic( X ).%,format("hallå: ~w\n",[X]).
-- %sort_restr( X^path(X) ):- atomic( X ),format("hallå: ~w\n",[X]).
-- sort_restr( not path(X) ):- format("hallå: ~w\n",[X]), atomic( X ).
-- sort_restr( fail(Path^path(Path),no_matches) ).
pattern
-- Because of differing linearisations in User and System usage these functions are not linearized in Shared.
askArtist = "songs" ;
askSong = "artist" ;
askCurrent = ["the current song"];
}

View File

@@ -0,0 +1,65 @@
-- SWEDISH VERSION, UNCOMMENT AS NEEDED
--# -path=.:../:../DBase/Swedish:../DBase:../Shared:../System:../Numbers
-- ENGLISH VERSION, UNCOMMENT AS NEEDED
-- --# -path=.:../:../DBase/English:../DBase:../Shared:../System:../Numbers
concrete systemDomainPro of systemDomain = sharedDomainPro, systemCorePro ** {
lin
-- PROPOSITIONS
-- Ok hur ska jag göra med propositions tro? Och vad menar David med song_to_add(Song).
-- Hur blir de till? Skulle man kunna göra som nedan?
songProp song = { s = "song" ++ "(" ++ song.s ++ ")" };
itemProp song = { s = "item" ++ "(" ++ song.s ++ ")" };
currentSongProp song = { s = "current_song" ++ "(" ++ song.s ++ ")" };
whatToPlayPropNum number = { s = "what_to_play" ++ "(" ++ number.s ++ ")" };
whatToPlayPropOrd order = { s = "what_to_play" ++ "(" ++ order.s ++ ")" };
itemRemPropNum number = { s = "itemRem" ++ "(" ++ number.s ++ ")" };
itemRemPropOrd order = { s = "itemRem" ++ "(" ++ order.s ++ ")" };
groupToAddProp artist = { s = "groupToAdd" ++ "(" ++ artist.s ++ ")" };
artistProp artist = { s = "artist" ++ "(" ++ artist.s ++ ")"};
groupProp artist = { s = "group" ++ "(" ++ artist.s ++ ")" };
songArtistProp artist = { s = "song_artist" ++ "(" ++ artist.s ++ ")" };
albumProp album = { s = "album" ++ "(" ++ album.s ++ ")" };
artistsSongProp artist = { s = "artist_song" ++ "(" ++ artist.s ++ ")" };
artistsAlbumProp artist = { s = "artists_album" ++ "(" ++ artist.s ++ ")" };
albumArtistProp album = { s = "albums_by_artist" ++ "(" ++ album.s ++ ")" };
songsArtistProp song = { s = "songs_by_artist" ++ "(" ++ song.s ++ ")" };
stationProp station = { s = "station" ++ "(" ++ station.s ++ ")" };
-- sort_restr( song(X) ):- sem_sort(X,item).
-- sort_restr( item(X) ):- sem_sort(X,item).
-- sort_restr( current_song(X) ):- sem_sort(X,song).
-- sort_restr( what_to_play(X) ):- sem_sort(X,index).
-- sort_restr( itemRem(X) ):- sem_sort(X,index).
-- sort_restr( itemRem(X) ):- sem_sort(X,index).
-- sort_restr( groupToAdd(X) ):- group( X ).
-- sort_restr( artist(X) ):- group( X ).
-- sort_restr( group(X) ):- group( X ).
-- sort_restr( song_artist(X) ):- group( X ).
-- sort_restr( album(X) ):- album( X ).
-- sort_restr( artists_song(X) ):- group_atom( X ).
-- sort_restr( artists_album(X) ):- group_atom( X ).
-- sort_restr( albums_by_artist(X) ):- album_atom( X ).
-- sort_restr( songs_by_artist(X) ):- song_atom( X ).
-- sort_restr( station(X) ):- radio_station( X ).
-- sort_restr( year(X) ):- sem_sort( X, year ).
-- sort_restr( path(X) ):- atomic( X ).%,format("hallå: ~w\n",[X]).
-- %sort_restr( X^path(X) ):- atomic( X ),format("hallå: ~w\n",[X]).
-- sort_restr( not path(X) ):- format("hallå: ~w\n",[X]), atomic( X ).
-- sort_restr( fail(Path^path(Path),no_matches) ).
}

View File

@@ -0,0 +1,74 @@
--# -path=.:../:../DBase/Swedish:../DBase:../Shared:../System:../Numbers
concrete systemDomainSwe of systemDomain = sharedDomainSwe, systemCoreSwe ** {
lin
-- PROPOSITIONS
songProp song = { s = song.s };
itemProp song = { s = song.s };
currentSongProp song = { s = song.s };
whatToPlayPropNum number = { s = number.s };
whatToPlayPropOrd order = { s = order.s };
itemRemPropNum number = { s = number.s };
itemRemPropOrd order = { s = order.s };
groupToAddProp artist = { s = artist.s };
artistProp artist = { s = artist.s};
groupProp artist = { s = artist.s };
songArtistProp artist = { s = artist.s };
albumProp album = { s = album.s };
artistsSongProp artist = { s = artist.s };
artistsAlbumProp artist = { s = artist.s };
albumArtistProp album = { s = album.s };
songsArtistProp song = { s = song.s };
stationProp station = { s = station.s };
-- sort_restr( song(X) ):- sem_sort(X,item).
-- sort_restr( item(X) ):- sem_sort(X,item).
-- sort_restr( current_song(X) ):- sem_sort(X,song).
-- sort_restr( what_to_play(X) ):- sem_sort(X,index).
-- sort_restr( itemRem(X) ):- sem_sort(X,index).
-- sort_restr( itemRem(X) ):- sem_sort(X,index).
-- sort_restr( groupToAdd(X) ):- group( X ).
-- sort_restr( artist(X) ):- group( X ).
-- sort_restr( group(X) ):- group( X ).
-- sort_restr( song_artist(X) ):- group( X ).
-- sort_restr( album(X) ):- album( X ).
-- sort_restr( artists_song(X) ):- group_atom( X ).
-- sort_restr( artists_album(X) ):- group_atom( X ).
-- sort_restr( albums_by_artist(X) ):- album_atom( X ).
-- sort_restr( songs_by_artist(X) ):- song_atom( X ).
-- sort_restr( station(X) ):- radio_station( X ).
-- sort_restr( year(X) ):- sem_sort( X, year ).
-- sort_restr( path(X) ):- atomic( X ).%,format("hallå: ~w\n",[X]).
-- %sort_restr( X^path(X) ):- atomic( X ),format("hallå: ~w\n",[X]).
-- sort_restr( not path(X) ):- format("hallå: ~w\n",[X]), atomic( X ).
-- sort_restr( fail(Path^path(Path),no_matches) ).
pattern
-- Because of differing linearisations in User and System usage these functions are not linearized in Shared.
askArtist = "låtar" ;
askSong = "artister" ;
askCurrent = ["låten som spelas nu"];
}

View File

@@ -0,0 +1,13 @@
--# -path=.:../:../../../Resource/Time:../../../Resource/Media:../Shared:../../../Core:../../../Core/Shared:../../../Core/User
abstract userDomain = userCore, sharedDomain ** {
fun
-- CompoundedAnswers
answerEventLocAdd : Event -> Location -> AnswerList addTask;
answerEventLocRem : Event -> Location -> AnswerList removeTask;
answerEventLocTimeDay : Event -> Location -> Time -> Weekday -> AnswerList removeTask;
}

View File

@@ -0,0 +1,25 @@
--# -path=.:../:../DBase/English:../DBase:../Numbers:../Shared
concrete userDomainEng of userDomain = userCoreEng, sharedDomainEng ** {
lin
-- CompoundedAnswers
answerSongArtistPlay song artist = {s = variants {(song.s ++ "with" ++ artist.s)
; (artist.s ++ "with" ++ song.s)} };
answerSongArtistAdd song artist = {s = variants {(song.s ++ "with" ++ artist.s)
; (artist.s ++ "with" ++ song.s)} };
pattern
askArtist = variants { ["what do i have"] ; ["what songs do i have"] ; ["do i have anything"]}
++ variants {"with" ; "by"};
askSong = ["who"] ++ variants {"made"; "wrote"};
askCurrent = ["what"] ++ variants {["song is this"] ; ["is this called"]};
}

View File

@@ -0,0 +1,18 @@
-- SWEDISH VERSION, UNCOMMENT AS NEEDED
--# -path=.:../:../DBase/Swedish:../DBase:../Numbers:../Shared
-- ENGLISH VERSION, UNCOMMENT AS NEEDED
-- --# -path=.:../:../DBase/English/:../DBase/:../Numbers:../Shared
concrete userDomainPro of userDomain = userCorePro, sharedDomainPro ** {
lin
answerSongArtistPlay song artist = { s = "answer(item(" ++ song.s ++ ")," ++
"answer(group(" ++ artist.s ++ ")"};
answerSongArtistAdd song artist = { s = "answer(item(" ++ song.s ++ ")," ++
"answer(group(" ++ artist.s ++ ")"};
}

View File

@@ -0,0 +1,24 @@
--# -path=.:../:../../:../../../Resource/Time:../../../Resource/Media/:../Shared:../../../Core:../../../Core/Shared:../../../Core/User
concrete userDomainSwe of userDomain = userCoreSwe, sharedDomainSwe ** {
lin
-- CompoundedAnswers
answerEventLocAdd event loc = {s = event.s ++ loc.s };
answerEventLocRem event loc = {s = event.s ++ loc.s };
answerEventLocTimeDay event loc time day = {s = variants {
(event.s ++ loc.s ++ time.s ++ "på" ++ day.s);
(event.s ++ loc.s ++ "på" ++ day.s ++ time.s);
}
};
-- (event.s ++ "på" ++ day.s ++ time.s);
-- (loc.s ++ time.s ++ "på" ++ day.s);
}

View File

@@ -0,0 +1,6 @@
--# -path=.:../../Resource/Media/English:../../Resource/Media/Swedish:../../../Resource/Numbers/
abstract DB = SwedishAlbums, SwedishArtists, SwedishRadioStations, SwedishSongs, numbers, orderNum ** {
--abstract DB = EnglishAlbums, EnglishArtists, EnglishRadioStations, EnglishSongs, numbers, orderNum ** {
}

View File

@@ -0,0 +1,7 @@
--# -path=.:../../Resource/Media/English:../../Resource/Media/Swedish:../../Resource/Numbers/
concrete DBEng of DB = EnglishAlbumsEng, EnglishArtistsEng,
--EnglishSongsEng,
EnglishRadioStationsEng, SwedishSongsSwe, numbersEng, orderNumEng ** {
}

View File

@@ -0,0 +1,6 @@
--# -path=.:../../Resource/Media/English:../../Resource/Media/Swedish
--concrete DBPro of DB = EnglishAlbumsPro, EnglishSongsPro, EnglishArtistsPro, EnglishRadioStationsPro, numbersPro, orderNumPro ** {
concrete DBPro of DB = SwedishAlbumsPro, SwedishSongsPro, SwedishArtistsPro, SwedishRadioStationsPro, numbersPro, orderNumPro ** {
}

View File

@@ -0,0 +1,5 @@
--# -path=.:../../Resource/Media/English:../../Resource/Media/Swedish:../../Resource/Numbers/
concrete DBSwe of DB = SwedishAlbumsSwe, SwedishArtistsSwe, SwedishSongsSwe, SwedishRadioStationsSwe, numbersSwe, orderNumSwe ** {
}

View File

@@ -0,0 +1,105 @@
-- SWEDISH version, uncomment as needed.
-- --# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/Swedish/:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/
-- abstract sharedDomain = sharedCore, numbers, orderNum, swedishDB ** {
-- ENGLISH version, uncomment as needed.
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/English/:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/
abstract sharedDomain = sharedCore, DB ** {
fun
-- ANSWERS
-- Request Answers
answerSongPlay : Song -> Proposition playTask;
answerSongAdd : Song -> Proposition addTask;
answerSongRemove : Song -> Proposition removeTask;
answerArtistPlay : Artist -> Proposition playTask;
answerArtistAdd : Artist -> Proposition addTask;
answerArtistRemove : Artist -> Proposition removeTask;
answerStationPlay : Station -> Proposition playTask;
answerStationAdd : Station -> Proposition addTask;
answerStationRemove : Station -> Proposition removeTask;
answerNumberInListPlay : Number -> Proposition playTask;
answerNumberInListRemove: Number -> Proposition removeTask;
answerOrderInListPlay : OrderNumber -> Proposition playTask;
answerOrderInListRemove : OrderNumber -> Proposition removeTask;
-- Ask Answers
questionSong : Song -> Proposition songQuestion;
questionArtist : Artist -> Proposition artistQuestion;
-- LEXICON
playTask : Task;
addTask : Task;
removeTask : Task;
speakerTask : Task;
artistQuestion : Task;
songQuestion : Task;
play_spec : Action playTask;
play_spec_alone : SingleAction;
play : SingleAction;
stop : SingleAction;
pause : SingleAction;
resume : SingleAction;
next : OrderNumber;
previous : OrderNumber;
raise_volume : SingleAction;
lower_volume : SingleAction;
fastforward : SingleAction;
rewind : SingleAction;
shift : Action speakerTask;
right : Proposition speakerTask;
left : Proposition speakerTask;
center : Proposition speakerTask;
show_list : SingleAction;
add : Action addTask;
add_alone : SingleAction;
remove : Action removeTask;
remove_alone : SingleAction;
remove_all : SingleAction;
handle_list : SingleAction;
handle_player : SingleAction;
handle_stations : SingleAction;
askArtist : Ask artistQuestion;
askSong : Ask songQuestion;
askCurrent : SingleAsk;
}

View File

@@ -0,0 +1,154 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/English/:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/
concrete sharedDomainEng of sharedDomain = sharedCoreEng, DBEng **
open SpecResEng in {
flags conversion=finite;
lin
-- ANSWERS
answerSongPlay song = {s = variants {
( song.s );
( (itemForm ! Song) ++ song.s )
}
};
answerSongAdd song = {s = variants {
( song.s );
( (itemForm ! Song) ++ song.s )
}
};
answerSongRemove song = {s = variants {
( song.s );
( (itemForm ! Song) ++ song.s )
}
};
questionSong song = {s = variants {
( song.s );
( (itemForm ! Song) ++ song.s )
}
};
answerArtistPlay artist = {s = variants {
( artist.s );
( (itemForm ! Artist) ++ artist.s )
}
};
answerArtistAdd artist = {s = variants {
( artist.s );
( (itemForm ! Artist) ++ artist.s )
}
};
answerArtistRemove artist = {s = variants {
( artist.s );
( (itemForm ! Artist) ++ artist.s )
}
};
questionArtist artist = { s = variants {
( artist.s );
( (itemForm ! Artist) ++ artist.s )
}
};
answerStationPlay station = {s = variants {
( station.s);
( ["the station"] ++ station.s)
}
};
answerStationAdd station = {s = variants {
( station.s);
( ["the station"] ++ station.s)
}
};
answerStationRemove station = {s = variants {
( station.s);
( ["the station"] ++ station.s)
}
};
-- LIST RELATED ANSWERS
-- nummer fem
-- fem
answerNumberInListPlay numb = {s = variants {
( (listForm ! Numeric) ++ numb.s );
( numb.s )
}
};
answerNumberInListRemove numb = {s = variants {
( (listForm ! Numeric) ++ numb.s );
( numb.s )
}
};
-- den femte låten
-- den femte
answerOrderInListPlay ordNum =
{s = variants {
("the" ++ ordNum.s ++ (itemForm ! Post));
("the" ++ ordNum.s)
}
};
answerOrderInListRemove ordNum =
{s = variants {
("the" ++ ordNum.s ++ (itemForm ! Post));
("the" ++ ordNum.s)
}
};
-- LEXICON
pattern
play_spec = (variants {["play"] ; ["listen to"] ; "hear"});
play_spec_alone = variants {["play a specific song"] ; ["play a specific"] ; ["listen to a specific song"] ; ["hear a specific song"]};
play = (variants {["start from the beginning"] ; ["play"] ; ["start"]});
stop = (variants {["stop"]});
pause = ["pause"];
resume = (variants {["resume"] ; ["resume playing"]});
next = "next";
previous = "previous";
raise_volume = ["raise the volume"] ;
lower_volume = ["lower the volume"];
fastforward = ["fast forward"];
rewind = "rewind";
shift = "shift" ++ variants{ ["the balance"] ; ""};
right = variants{"" ; ["to the"]} ++ "right";
left = variants{"" ; ["to the"]} ++ "left";
center = variants{"" ; ["to the"]} ++ "middle";
show_list = ["show the list"];
add = ["add"];
add_alone = variants {["add a specific song"] ; ["add this"] ; ["add this one"]};
remove = ["remove"];
remove_alone = variants {["remove"] ; ["renmove this"] ; ["remove this one"]};
remove_all = ["clear the playlist"];
handle_list = ["manage the playlist"];
handle_player = ["talk to the player"];
handle_stations = ["choose a station"];
}

View File

@@ -0,0 +1,87 @@
-- SWEDISH VERSION, UNCOMMENT AS NEEDED
-- --# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/Swedish/:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/
--concrete sharedDomainPro of sharedDomain = sharedCorePro, numbersEng, orderNumEng, swedishDBPro ** {
-- ENGLISH VERSION, UNCOMMENT AS NEEDED
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/English/:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/
concrete sharedDomainPro of sharedDomain = sharedCorePro, DBPro ** {
flags lexer=code ; unlexer=code ;
flags conversion=finite;
lin
-- ANSWERS
answerSongPlay song = { s = "item" ++ "(" ++ song.s ++ ")"};
answerSongAdd song = { s = "item" ++ "(" ++ song.s ++ ")"};
answerSongRemove song = { s = "item" ++ "(" ++ song.s ++ ")"};
questionSong song = { s = "item" ++ "(" ++ song.s ++ ")"};
answerArtistPlay artist = { s = "group" ++ "(" ++ artist.s ++ ")"};
answerArtistAdd artist = { s = "groupToAdd" ++ "(" ++ artist.s ++ ")"};
answerArtistRemove artist = { s = "group" ++ "(" ++ artist.s ++ ")"};
questionArtist artist = {s = "group" ++ "(" ++ artist.s ++ ")"};
answerStationPlay station = { s = "station" ++ "(" ++ station.s ++ ")"};
answerStationAdd station = { s = "station" ++ "(" ++ station.s ++ ")"};
answerStationRemove station = { s = "station" ++ "(" ++ station.s ++ ")"};
answerNumberInListPlay numb = {s = "index" ++ "(" ++ "[" ++ numb.s ++ "]" ++ ")"};
answerNumberInListRemove numb = {s = "itemRem" ++ "(" ++ "[" ++ numb.s ++ "]" ++ ")"};
answerOrderInListPlay ordNum = {s = "index" ++ "(" ++ "[" ++ ordNum.s ++ "]" ++ ")"};
answerOrderInListRemove ordNum = {s = "itemRem" ++ "(" ++ "[" ++ ordNum.s ++ "]" ++ ")"};
-- LEXICON
pattern
play_spec = "start_specific";
play_spec_alone = "start_specific";
play = "start";
stop = "stop";
pause = "pause";
resume = "resume";
next = "next";
previous = "previous";
raise_volume = "vol_up" ;
lower_volume = "vol_down" ;
fastforward = "fast_forward";
rewind = "rewind";
shift = "set_balance";
right = "1.0";
left = "-1.0";
center = "0.0";
show_list = "show_list";
add = "playlist_add";
add_alone = "playlist_add";
remove = "playlist_del";
remove_alone = "playlist_del";
remove_all = "playlist_clear";
handle_list = "handle_playlist";
handle_player = "handle_player";
handle_stations = "handle_stations";
askArtist = "songs_by_artist";
askSong = "artists_song";
askCurrent = "current_song";
}

View File

@@ -0,0 +1,170 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/Swedish/:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/
concrete sharedDomainSwe of sharedDomain = sharedCoreSwe, DBSwe ** open SpecResSwe in{
flags conversion=finite;
lin
-- ANSWERS
answerSongPlay song = {s = variants {
( song.s );
( (itemForm ! Song) ++ song.s )
}
};
answerSongAdd song = {s = variants {
( song.s );
( (itemForm ! Song) ++ song.s )
}
};
answerSongRemove song = {s = variants {
( song.s );
( (itemForm ! Song) ++ song.s )
}
};
questionSong song = {s = variants {
( song.s );
( (itemForm ! Song) ++ song.s )
}
};
answerArtistPlay artist = {s = variants {
( artist.s );
( (itemForm ! Artist) ++ artist.s )
}
};
answerArtistAdd artist = {s = variants {
( artist.s );
( (itemForm ! Artist) ++ artist.s )
}
};
answerArtistRemove artist = {s = variants {
( artist.s );
( (itemForm ! Artist) ++ artist.s )
}
};
questionArtist artist = { s = variants {
( artist.s );
( (itemForm ! Artist) ++ artist.s )
}
};
answerStationPlay station = {s = variants {
( station.s);
( "stationen" ++ station.s)
}
};
answerStationAdd station = {s = variants {
( station.s);
( "stationen" ++ station.s)
}
};
answerStationRemove station = {s = variants {
( station.s);
( "stationen" ++ station.s)
}
};
-- LIST RELATED ANSWERS
-- nummer fem
-- fem
answerNumberInListPlay numb = {s = variants {
( (listForm ! Numeric) ++ numb.s );
( numb.s )
}
};
answerNumberInListRemove numb = {s = variants {
( (listForm ! Numeric) ++ numb.s );
( numb.s )
}
};
-- den femte låten
-- den femte
answerOrderInListPlay ordNum =
{s = variants {
("den" ++ ordNum.s ++ (itemForm ! Post));
("den" ++ ordNum.s)
}
};
answerOrderInListRemove ordNum =
{s = variants {
("den" ++ ordNum.s ++ (itemForm ! Post));
("den" ++ ordNum.s)
}
};
-- LEXICON
pattern
play_spec = (variants {["spela"] ; ["starta"] ; ["höra"] ; ["lyssna på"]});
play_spec_alone = variants {["spela"] ; ["spela den här"] ; ["spela den"] ; ["spela en speciell"] ; ["spela en speciell låt"]};
play = (variants {["spela från början"] ; ["spela"] ; ["starta"]});
stop = (variants {["stoppa"] ; ["avbryta"]});
pause = (variants {["pausa"] });
resume = (variants {["återuppta spelningen"] ; ["starta igen"]});
next = "nästa";
previous = "föregående";
raise_volume = "höja" ++ variants { ("volymen") ; ("ljudet")};
lower_volume = "sänka" ++ variants { ("volymen") ; ("ljudet")};
fastforward = ["spola framåt"];
rewind = ["spola bakåt"];
shift = variants{ ["ändra balansen"] ; "skifta"};
right = variants{"" ; "till"} ++ "höger";
left = variants{"" ; "till"} ++ "vänster";
center = variants{"" ; "till"} ++ "mitten";
show_list = ["visa listan"];
add = ["lägga till"];
add_alone = variants {["lägga till"]; ["lägg till den här"] ; ["lägg till den"]};
remove = ["ta bort"];
remove_alone = variants { ["ta bort"] ; ["ta bort den"] ; ["ta bort den här"] };
remove_all = variants {["rensa listan"] ; ["ta bort allt"]};
handle_list = ["ändra i spellistan"];
handle_player = ["prata med spelaren"];
handle_stations = ["välja en radiostation"];
-- FLYTTAT TILL userSpecificSwe.gf och systemSpecificSwe.gf pga
-- olika linearisering for system och användare.
--askArtist = variants { "låtar" ;
-- variants { variants {"vad" ; ["vilka låtar"]} ++ ["har jag"] ;
-- ["har jag någonting"]} ++ variants {"med" ; "av"}};
--askSong = variants { "artister" ; (["vem har"] ++ variants {"skrivit"; "gjort"})};
--askCurrent = ["vad heter"] ++ variants {["den här"] ; ["låten som spelas nu"]};
}

View File

@@ -0,0 +1,75 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/Swedish/:../../../Resorce/Media/English:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/:../../../Core/System
abstract systemDomain = sharedDomain, systemCore ** {
fun
-- PROPOSITIONS.
songProp : Song -> Proposition;
itemProp : Song -> Proposition;
currentSongProp : Song -> Proposition;
whatToPlayPropNum : Number -> Proposition;
whatToPlayPropOrd : Number -> Proposition;
itemRemPropNum : Number -> Proposition;
itemRemPropOrd : Number -> Proposition;
groupToAddProp : Artist -> Proposition;
artistProp : Artist -> Proposition;
groupProp : Artist -> Proposition;
songArtistProp : Artist -> Proposition;
albumProp : Album -> Proposition;
artistsSongProp : Artist -> Proposition;
artistsAlbumProp : Artist -> Proposition;
albumArtistProp : Album -> Proposition;
songsArtistProp : Song -> Proposition;
stationProp : Station -> Proposition;
actionProp : (t: Task) -> Action (t) -> Proposition;
-- Asks
whatSongQuestion : SingleAsk; -- "what song do you mean?"
whatArtistQuestion : SingleAsk; -- "what artist do you mean?"
whatIndexQuestion : SingleAsk; -- "what index do you mean?"
whatToRemoveQuestion : SingleAsk;
whatStationQuestion : SingleAsk; -- "what station do you want?"
whatAlbumQuestion : SingleAsk; -- "what album do you mean?"
whatToPlayQuestion : SingleAsk; -- "which song in the playlist do you want to lay?"
whatToRemove : SingleAsk; -- "What number do you want to remove?"
-- Confirms
addedToPlaylist : Confirm; -- "The playlist is increased"
removedFromPLaylist : Confirm; -- "The playlist is reduced"
clearedPlaylist : Confirm; -- "The playlist is cleared"
turnedUpVolume : Confirm; -- "Turning up the volume"
loweredVolume : Confirm; -- "Lowering the volume"
startingThePlayer : Confirm; -- "Starting the music"
stoppingThePlayer : Confirm; -- "Stopping the music"
pausingThePlayer : Confirm; -- "Pausing the music"
resumingThePlayer : Confirm; -- "Resuming the music"
shuffleTheList : Confirm; -- "The list has been shuffled"
ffing : Confirm;
rewinding : Confirm;
handlingstations : Confirm;
handlingplayer : Confirm;
handlingplaylist : Confirm;
showedList : Confirm;
}

View File

@@ -0,0 +1,106 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/English/:../../../Resorce/Media/Swedish:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/:../../../Core/System
concrete systemDomainEng of systemDomain = sharedDomainEng, systemCoreEng ** {
flags conversion=finite;
lin
-- PROPOSITIONS
songProp song = { s = song.s };
itemProp song = { s = song.s };
currentSongProp song = { s = song.s };
whatToPlayPropNum number = { s = number.s };
whatToPlayPropOrd order = { s = order.s };
itemRemPropNum number = { s = number.s };
itemRemPropOrd order = { s = order.s };
groupToAddProp artist = { s = artist.s };
artistProp artist = { s = artist.s};
groupProp artist = { s = artist.s };
songArtistProp artist = { s = artist.s };
albumProp album = { s = album.s };
artistsSongProp artist = { s = artist.s };
artistsAlbumProp artist = { s = artist.s };
albumArtistProp album = { s = album.s };
songsArtistProp song = { s = song.s };
stationProp station = { s = station.s };
actionProp _ action = {s = action.s };
-- sort_restr( song(X) ):- sem_sort(X,item).
-- sort_restr( item(X) ):- sem_sort(X,item).
-- sort_restr( current_song(X) ):- sem_sort(X,song).
-- sort_restr( what_to_play(X) ):- sem_sort(X,index).
-- sort_restr( itemRem(X) ):- sem_sort(X,index).
-- sort_restr( itemRem(X) ):- sem_sort(X,index).
-- sort_restr( groupToAdd(X) ):- group( X ).
-- sort_restr( artist(X) ):- group( X ).
-- sort_restr( group(X) ):- group( X ).
-- sort_restr( song_artist(X) ):- group( X ).
-- sort_restr( album(X) ):- album( X ).
-- sort_restr( artists_song(X) ):- group_atom( X ).
-- sort_restr( artists_album(X) ):- group_atom( X ).
-- sort_restr( albums_by_artist(X) ):- album_atom( X ).
-- sort_restr( songs_by_artist(X) ):- song_atom( X ).
-- sort_restr( station(X) ):- radio_station( X ).
-- sort_restr( year(X) ):- sem_sort( X, year ).
-- sort_restr( path(X) ):- atomic( X ).%,format("hallå: ~w\n",[X]).
-- %sort_restr( X^path(X) ):- atomic( X ),format("hallå: ~w\n",[X]).
-- sort_restr( not path(X) ):- format("hallå: ~w\n",[X]), atomic( X ).
-- sort_restr( fail(Path^path(Path),no_matches) ).
pattern
-- Because of differing linearisations in User and System usage these functions are not linearized in Shared.
askArtist = "song" ;
askSong = "artist" ;
askCurrent = ["the current song"];
-- Asks
whatSongQuestion = ["what song do you mean"];
whatArtistQuestion = ["what artist do you mean"];
whatIndexQuestion = ["what index number do you want to play"];
whatToRemoveQuestion = ["what song do you want to remove from the playlist"];
whatStationQuestion = ["what radio station do you want to listen to"];
whatAlbumQuestion = ["what album do you mean"];
whatToPlayQuestion = ["what song in the playlist do you want to play"];
whatToRemove = ["what song in the playlist do you want to remove"];
-- Confirms
addedToPlaylist = ["the playlist is increased"];
removedFromPLaylist = ["the playlist is reduced"];
clearedPlaylist = ["the playlist is cleared"];
turnedUpVolume = ["turning up the volume"];
loweredVolume = ["lowering the volume"];
startingThePlayer = ["starting the music"];
stoppingThePlayer = ["the player is stopped"];
pausingThePlayer = ["pausing the player"];
resumingThePlayer = ["resuming the music"];
shuffleTheList = ["the playlist has been shuffled"];
ffing = ["performing fast forward"];
rewinding = ["rewinding"];
handlingstations = ["done with choosing a station"];
handlingplayer = ["your wish is my command"];
handlingplaylist = ["done fiddling with the playlist"];
showedList = ["finished showing the list"];
}

View File

@@ -0,0 +1,98 @@
-- --# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/Swedish/:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/:../../../Core/System
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/English/:../../../Resorce/Media/Swedish:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/:../../../Core/System
concrete systemDomainPro of systemDomain = sharedDomainPro, systemCorePro ** {
flags conversion=finite;
lin
-- PROPOSITIONS
songProp song = { s = "song" ++ "(" ++ song.s ++ ")" };
itemProp song = { s = "item" ++ "(" ++ song.s ++ ")" };
currentSongProp song = { s = "current_song" ++ "(" ++ song.s ++ ")" };
whatToPlayPropNum number = { s = "what_to_play" ++ "(" ++ number.s ++ ")" };
whatToPlayPropOrd order = { s = "what_to_play" ++ "(" ++ order.s ++ ")" };
itemRemPropNum number = { s = "itemRem" ++ "(" ++ number.s ++ ")" };
itemRemPropOrd order = { s = "itemRem" ++ "(" ++ order.s ++ ")" };
groupToAddProp artist = { s = "groupToAdd" ++ "(" ++ artist.s ++ ")" };
artistProp artist = { s = "artist" ++ "(" ++ artist.s ++ ")"};
groupProp artist = { s = "group" ++ "(" ++ artist.s ++ ")" };
songArtistProp artist = { s = "song_artist" ++ "(" ++ artist.s ++ ")" };
albumProp album = { s = "album" ++ "(" ++ album.s ++ ")" };
artistsSongProp artist = { s = "artist_song" ++ "(" ++ artist.s ++ ")" };
artistsAlbumProp artist = { s = "artists_album" ++ "(" ++ artist.s ++ ")" };
albumArtistProp album = { s = "albums_by_artist" ++ "(" ++ album.s ++ ")" };
songsArtistProp song = { s = "songs_by_artist" ++ "(" ++ song.s ++ ")" };
stationProp station = { s = "station" ++ "(" ++ station.s ++ ")" };
actionProp _ action = {s = "action" ++ "(" ++ action.s ++ ")"};
-- sort_restr( song(X) ):- sem_sort(X,item).
-- sort_restr( item(X) ):- sem_sort(X,item).
-- sort_restr( current_song(X) ):- sem_sort(X,song).
-- sort_restr( what_to_play(X) ):- sem_sort(X,index).
-- sort_restr( itemRem(X) ):- sem_sort(X,index).
-- sort_restr( itemRem(X) ):- sem_sort(X,index).
-- sort_restr( groupToAdd(X) ):- group( X ).
-- sort_restr( artist(X) ):- group( X ).
-- sort_restr( group(X) ):- group( X ).
-- sort_restr( song_artist(X) ):- group( X ).
-- sort_restr( album(X) ):- album( X ).
-- sort_restr( artists_song(X) ):- group_atom( X ).
-- sort_restr( artists_album(X) ):- group_atom( X ).
-- sort_restr( albums_by_artist(X) ):- album_atom( X ).
-- sort_restr( songs_by_artist(X) ):- song_atom( X ).
-- sort_restr( station(X) ):- radio_station( X ).
-- sort_restr( year(X) ):- sem_sort( X, year ).
-- sort_restr( path(X) ):- atomic( X ).%,format("hallå: ~w\n",[X]).
-- %sort_restr( X^path(X) ):- atomic( X ),format("hallå: ~w\n",[X]).
-- sort_restr( not path(X) ):- format("hallå: ~w\n",[X]), atomic( X ).
-- sort_restr( fail(Path^path(Path),no_matches) ).
pattern
-- Asks
whatSongQuestion = ["x ^ item ( x )"];
whatArtistQuestion = ["x ^ group ( x )"];
whatIndexQuestion = ["x ^ index ( x )"];
whatToRemoveQuestion = ["x ^ song_to_remove ( x )"];
whatStationQuestion = ["x ^ station ( x )"];
whatAlbumQuestion = ["x ^ album ( x )"];
whatToPlayQuestion = ["x ^ what_to_play ( x )"];
whatToRemove = ["x ^ itemRem ( x )"];
-- Confirms
addedToPlaylist = "playlist_add"; -- "The playlist is increased"
removedFromPLaylist = "playlist_del"; -- "The playlist is reduced"
clearedPlaylist = "playlist_clear"; -- "The playlist is cleared"
turnedUpVolume = "vol_up"; -- "Turning up the volume"
loweredVolume = "vol_down"; -- "Lowering the volume"
startingThePlayer = variants {"start" ; "start_specific"};
stoppingThePlayer = "stop"; -- "Stopping the music"
pausingThePlayer = "pause"; -- "Pausing the music"
resumingThePlayer = "resume"; -- "Resuming the music"
shuffleTheList = "shuffle"; -- "The list has been shuffled"
ffing = "fast_fowrward";
rewinding = "rewind";
handlingstations = "handle_stations";
handlingplayer = "handle_player";
handlingplaylist = "handle_playlist";
showedList = "show_list";
}

View File

@@ -0,0 +1,105 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/Swedish/:../../../Resorce/Media/English:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/:../../../Core/System
concrete systemDomainSwe of systemDomain = sharedDomainSwe, systemCoreSwe ** {
flags conversion=finite;
lin
-- PROPOSITIONS
songProp song = { s = song.s };
itemProp song = { s = song.s };
currentSongProp song = { s = song.s };
whatToPlayPropNum number = { s = number.s };
whatToPlayPropOrd order = { s = order.s };
itemRemPropNum number = { s = number.s };
itemRemPropOrd order = { s = order.s };
groupToAddProp artist = { s = artist.s };
artistProp artist = { s = artist.s};
groupProp artist = { s = artist.s };
songArtistProp artist = { s = artist.s };
albumProp album = { s = album.s };
artistsSongProp artist = { s = artist.s };
artistsAlbumProp artist = { s = artist.s };
albumArtistProp album = { s = album.s };
songsArtistProp song = { s = song.s };
stationProp station = { s = station.s };
-- sort_restr( song(X) ):- sem_sort(X,item).
-- sort_restr( item(X) ):- sem_sort(X,item).
-- sort_restr( current_song(X) ):- sem_sort(X,song).
-- sort_restr( what_to_play(X) ):- sem_sort(X,index).
-- sort_restr( itemRem(X) ):- sem_sort(X,index).
-- sort_restr( itemRem(X) ):- sem_sort(X,index).
-- sort_restr( groupToAdd(X) ):- group( X ).
-- sort_restr( artist(X) ):- group( X ).
-- sort_restr( group(X) ):- group( X ).
-- sort_restr( song_artist(X) ):- group( X ).
-- sort_restr( album(X) ):- album( X ).
-- sort_restr( artists_song(X) ):- group_atom( X ).
-- sort_restr( artists_album(X) ):- group_atom( X ).
-- sort_restr( albums_by_artist(X) ):- album_atom( X ).
-- sort_restr( songs_by_artist(X) ):- song_atom( X ).
-- sort_restr( station(X) ):- radio_station( X ).
-- sort_restr( year(X) ):- sem_sort( X, year ).
-- sort_restr( path(X) ):- atomic( X ).%,format("hallå: ~w\n",[X]).
-- %sort_restr( X^path(X) ):- atomic( X ),format("hallå: ~w\n",[X]).
-- sort_restr( not path(X) ):- format("hallå: ~w\n",[X]), atomic( X ).
-- sort_restr( fail(Path^path(Path),no_matches) ).
pattern
-- Because of differing linearisations in User and System usage these functions are not linearized in Shared.
askArtist = "låtar" ;
askSong = "artister" ;
askCurrent = ["låten som spelas nu"];
-- Asks
whatSongQuestion = ["vilken sång menar du"];
whatArtistQuestion = ["vilken artist menar du"];
whatIndexQuestion = ["vilket index nummer vill du spela"];
whatToRemoveQuestion = ["vilken sång vill du ta bort från spellistan"];
whatStationQuestion = ["vilken radiostation vill du lyssna på"];
whatAlbumQuestion = ["vilket album menar du"];
whatToPlayQuestion = ["vad i spellistan vill du spela"];
whatToRemove = ["vad i spellistan vill du ta bort"];
-- Confirms
addedToPlaylist = ["spellistan är utökad"];
removedFromPLaylist = ["spellistan är reducerad"];
clearedPlaylist = ["spellistan är rensad"];
turnedUpVolume = ["höjer volymen"];
loweredVolume = ["sänker volymen"];
startingThePlayer = ["startar uppspelningen"];
stoppingThePlayer = ["spelaren är stoppad"];
pausingThePlayer = ["pausar uppspelningen"];
resumingThePlayer = ["återupptar uppspelningen"];
shuffleTheList = ["spellistan har blandats"];
ffing = ["spolar frammåt"];
rewinding = ["spolar bakåt"];
handlingstations = ["klar med att välja radiostation"];
handlingplayer = ["jag fixar"];
handlingplaylist = ["klar med spellistan"];
showedList = ["spellistan är visad"];
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,19 @@
-- SWEDISH VERSION, UNCOMMENT WHEN NEEDED
----# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/Swedish/:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/:../../../Core/User
-- ENGLISH VERSION, UNCOMMENT WHEN NEEDED
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/English/:../../../Resorce/Media/Swedish:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/:../../../Core/User
abstract userDomain = userCore, sharedDomain ** {
fun
-- CompoundedAnswers
answerSongArtistPlay : Song -> Artist -> AnswerList playTask;
answerSongArtistAdd : Song -> Artist -> AnswerList addTask;
}

View File

@@ -0,0 +1,29 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/Swedish/:../../../Resource/Media/English:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/:../../../Core/User
concrete userDomainEng of userDomain = userCoreEng, sharedDomainEng ** {
flags conversion=finite;
lin
-- CompoundedAnswers
answerSongArtistPlay song artist = {s = variants {(song.s ++ "with" ++ artist.s)
; (artist.s ++ "with" ++ song.s)} };
answerSongArtistAdd song artist = {s = variants {(song.s ++ "with" ++ artist.s)
; (artist.s ++ "with" ++ song.s)} };
pattern
askArtist = variants { ["what do i have"] ; ["what songs do i have"] ; ["do i have anything"]}
++ variants {"with" ; "by"};
askSong = ["who"] ++ variants {"made"; "wrote"};
askCurrent = ["what"] ++ variants {["song is this"] ; ["is this called"]};
}

View File

@@ -0,0 +1,15 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/English/:../../../Resource/Media/Swedish:../../../Resorce/Media/Swedish:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/:../../../Core/User
concrete userDomainPro of userDomain = userCorePro, sharedDomainPro ** {
flags conversion=finite;
lin
answerSongArtistPlay song artist = { s = ["answer ( item ("] ++ song.s ++ [" ) ) ,"] ++
["answer ( group ("] ++ artist.s ++ [") )"]};
answerSongArtistAdd song artist = { s = ["answer ( item ("] ++ song.s ++ [" ) ) ,"] ++
["answer ( group ("] ++ artist.s ++ [") )"]};
}

View File

@@ -0,0 +1,29 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/Swedish/:../../../Resorce/Media/English:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/:../../../Core/User
concrete userDomainSwe of userDomain = userCoreSwe, sharedDomainSwe ** {
flags conversion=finite;
lin
-- CompoundedAnswers
answerSongArtistPlay song artist = {s = variants {(song.s ++ "med" ++ artist.s)
; (artist.s ++ "med" ++ song.s)} };
answerSongArtistAdd song artist = {s = variants {(song.s ++ "med" ++ artist.s)
; (artist.s ++ "med" ++ song.s)} };
pattern
askArtist = variants { ["vad har jag"] ; ["vilka låtar har jag"] ; ["har jag någonting"]}
++ variants {"med" ; "av"};
askSong = ["vem har"] ++ variants {"skrivit"; "gjort"};
askCurrent = ["vad heter"] ++ variants {["den här"] ; ["låten som spelas nu"]};
}

View File

@@ -0,0 +1,27 @@
-- A file with Pointers...
-- With pointers I mean the phrases that point out a specific semantics of a segment.
-- Example "I want to listen to the artist Sting" where "the artist" makes clear
-- that "Sting" is an artist and not a song for instance.
resource SpecResEng = {
param ListInfo = Numeric | Ordered ;
param ItemChoice = Artist | Song | Post;
oper listForm : ListInfo => Str
= table {
Numeric => ["number"];
Ordered => ["the"]
};
oper itemForm : ItemChoice => Str
= table {
Artist => ["the artist"];
Song => ["the song"];
Post => ""
};
}

View File

@@ -0,0 +1,27 @@
-- A file with Pointers...
-- With pointers I mean the phrases that point out a specific semantics of a segment.
-- Example "I want to listen to the artist Sting" where "the artist" makes clear
-- that "Sting" is an artist and not a song for instance.
resource SpecResSwe = {
param ListInfo = Numeric | Ordered ;
param ItemChoice = Artist | Song | Post;
oper listForm : ListInfo => Str
= table {
Numeric => ["nummer"];
Ordered => ["den"]
};
oper itemForm : ItemChoice => Str
= table {
Artist => "artisten";
Song => "låten";
Post => ""
};
}

View File

@@ -0,0 +1,5 @@
--# -path=.:../../Resource/Home
abstract DB = Lamps, Rooms ** {
}

View File

@@ -0,0 +1,5 @@
--# -path=.:../../Resource/Home
concrete DBEng of DB= LampsEng, RoomsEng ** {
}

View File

@@ -0,0 +1,5 @@
--# -path=.:../../Resource/Home
concrete DBPro of DB= LampsPro, RoomsPro ** {
}

View File

@@ -0,0 +1,5 @@
--# -path=.:../../Resource/Home
concrete DBSwe of DB= LampsSwe, RoomsSwe ** {
}

View File

@@ -0,0 +1,50 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Home/:../../../Core:../../../Core/Shared/:../../../Core/System
abstract sharedDomain = sharedCore, DB ** {
fun
-- ANSWERS
answerLampOn : Lamp -> Proposition onTask;
answerLampOff : Lamp -> Proposition offTask;
answerLocation : Room -> Proposition locateTask;
-- Ask Answers
questionWhichLamp : Lamp -> Proposition lampQuestion;
questionLocation : Room -> Proposition locQuestion;
-- LEXICON
onTask : Task;
offTask : Task;
locateTask : Task;
lampQuestion : Task;
locQuestion : Task;
turnOn : Action onTask;
turnOff : Action offTask;
turnOnThis : SingleAction;
turnOffThis : SingleAction;
dimmerUp : SingleAction;
dimmerDown : SingleAction;
--askLamp : Ask lampQuestion;
--askLocation : Ask locQuestion;
askStatusLamp : SingleAsk;
}

View File

@@ -0,0 +1,46 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Home/:../../../Core:../../../Core/Shared/:../../../Core/System
concrete sharedDomainEng of sharedDomain = sharedCoreEng, DBEng **
open SpecResEng in {
lin
-- ANSWERS
answerLampOn lamp = {s = lamp.s};
answerLampOff lamp = {s = lamp.s};
answerLocation loc = {s = loc.s};
questionWhichLamp lamp = {s = lamp.s};
questionLocation loc = {s = loc.s};
-- LEXICON
pattern
turnOn = ["turn on"];
turnOff = ["turn off"];
turnOnThis = ["turn on"];
turnOffThis = ["turn off"];
dimmerUp = ["dim up"];
dimmerDown = ["dim down"];
--askLamp = ["do i have a"];
--askLocation = ["is there a"];
askStatusLamp = ["what lights are on"];
}

View File

@@ -0,0 +1,43 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Home/:../../../Core:../../../Core/Shared/:../../../Core/System
concrete sharedDomainPro of sharedDomain = sharedCorePro, DBPro ** {
lin
-- ANSWERS
answerLampOn lamp = {s = lamp.s};
answerLampOff lamp = {s = lamp.s};
answerLocation loc = {s = loc.s};
questionWhichLamp lamp = {s = lamp.s};
questionLocation loc = {s = loc.s};
-- LEXICON
pattern
turnOn = "turnOn";
turnOff = "turnOff";
turnOnThis = "turnOn_closest";
turnOffThis = "turnOff_closest";
dimmerUp = "dimmer_up";
dimmerDown = "dimmer_down";
--askLamp = "lamps";
--askLocation = "locations";
askStatusLamp = "status";
}

View File

@@ -0,0 +1,48 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Home/:../../../Core:../../../Core/Shared/:../../../Core/System
concrete sharedDomainSwe of sharedDomain = sharedCoreSwe, DBSwe ** {
lin
-- ANSWERS
answerLampOn lamp = {s = lamp.s};
answerLampOff lamp = {s = lamp.s};
answerLocation loc = {s = loc.s};
questionWhichLamp lamp = {s = lamp.s};
questionLocation loc = {s = loc.s};
-- LEXICON
pattern
turnOn = "tända";
turnOff = "släcka";
turnOnThis = "tända";
turnOffThis = "släcka";
dimmerUp = ["dimma upp"];
dimmerDown = ["dimma ner"];
--askLamp = ["har jag en"];
--askLocation = ["finns det ett"];
askStatusLamp = ["vilka lampor är tända"];
}

View File

@@ -0,0 +1,58 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Home/:../../../Core:../../../Core/Shared/:../../../Core/System
abstract sharedDomain = sharedCore, DB ** {
fun
-- ANSWERS
-- Ett alternativ är att gära en Task för varje action som
-- finns i domänen. Alltså En erase Task, en play Task och en add Task
-- på det sattet kan man gora funktioner som tar "nummer fem" och gör en
-- "Object play" och en "Object erase" men inte en "Object add".
-- Request Answers
answerLampOn : Lamp -> Object onTask;
answerLampOff : Lamp -> Object offTask;
answerLocation : Location -> Object locateTask;
-- Ask Answers
questionWhichLamp : Lamp -> Object lampQuestion;
questionLocation : Location -> Object locQuestion;
-- LEXICON
onTask : Task;
offTask : Task;
locateTask : Task;
lampQuestion : Task;
locQuestion : Task;
turnOn : Action onTask;
turnOff : Action offTask;
turnOnThis : SingleAction;
turnOffThis : SingleAction;
dimmerUp : SingleAction;
dimmerDown : SingleAction;
--askLamp : Ask lampQuestion;
--askLocation : Ask locQuestion;
askStatusLamp : SingleAsk;
}

View File

@@ -0,0 +1,34 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Home/:../../../Core:../../../Core/Shared/:../../../Core/System
abstract systemDomain = sharedDomain, systemCore ** {
fun
-- PROPOSITIONS.
--
lampProp : Lamp -> Proposition onTask;
locProp : Room -> Proposition onTask;
whatToTurnOffProp : Lamp -> Proposition offTask;
whatToTurnOnProp : Lamp -> Proposition onTask;
-- Asks
whatLampQuestion : SingleAsk; -- "what song do you mean?"
whatLocQuestion : SingleAsk; -- "what artist do you mean?"
-- Confirms
turnedOnLamp : Confirm;
turnedOffLamp : Confirm;
}

View File

@@ -0,0 +1,32 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Home/:../../../Core:../../../Core/Shared/:../../../Core/System
--# -path=.:../:../DBase/:../Shared
concrete systemDomainEng of systemDomain = sharedDomainEng, systemCoreEng ** {
lin
-- PROPOSITIONS
lampProp lamp = { s = lamp.s };
locProp loc = { s = loc.s };
whatToTurnOffProp lamp = { s = lamp.s };
whatToTurnOnProp lamp = { s = lamp.s };
pattern
-- Asks
whatLampQuestion = ["what lamp do you mean"];
whatLocQuestion = ["what room do you mean"];
-- Confirms
turnedOnLamp = ["the light is on"];
turnedOffLamp = ["the light is turned off"];
}

View File

@@ -0,0 +1,28 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Home/:../../../Core:../../../Core/Shared/:../../../Core/System
concrete systemDomainPro of systemDomain = sharedDomainPro, systemCorePro ** {
lin
-- PROPOSITIONS
lampProp lamp = { s = lamp.s };
locProp loc = { s = loc.s };
whatToTurnOffProp lamp = { s = lamp.s };
whatToTurnOnProp lamp = { s = lamp.s };
pattern
-- Asks
whatLampQuestion = ["X^lamp(X)"];
whatLocQuestion = ["X^loc(X)"];
-- Confirms
turnedOnLamp = ["turnOn"];
turnedOffLamp = ["turnOff"];
}

View File

@@ -0,0 +1,28 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Home/:../../../Core:../../../Core/Shared/:../../../Core/System
concrete systemDomainSwe of systemDomain = sharedDomainSwe, systemCoreSwe ** {
lin
-- PROPOSITIONS
lampProp lamp = { s = lamp.s };
locProp loc = { s = loc.s };
whatToTurnOffProp lamp = { s = lamp.s };
whatToTurnOnProp lamp = { s = lamp.s };
pattern
-- Asks
whatLampQuestion = ["vilken lampa menar du"];
whatLocQuestion = ["vilket rum menar du"];
-- Confirms
turnedOnLamp = ["lampan är tänd"];
turnedOffLamp = ["lampan är släckt"];
}

View File

@@ -0,0 +1,13 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Home/:../../../Core:../../../Core/Shared/:../../../Core/User
abstract userDomain = userCore, sharedDomain ** {
fun
-- CompoundedAnswers
answerLampLocTurnOn : Lamp -> Room -> AnswerList onTask;
answerLampLocTurnOff : Lamp -> Room -> AnswerList offTask;
}

View File

@@ -0,0 +1,12 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Home/:../../../Core:../../../Core/Shared/:../../../Core/User
concrete userDomainEng of userDomain = userCoreEng, sharedDomainEng ** {
lin
-- CompoundedAnswers
-- CompoundedAnswers
answerLampLocTurnOn lamp loc = {s = lamp.s ++ "in" ++ loc.s};
answerLampLocTurnOff lamp loc = {s = lamp.s ++ "in" ++ loc.s};
}

View File

@@ -0,0 +1,14 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Home/:../../../Core:../../../Core/Shared/:../../../Core/User
concrete userDomainPro of userDomain = userCorePro, sharedDomainPro ** {
lin
-- CompoundedAnswers
answerLampLocTurnOn lamp loc = {s = "answer(lamp(" ++ lamp.s ++ ")," ++
"answer(loc(" ++ loc.s ++ ")"};
answerLampLocTurnOff lamp loc = {s = "answer(lamp(" ++ lamp.s ++ ")," ++
"answer(loc(" ++ loc.s ++ ")"};
}

View File

@@ -0,0 +1,11 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Home/:../../../Core:../../../Core/Shared/:../../../Core/User
concrete userDomainSwe of userDomain = userCoreSwe, sharedDomainSwe ** {
lin
-- CompoundedAnswers
answerLampLocTurnOn lamp loc = {s = lamp.s ++ "i" ++ loc.s};
answerLampLocTurnOff lamp loc = {s = lamp.s ++ "i" ++ loc.s};
}