ControlTask

Generic interpreter only: the problem supplies all dynamics and goals.
Imports
import ControlProgram; import ControlTrace; import ControlRun; import ControlReport; import ControlObservation; import Math;
Table of Contents

Functions

mask_from

def mask_from (count : Int) (sense : (test : Int) → (s : a) → Bool) (s : a) : Int

mark

def mark (status : Int) (pc : Int) (r : (ControlRun a)) : (ControlRun a)

execute

def execute (record : Bool) (actions : Int) (predicates : Int) (advance : (choice : Int) → (s : a) → a) (cost : (choice : Int) → (s : a) → Float) (invalid : (s : a) → Bool) (sense : (test : Int) → (s : a) → Bool) (abstract : (s : a) → Int) (program : ControlProgram) (pc : Int) (run : (ControlRun a)) : (ControlRun a)

evaluate

def evaluate (record : Bool) (actions : Int | actions > 0 && actions ≤ 32) (predicates : Int | predicates > 0 && predicates ≤ 16) (horizon : Int | horizon > 0 && horizon ≤ 500) (advance : (choice : Int) → (s : a) → a) (cost : (choice : Int) → (s : a) → Float) (invalid : (s : a) → Bool) (sense : (test : Int) → (s : a) → Bool) (abstract : (s : a) → Int) (initial : a) (program : ControlProgram) : (ControlRun a)

run

Scoring does not collect observations; trace collection is opt-in.
def run (actions : Int | actions > 0 && actions ≤ 32) (predicates : Int | predicates > 0 && predicates ≤ 16) (horizon : Int | horizon > 0 && horizon ≤ 500) (advance : (choice : Int) → (s : a) → a) (cost : (choice : Int) → (s : a) → Float) (invalid : (s : a) → Bool) (sense : (test : Int) → (s : a) → Bool) (abstract : (s : a) → Int) (initial : a) (program : ControlProgram) : (ControlRun a)

record

def record (actions : Int | actions > 0 && actions ≤ 32) (predicates : Int | predicates > 0 && predicates ≤ 16) (horizon : Int | horizon > 0 && horizon ≤ 500) (advance : (choice : Int) → (s : a) → a) (cost : (choice : Int) → (s : a) → Float) (invalid : (s : a) → Bool) (sense : (test : Int) → (s : a) → Bool) (abstract : (s : a) → Int) (initial : a) (program : ControlProgram) : (ControlRun a)

score

The terminal loss is supplied by the problem, including any penalty for an unfinished horizon. A partial prefix is observable but never a final solution.
def score (finish : (remaining : Int) → (status : Int) → (s : a) → Float) (run : (ControlRun a)) : Float

report

def report (horizon : Int) (loss : Float) (run : (ControlRun a)) (rest : ControlReport) : ControlReport