Lab 7 — Location Tags
Skills: 4, 5, 11
The goal of this lab will be to build many functions related to tracking tags.
Given Data Definitions
A TagId is a String
Interpretation: a unique identifier for a tracking tag
Examples:
TAG1 = "t1"
TAG2 = "t2"
TAG3 = "t3"
Template:
#|
fun tagid-temp(ti :: String) -> ???:
... ti ...
end
|#
A Time is a Number
Interpretation: a time represented by the number of seconds since Jan 1, 2025.
Examples:
TIME1 = 10
TIME2 = 20
TIME3 = 30
Template:
#|
fun time-temp(t :: Number) -> ???:
... t ...
end
|#
An Encounter is a:
data Encounter:
| own-tag-encounter(tagid :: String, time :: Number)
| other-tag-encounter(tagid :: String, time :: Number)
end
Interpretation: a record of a tag being seen by your phone: if the tag was your own, it will be an own-tag-encounter, whereas if it is a tag that doesn't belong to you, it will be an other-tag-encounter.
Examples:
ENCOUNTER1 = own-tag-encounter(TAG1, TIME1)
ENCOUNTER2 = own-tag-encounter(TAG1, TIME2)
ENCOUNTER3 = other-tag-encounter(TAG2, TIME3)
Template:
#|
fun encounter-temp(e :: Encounter) -> ???:
cases(Encounter) e:
| own-tag-encounter(tagid, time) =>
... tagid ...
... time ...
| other-tag-encounter(tagid, time) =>
... tagid ...
... time ...
end
end
|#
Problem 1
Design a function own-encounters that takes a List<Encounter> and returns a List<Encounter> that only contains those Encounters that were own-tag-encounters. You should use list recursion with cases, not a for each loop.
Problem 2
Design a function tag-activity-count that takes a TagId, a List<Encounter> and calculates how many times the tag has been encountered. You should use list recursion with cases, not a for each loop.
Problem 3
Design a function last-encounter that takes a TagId and a List<Encounter> and returns the biggest Time that occurs in the list (it can be in an own-tag-encounter or a other-tag-encounter) with the given TagId. If the list is empty it should return -1. You should use list recursion with cases, not a for each loop.
Problem 4
Location tags can be used maliciously, most prominently for stalking. Abusive ex-partners (or other people) can secretly put tags in their target's car or in an item such as a bag and then use the location mechanism to track the person driving the car or carrying the bag.
Location tags have some privacy protections: tags often will emit an audible beep after separated from their owner for long enough (but those speakers can be intentionally damaged or removed), and given the right software support, might notify a non-owner that they are near. However, these privacy protections are recent additions. The risk of abuse was only taken seriously well after the products were initially released, and indeed, after lawsuits filed alleging the particular use of these tools for stalking.
For more information, see these articles:
- https://freedium.cfd/https://onezero.medium.com/-cybersecurity-workers-need-to-learn-from-victims-9db34f3db198
- https://apnews.com/article/apple-airtags-stalking-lawsuits-e59166988920c4ba1e82956ea85c1677
In order to design location tags to minimize privacy risks from the beginning, we should analyze their privacy using the below table:
| Question | Answer |
|---|---|
| What type of information is shared? | [to be filled in] |
| Who is the subject of the information? | [to be filled in] |
| Who is the sender of the information? | The location tag device |
| Who are the potential recipients of the information? | Intended: The purchaser of the tag who uses it to track their own belongings Unintended: [to be filled in] |
| What principles govern the collection and transmission of the information? | Purchase implies consent to tracking one's own items. People who are unknowingly being tracked have not consented to the transmission of information about their location. There is minimal regulation on who can buy/use tags or what properties the tags have. Data is transmitted through global phone network without verification of legitimate use. |
For any gaps, include them in comments. For unintended recipients, list one recipient directly mentioned in the setup above and two additional unique categories of unintended recipients.