560 likes | 728 Views
CHR + D + A + O Operational Semantics in Fluent Calculus. December, 2007. Simple Fluent Calculus (SFC). Introduction. A many-sorted first-order language with equality Includes: Sorts: FLUENT < STATE, ACTION, SIT Functions: Predicate. Abbreviations. Foundational Axioms (F state ).
E N D
CHR + D + A + O Operational Semantics in Fluent Calculus December, 2007
Introduction • A many-sorted first-order language with equality • Includes: • Sorts: FLUENT < STATE, ACTION, SIT • Functions: • Predicate
SFC Domain Axiomatization • State Constraints • Unique simple Action Precondition Axiom for each function symbol with range ACTION • A set of State Update Axioms • Foundational Axioms (Fstate) • Possibly further domain-specific axioms
Pure State Formula • It may contain then: • Hold(f,z), where f is a fluent and z is a state • Any domain predicates referencing only the domain sorts
State Constraints • Ex:
State Update Axiom • Ex: Question: Is it possible to change a previously “unknown” number of fluents at once? “Delta” is a pure state formula, so it can’t be used to generate the needed fluents. V+ and V- are just “fluent sets”... Can I use a function to generate these fluent sets?
Domain Sorts (1/2) • RULE • Ex: gcd(0) <=> true | true. • RULE_ID • ATOM < CONSTRAINT • p(1,2,7) • UDC < ATOM • BIC < ATOM • EQUATION < BIC
Domain Sorts (2/2) • FORMULA < CONSTRAINT • CONJUNCTION < FORMULA • EQ_CONJ < CONJUNCTION • BIC_CONJ < CONJUNCTION • UDC_CONJ < CONJUNCTION
“Domain” Sorts • BICS_STATE < STATE • UDCS_STATE < STATE • GOAL_STATE < STATE Question: Can I specialize the reserved sorts? Are the specialized ones considered “Domain” sorts?
Domain Functions (1/5) G – Goal U – User Defined Constraints Store B – Built-in Constraint Store H – Propagation History0 • S0 : SIT • The initial situation • InGoal : CONSTRAINT FLUENT • The constraint x is in G • InUdc : UDC FLUENT • The user defined constraint x is in U • InBic : BIC FLUENT • The built-in constraint x is in B
Domain Functions (2/5) • RuleId : RULE RULE_ID • Returns an unique identifier for the passed rule • InPropHistory : RULE_ID x UDC_CONJ x EQ_CONJ FLUENT • f = InPropHistory(rule, constraints, equations) • The ‘rule’ was executed with the conjunction of matching ‘constraints’ generating the conjunction of ‘equations’
Domain Functions (3/5) • MakeGoal : CONJUNCTION GOAL_STATE • Makes an state containing an InGoal(c) fluent for each constraint c in the conjunction • MakeBICS : BIC_CONJ BICS_STATE • Makes an state containing an InBic(c) fluent for each constraint c in the conjunction • MakeUDCS : UDC_CONJ UDCS_STATE • Makes an state containing an InUdc(c) fluent for each constraint c in the conjunction
Domain Functions (4/5) • “,” : CONSTRAINT x CONSTRAINT CONJUNCTION • : CONSTRAINT x CONJUNCTION • true : BIC • false : BIC
Domain Functions (5/5) • SimplifRule : UDC_CONJ x BIC_CONJ x CONJUNCTION RULE • PropagRule : UDC_CONJ x BIC_CONJ x CONJUNCTION RULE • SimpagRule : UDC_CONJ x UDC_CONJ x BIC_CONJ x CONJUNCTION RULE • These functions make up a rule from its parts
Domain Predicates (1/3) • InQuery : CONSTRAINT • The constraint is in the initial goal (query) • DisjointVariables : RULE x CONSTRAINT • DisjointVariables(rule, constraint) • No variable in ‘rule’ appears in ‘constraint’
Domain Predicates (2/3) • Matching : UDC_CONJ x UDC_CONJ x EQ_CONJ • Matching(head, matching, equations) • The conjunction of udc constraints ‘head’ matches the conj. of udc constraints ‘matching’ generating the conj. of matching equations ‘equations’ • Matching(“p(X) , q(Y)”,“p(A), p(2)”,“X=A, Y=2”) • Matching(“p(X) , q(Y)”,“p(A), p(2)”, “X=2, Y=A”)
Domain Predicates (3/3) • checkEntails : BIC_CONJ x EQ_CONJ x BIC_CONJ • checkEntails(bics, head, guard) • CT |= bics x (head ^ guard)
Domain Actions • Solve: BIC ACTION • Introduce: UDC ACTION • Simplify: RULE x UDC_CONJ x EQ_CONJ ACTION • Propagate: RULE x UDC_CONJ x EQ_CONJ ACTION • Simpagate: RULE x UDC_CONJ x UDC_CONJ x EQ_CONJ ACTION
Abbreviations (1/2) These expressions cannot be defined as domain predicates, since a pure state formula forces all predicates to refer just to domain sorts.
Introduce g – goal being introduced (UDC) z – state (STATE) s – situation (SIT)
Solve g – goal being solved (BIC) z – state (STATE) s – situation (SIT)
Simplify hR – Rule Head (UDC_CONJ) g – Rule guard (BIC_CONJ) b – Rule body (UDC_CONJ) z – state (STATE) m – matching constraints (UDC_CONJ) e – matching equations (EQ_CONJ) bics – the BIC store as a conjunction of BICS (BIC_CONJ)
Simplify hR – Rule Head (UDC_CONJ) g – Rule guard (BIC_CONJ) b – Rule body (UDC_CONJ) s – situation (SIT) m – matching constraints (UDC_CONJ) e – matching equations (EQ_CONJ)
Propagate hk – Rule Head (UDC_CONJ) g – Rule guard (BIC_CONJ) b – Rule body (UDC_CONJ) z – state (STATE) m – matching constraints (UDC_CONJ) e – matching equations (EQ_CONJ)
Propagate hk – Rule Head (UDC_CONJ) g – Rule guard (BIC_CONJ) b – Rule body (UDC_CONJ) s – situation (SIT) m – matching constraints (UDC_CONJ) e – matching equations (EQ_CONJ)
Simpagate hk – Rule Head Keep (UDC_CONJ) hR – Rule Head Remove (UDC_CONJ) g – Rule guard (BIC_CONJ) b – Rule body (UDC_CONJ) z – state (STATE) mk – matching head keep constraints (UDC_CONJ) mR – matching head remove constraints (UDC_CONJ) e – matching equations (EQ_CONJ)
Simpagate hk – Rule Head Keep (UDC_CONJ) hR – Rule Head Remove (UDC_CONJ) g – Rule guard (BIC_CONJ) b – Rule body (UDC_CONJ) s – situation (SIT) mk – matching head keep constraints (UDC_CONJ) mR – matching head remove constraints (UDC_CONJ) e – matching equations (EQ_CONJ)
Nondeterminism in Fluent Calculus • Simple disjunctive state update axiom • θn is a first-order formula without terms of any reserved sort
Domain Sorts • DISJUNCTION < FORMULA • CHOICE < DISJUNCTION • ((a11, ... , a1n) ; ... ; (am1,... ,amn)), where all aij are ATOM’s
Domain Functions • “;” : CONSTRAINT x CONSTRAINT DISJUNCTION • : CONSTRAINT x FORMULA
Domain Actions • Split : CHOICE ACTION
Split c – choice being splitted (CHOICE) bi – a component of the choice (CONJUNCTION) z – state (STATE) s – situation (SIT)
Domain Sorts • JUSTIFICATION < CONJUNCTION • “a1, ... , an”, where all ai are atoms
Domain Functions (1/3) J - Justifications • Just : CONSTRAINT x JUSTIFICATION FLUENT • Just(c,j) • The constraint c is justified by j • MakeJust : CONJUNCTION x JUSTIFICATION STATE • Makes an state containing an Just(c,j) fluent for each constraint c in the conjunction
Domain Functions (2/3) • SelectJust : JUSTIFICATION x STATE STATE • SelectJust(j,z) • Selects the fluents of the form “Just(c,jc)” in z such that JustifiedBy(c, j, z) • SelectConstraint : JUSTIFICATION x STATE STATE • SelectConstraint(j,z) • Selects the fluents of the form “InUdc(c)”, “InBic(c)” or “InGoal(c)” in z such that JustifiedBy(c, j, z)
Domain Functions (3/3) • SelectPropHistory : JUSTIFICATION x STATE STATE • SelectPropHistory(j,z) • Selects the fluents of the form “PropHistory(rule,matched,equations)” in z such that for some constraint c in ‘matched’, JustifiedBy(c, j, z)
Domain Actions • AddConstraint : CONSTRAINT x JUSTIFICATION ACTION • RemoveConstraint : JUSTIFICATION ACTION