8.0

### 5Phase Transitions

 (require planning/examples/phase-transition) package: planning

In chemistry, a phase transition is a change from one state of matter to another. Matter can exist in multiple phases — consider a glass of water with an ice cube in it. Therefore, phase transitions can be modeled as set actions that act on the set of phases that a collection of matter is currently in. This is not practically useful on its own, but it serves as an illustrative example of how to use the set state representation.

 procedure v : any/c
A predicate for the states of matter. Returns true if v is one of the constants representing the three states of matter: solid, liquid, and gas.

 value
 value
 value
Three basic states of matter. Other, more exotic states of matter exist, but we omit them to keep the examples simple.

 value
 value
 value
 value
 value
 value
Total phase transitions between the three basic states of matter. Each transition requires some matter to exist in a specific state, then once it is applied that matter is transformed into a different state.

Examples:
 > (set-act (set liquid) freeze) (set #) > (set-act (set solid) evaporate) set-act: contract violation; The action must be applicable to the set. set: (set #) action: (set-action #:additions (set #) #:cost 1 #:deletions (set #) #:obstructions (set) #:requirements (set #)) in: (->i ((set set?) (action set-action?)) #:pre/name (set action) "The action must be applicable to the set." (set-action-applicable? action set) (_ set?)) contract from: /planning/set/action.rkt blaming: top-level (assuming the contract is correct) at: /planning/set/action.rkt:7.3

 value
 value
 value
 value
 value
 value
Partial phase transitions between the basic states of matter, in which some — but not all — of the matter is changed from one phase to another.

Example:
 > (set-act (set solid) partially-melt) (set # #)