"sim/chpsim/TODO"
#	$Id: TODO,v 1.11 2008/03/17 23:02:49 fang Exp $

===============================================================================
chpsim:
(Maybe these should be ordered in some dependency graph...)

high-priority:
	primitive trace querying functions [much done]

medium-priority:
	trace replay mechanism, seeking to specific state/time.
	non-atomic expression evaluation: [IMPORTANT] 
		rvalue and lvalues of assignments, channel send/receive 
		may contain arbitrary nonmeta-expressions.
		Q: when/how should they be expanded, at source/tree level,
			in intermediate representation, or event-generation?
			Q: should we do version tracking?
		Q: when should evaluation of expressions *begin*?
			do we require flow analysis?
		A: safe to start right when channel event is ready, 
			i.e. predecessors done, and channel state is ready
	support: value probes, missing from CHP language!
		in-source assertions
		these will be implemented as CHP statement attributes,
			BUT we may have two flavors of attributes:
			compile-time (same as construction time)
			and run-time (upon event execution).  
		value-peeks [STATUS: done]
			TODO: partial receives X#(a,,c)
				receive values into optional variables,
				e.g. X? or X?(,,)
	timing: interface to edit event delays, load back-annotation file?
		possibly more elaborate code to customize delays systematically
	checkpointing: [STATUS: basics done]
		need to remember invocation options in state, 
		and compare when loading checkpoint for consistency.  
		Rigorous testing: take checkpoint at EVERY step to 
			maximize coverage.  Can be expensive, so do this with 
			select representative test cases.  
	'nobreakall' or 'breaks-off' and 'breaks-on'
	'nowatchall' is done, maybe alias to 'watches-on' and 'watches-off'
		purpose: to be able to quickly turn off and restore
			previous watch/breakpoint configuration, 
			same as prsim
	graphical (dot-style) animation, perhaps trace replay back-end!
		just emit style directives to color nodes/edges of the graph.
		prerequisite: tracing when events are blocked/unblocked.
		benefits: visual debugging.

low-priority:
	stability checking mode:
		(Does something change between time of enqueue to 
			time of execution?)
		for guard expressions
		variables referenced (and their values)
	backtrace: like prsim: recent last-arrival event chain, up to a cycle
	add -t <type> argument analogous to cflat's
	minor enhancement:
		coalesce common subtrees of forks and joins [low priority]
	visualization: 
		print process-subgraphs as clusters [done]
		print allocated instances and dependency edges to them
			prereq: static data-dependencies and anti-dependencies
		[done for channels only]
	enhancement: Maybe flag references that are meta to avoid re-checking
		as nonmeta references at run-time.  
		Possibly cache-it as a redundant pointer in CHP expressions.
		Better yet, cache the resolved index as a
			global_indexed_reference.  
		This may take considerable reworking of nonmeta-references.  
		May need some sort of resolved reference record for each 
		CHP-sim event to speed up accesses.  Record would be similar
		in function to nonmeta_channel_manipulator: a statement would
		simply read-and-advance resolved references.  
	channels: add support for sized types, e.g. bool[4]
	int<W>: using integer width to mask values
		and perform range-checking?
	integer value formatting preference for dumping?
	variable (variable-dependent) delays
	additional traces: event blocking trace

===============================================================================
BUGS:

===============================================================================
completed work (for the record):
	[can wipe these any time]

	footprint-ize: processes' CHP event subgraphs, easier because
		they are not shared.  This way, process events can be 
		allocated in chunks and clustered together.  
		Compute subgraph (templatized) once per process type.  
		These footprints *could* just use local 
		instance IDs plus a footprint frame lookup.  
		Advantage: makes graph allocation and event-mapping easier
		[STATUS: DONE]
	expr_dump_context: enhance with optional prefix string for
		the enclosing process, useful for printing events with
		more reasonable process names (instead of just pid number)
		[done. using non-canonical names]
		RELATED: use static analysis (post event-graph construction)
		to label channel edges between sends and receives, tagging 
		with canonical channel names (using static analysis)!
		Can use the block-set of channels to deduce.  [done]
		Event boxes can retain their local, non-canonical names.  
		NOTE: large graphs could get ugly...
	channel probes: [STATUS: DONE]
	checkpointing: [STATUS: basics done]
	trace recording: [STATUS: basics done]
	re-writing execution model: prefix delays [STATUS: DONE]
		implementation: event-queue will now be used for first-time 
		checking of events rather than for execution of events.  

===============================================================================
