Fixed the trash NC State DeepThought grading system for CSC226.
Hopefully they will update their annoying system.
This API provides endpoints for retrieving applicable logical rules and applying specific rules to given propositions.
Endpoint:
GET /autocomplete_rules_available
Returns a list of applicable logical rules based on the given propositions.
Request
• left (optional): First proposition (string).
• right (optional): Second proposition (string).
{
"left": "P -> Q"
}
Response
• If valid propositions are provided, returns a list of applicable rules.
• If both propositions are missing, returns an error.
• If syntax errors exist in the propositions, returns an error.
{
"data": [
"DoubleNegation",
"ConditionalIdentity",
"Contrapositive",
"Tautology"
],
"error": ""
}
Endpoint:
GET /apply_the_rule
Applies a given logical rule to one or two provided propositions and returns the resulting propositions.
Request
• rule (required): A valid logical rule from the predefined Rule set.
• left (optional): First proposition (string).
• right (optional): Second proposition (string).
{
"rule": "DeMorgan",
"left": "!(P & Q)"
}
Response
• Returns the transformed propositions after applying the rule.
• If the rule cannot be applied to the given propositions, an error is returned.
• If invalid syntax or missing propositions are detected, an error is returned.
{
"data": [
"(!P | !Q)"
],
"error": ""
}