LogicCrowd: Bridging Human Intelligence and Logic Programming with Energy-Awareness
Declarative Programming for Mobile Crowdsourcing: Energy Considerations and Applications
This paper introduces LogicCrowd, a declarative programming platform for mobile crowdsourcing that extends Prolog with crowd-based predicates. It integrates social media and P2P networks (Bluetooth/Wi-Fi) into logic programming and proposes an energy-aware meta-interpreter that manages task execution based on a calculated battery energy budget.
TL;DR
LogicCrowd is an innovative platform that brings the power of Prolog to mobile crowdsourcing. By extending logic programming with specialized "crowd predicates," it allows developers to query humans as easily as they query a local database. Crucially, the system introduces a metainterpreter that predicts battery drain and prevents your phone from dying while waiting for a crowd response.
Background: The Power of the Crowd meets Logic
Crowdsourcing platforms like Amazon Mechanical Turk have long provided access to human intelligence for tasks machines struggle with (e.g., identifying events in a photo). However, integrating these human "oracles" into mobile applications is fraught with issues: network latency, varying connectivity (Bluetooth vs. Wi-Fi), and extreme battery consumption. LogicCrowd enters the frame by positioning this as a declarative programming problem, leveraging the transparency and compact code of Prolog.
Problem & Motivation: The Energy "Black Hole"
The primary hurdle in mobile crowdsourcing is the waiting period. Unlike a CPU query that returns in milliseconds, a human might take 30 minutes to answer a question about a photo. During this time, a mobile device might keep its radio or screen active, leading to RAPID battery depletion. Existing works like Crowd4U or Deco simplified the programming interface but treated the mobile device as if it had infinite power.
Methodology: The LogicCrowd Architecture
The core of LogicCrowd is an extension of the tuProlog engine for Android.
1. Crowd Predicates
Tasks are represented as predicates: crowd_KW ? (Answer) # [conditions].
For example:
place? (Answer) # [asktype('photo'), question('Where is it?')]
2. Execution Modes: Sync vs. Async
- Synchronous: The program blocks, waiting for the crowd.
- Asynchronous: The system creates a background thread, allowing the main logic to continue—a vital feature for maintaining app responsiveness.
3. The Energy-Aware Meta-Interpreter
The researchers built a model to predict energy consumption () based on the waiting time ().

The meta-interpreter checks the Energy Budget () before firing a query. If the predicted cost , the task is skipped to save the phone from shutting down.
Experiments & Results: Bluetooth vs. Wi-Fi
The authors conducted extensive benchmarks using a Nexus S and a power monitoring tool.
- The "Mix" Penalty: Using both Wi-Fi and Bluetooth simultaneously (Mix mode) is the most expensive, often 1.27x more power-intensive than Bluetooth alone.
- The Display Tax: Surprisingly, the study found the screen (display) accounts for 70–90% of power usage during foreground waiting, suggesting that background asynchronous processing is not just a convenience, but a necessity for battery life.
- Linear Scalability: Energy consumption grows linearly with both the number of rules and the expiry/timeout duration, making it highly predictable for the meta-interpreter's modeling logic.
Figure: Comparison of Synchronous vs Asynchronous consumption across different connection types.
Critical Insight & Conclusion
LogicCrowd's most significant achievement isn't just "Prolog on a phone," but rather the semantic integration of resource management. By embedding health-checks directly into the language’s evaluation cycle (the meta-interpreter), the system shifts the burden of energy management from the developer to the runtime.
Takeaways:
- Asynchronous is King: To scale mobile crowdsourcing, developers must decouple the query from the UI thread to avoid the "Display Tax."
- Declarative Power: Logic programming allows for sophisticated "program transformations" where energy constraints can be automatically injected into user code.
- Limitations: The current model is linear and specific to the tested hardware (Nexus S). Future work needs to adapt to dynamic network conditions (like 5G signal fluctuation) and more complex user policies.
As mobile devices become more integrated with "Human-in-the-Loop" AI, the principles laid out in LogicCrowd—balancing the 'wisdom of the crowd' with the 'reality of the battery'—will become increasingly foundational.
