diff --git a/src/Events.cpp b/src/Events.cpp new file mode 100644 index 0000000..94ddbda --- /dev/null +++ b/src/Events.cpp @@ -0,0 +1,2023 @@ +/************************************************************************ + * Copyright 2008, Strathclyde Planning Group, + * Department of Computer and Information Sciences, + * University of Strathclyde, Glasgow, UK + * http://planning.cis.strath.ac.uk/ + * + * Maria Fox, Richard Howey and Derek Long - VAL + * Stephen Cresswell - PDDL Parser + * + * This file is part of VAL, the PDDL validator. + * + * VAL is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * VAL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with VAL. If not, see . + * + ************************************************************************/ + +/*----------------------------------------------------------------------------- + VAL - The Automatic Plan Validator for PDDL+ + + $Date: 2009-02-05 10:50:12 $ + $Revision: 1.2 $ + + Maria Fox, Richard Howey and Derek Long - PDDL+ and VAL + Stephen Cresswell - PDDL Parser + + maria.fox@cis.strath.ac.uk + derek.long@cis.strath.ac.uk + stephen.cresswell@cis.strath.ac.uk + richard.howey@cis.strath.ac.uk + + By releasing this code we imply no warranty as to its reliability + and its use is entirely at your own risk. + + Strathclyde Planning Group + http://planning.cis.strath.ac.uk + ----------------------------------------------------------------------------*/ + + #include "Events.h" + #include "Plan.h" + #include "Validator.h" + #include "Action.h" + #include "RobustAnalyse.h" + +namespace VAL { + +Events::Events(const operator_list * ops) : ungroundEvents(), ungroundProcesses(), + triggeredEvents(), triggeredProcesses(), untriggeredProcesses(), activeProcesses(), eventsForMutexCheck(), oldTriggeredEvents(), lastHappeningTime(0), ctsEventTriggered(false) //, noevents(0) +{ + + for(operator_list::const_iterator i = ops->begin();i != ops->end();++i) + { + if(event * e = dynamic_cast(*i)) + { + ungroundEvents.push_back(e); + } + else if(process * p = dynamic_cast(*i)) + { + ungroundProcesses.push_back(p); + }; + }; + + + }; + +Events::~Events() +{ + ungroundEvents.clear(); + triggeredEvents.clear(); + ungroundProcesses.clear(); + triggeredProcesses.clear(); + for(vector::iterator i = oldTriggeredEvents.begin(); i != oldTriggeredEvents.end(); ++i) + delete *i; + + for(map >::iterator j = activeProcesses.begin(); j != activeProcesses.end(); ++j) + {j->second.first->destroy(); delete j->second.second;}; + + activeProcesses.clear(); +}; + +string Events::getName(operator_ * op,const_symbol_list * csl) const +{ + string eventName = "("+op->name->getName(); + for(const_symbol_list::iterator cs = csl->begin(); cs != csl->end(); ++cs) + { + eventName += " "+(*cs)->getName(); + }; + + return eventName +")"; + +}; + +bool Events::isTriggered(event * eve,const_symbol_list * csl) const +{ + string eventName = eve->name->getName(); + for(const_symbol_list::iterator cs = csl->begin(); cs != csl->end(); ++cs) + { + eventName += (*cs)->getName(); + }; + + set::const_iterator i = triggeredEvents.find(eventName); + + if(i != triggeredEvents.end()) + { + eventName = "(" + eve->name->getName(); + for(const_symbol_list::iterator cs = csl->begin(); cs != csl->end(); ++cs) + { + eventName += " "+(*cs)->getName(); + }; + eventName += ")"; + + if(LaTeX) + { + *report << "\\errorr{Attempt to trigger event \\exprn{"<getName0(); + + set::const_iterator i = triggeredEvents.find(eventName); + + if(i != triggeredEvents.end()) + { + if(LaTeX) + { + *report << "\\errorr{Attempt to trigger event \\exprn{"<<*act<<"} twice}\\\\\n"; + } + else if(Verbose) *report << "Attempt to trigger event "<<*act<<" twice\n"; + + return true; + }; + + return false; +}; + +bool Events::isProcessTriggered(const StartAction * sa) const +{ + set::iterator i = triggeredProcesses.find(sa); + + return (i != triggeredProcesses.end()); +}; + +bool Events::isProcessActive(process * pro,const_symbol_list * csl) const +{ + string processName = pro->name->getName(); + for(const_symbol_list::iterator cs = csl->begin(); cs != csl->end(); ++cs) + { + processName += (*cs)->getName(); + }; + + for(map >::const_iterator i = activeProcesses.begin(); i != activeProcesses.end(); ++i) + { + if(processName == i->first->getName0()) + { + return true; + }; + + }; + + return false; + +}; + +bool Events::isProcessUntriggered(process * pro,const_symbol_list * csl) const +{ + string processName = pro->name->getName(); + for(const_symbol_list::iterator cs = csl->begin(); cs != csl->end(); ++cs) + { + processName += (*cs)->getName(); + }; + + set::iterator i = untriggeredProcesses.find(processName); + + return (i != untriggeredProcesses.end()); +}; + +void deleteParameters(vector & vcsl) +{ + for(vector::iterator p = vcsl.begin(); p != vcsl.end(); ++p) + delete *p; +}; + +const vector removeRepeatedParameters(const vector & vcsl) +{ + vector listOfParameters; + + set parameterLists; + for(vector::const_iterator i = vcsl.begin(); i != vcsl.end(); ++i) + { + string eventName; + for(const_symbol_list::iterator cs = (*i)->begin(); cs != (*i)->end(); ++cs) + { + eventName += (*cs)->getName(); + }; + + set::const_iterator pl = parameterLists.find(eventName); + if(pl == parameterLists.end()) + { + listOfParameters.push_back(*i); + parameterLists.insert(eventName); + } + else + delete *i; + }; + + return listOfParameters; +}; + +const_symbol_list * newBlankConstSymbolList(var_symbol_list * parameters,Validator * v) +{ + //create blank list of parameters, ie every parameter is undefined + const_symbol_list * blankcsl = new const_symbol_list(); + for(var_symbol_list::const_iterator i = parameters->begin(); i != parameters->end(); ++i) + { + const_symbol * cs = 0; //v->getAnalysis()->const_tab.symbol_get(""); + blankcsl->push_back(cs); + }; + + return blankcsl; +}; + +const EndAction * addEndProcess(vector & processes,const StartAction * sa,const_symbol_list * csl,Validator * v) +{ + //create end action to end the process + const operator_ * pro = sa->getAction(); + action * dae = new safeaction(pro->name,pro->parameters,new conj_goal(new goal_list()),new effect_lists(),pro->symtab); + const EndAction * endAct = new EndAction(v,dae,csl,sa,0,new goal_list()); + processes.push_back(endAct); + return endAct; +}; + +void Events::updateHappeningTime(double t) +{ + if(lastHappeningTime != t) + { + triggeredEvents.clear(); //to check for events being triggered twice at the same time point + triggeredProcesses.clear(); //to ensure a process is not triggered and untriggered at same time point due to rounding errors + untriggeredProcesses.clear(); //to ensure a processes is not untriggered and then retriggered at the same time point due to rounding when triggering processes by discrete change! + }; + lastHappeningTime = t; + +}; + +void Events::updateEventsForMutexCheck(Validator * v) +{ + eventsForMutexCheck.clear(); + vector listOfParameters0; + vector listOfParameters00; + set svs; + vector listOfParameters; + + for(vector::iterator e = ungroundEvents.begin(); e != ungroundEvents.end(); ++e) + { + listOfParameters0 = getParametersCts((*e)->precondition,*e,v,false,true); + listOfParameters00 = removeRepeatedParameters(listOfParameters0); + svs = getVariables(*e); + listOfParameters = defineUndefinedParameters(listOfParameters00,*e,v,svs); + + //add events to a event happening + for(vector::iterator p = listOfParameters.begin(); p != listOfParameters.end(); ++p) + { + const Action * anAction = new Action(v,*e,*p); + eventsForMutexCheck.push_back(anAction); + oldTriggeredEvents.push_back(anAction); + }; //end of looping thro' parameters + + deleteParameters(listOfParameters); + + }; +}; + +//trigger processes and events before the first happening in the plan +bool Events::triggerInitialEvents(Validator * v,double firstHappeningTime) +{ + if(!hasEvents()) return true; + + bool isOK = true; + ActiveCtsEffects * ace = v->getActiveCtsEffects(); + ace->clearCtsEffects(); //clear cts effect given by the first happening + + //check for events and processes in the intitial state + isOK = triggerDiscreteEvents(v,true); + + //update values before the first happening of the plan! + if(ace->hasCtsEffects() && (isOK || ContinueAnyway)) //if processes have been activated in the intitial state then there may be events to trigger and we need to update values before the first happening + { + ace->setTime(firstHappeningTime); + ace->setLocalUpdateTime(firstHappeningTime); + isOK = triggerEventsOnInterval(v,true) && isOK; + + if(isOK || ContinueAnyway) + { + //execute cts update happening + if(firstHappeningTime != 0) + { + if(Verbose) *report << "\n"; + ace->setLocalUpdateTime(firstHappeningTime - v->getState().getTime()); + const Happening * updateHap = ace->getCtsEffectUpdate(); + updateHap->adjustActiveCtsEffects(*ace); + isOK = v->executeHappening(updateHap) && isOK; + ace->ctsEffectsProcessed = false; ace->addActiveFEs();//update cts effects + }; + }; + + }; + + v->adjustActiveCtsEffects(ace); + return isOK; +}; + +bool Events::triggerEventsOnInterval(Validator * v,bool init) +{ + bool isOK = true; + + + do + { + isOK = triggerDiscreteEvents(v,init) && isOK; if(!isOK && !ContinueAnyway) return false; + + isOK = triggerContinuousEvents(v,init) && isOK; if(!isOK && !ContinueAnyway) return false; + + }while(ctsEventTriggered); + + return isOK; +}; + +bool checkPreconditionsAreNotSatisfied(const State * s,const vector & events) +{ + for(vector::const_iterator i = events.begin(); i != events.end(); ++i) + { +// cout << "Checking a precondition for "<< *i << "\n"; + if((*i)->getPrecondition()->evaluate(s)) + { + if(LaTeX) *report << "\\> Event "<<*i<<" does not falsify its precondition!\\\\\n"; + else if(Verbose) cout << "Event "<<*i<<" does not falsify its precondition!\n"; + + return false; + }; + + + }; + + return true; +}; + +//trigger events given by discrete change +bool Events::triggerDiscreteEvents(Validator * v,bool init) +{ + if(EventPNEJuddering) JudderPNEs = true; + double theCurrentTime = v->getState().getTime(); + updateHappeningTime(theCurrentTime); + bool isOK = true; + + vector listOfParameters; + int numberofEvents = 0; + //trigger events: build up list of events to be triggered then add to a happening and execute the happening + //then test for more events + bool eventTriggered; + do{ + eventTriggered = false; + vector acts; + + for(vector::iterator e = ungroundEvents.begin(); e != ungroundEvents.end(); ++e) + { + + if(!init || (theCurrentTime != 0)) + { + listOfParameters = getParametersDiscreteFinal((*e)->precondition,*e,v->getState()); + } + else + { + listOfParameters = getParametersDiscreteInitialFinal((*e)->precondition,*e,v); + + if(!listOfParameters.empty()) + { + *report << "Event preconditions are not permitted to be satisfied in the initial state!\n"; + if(!ContinueAnyway) return false; + isOK = false; + }; + }; + + //add events to a event happening and remove repetitions + for(vector::iterator p = listOfParameters.begin(); p != listOfParameters.end(); ++p) + { + if(isTriggered(*e,*p)) isOK = false; + else + { + const Action * anAction = new Action(v,*e,*p); //include precondition to check for mutex events? yes + acts.push_back(anAction); + triggeredEvents.insert(anAction->getName0()); + oldTriggeredEvents.push_back(anAction); + }; + + }; //end of looping thro' parameters + + deleteParameters(listOfParameters); + + }; //end of looping thro' events + + //apply events as a happening to the state + if(acts.size() != 0 && (isOK || ContinueAnyway)) + { + if(numberofEvents > 1) + { + *report << "Event cascades of this nature are not yet handled robustly!\n"; + if(!ContinueAnyway) return false; + isOK = false; + }; + + if(Verbose) cout << "\n"; + Happening * eventHappening = new Happening(v,acts,true); + isOK = v->executeHappening(eventHappening) && isOK; + isOK = checkPreconditionsAreNotSatisfied(&(v->getState()),acts) && isOK; + eventHappening->clearActions(); delete eventHappening; + if(!isOK && !ContinueAnyway) return false; + eventTriggered = true; + numberofEvents = acts.size(); + + }; + + isOK = triggerDiscreteProcesses(v) && isOK; + + }while(eventTriggered); //if events were triggered this may result in more events triggering + + eventsForMutexCheck.clear(); + + + if(EventPNEJuddering) JudderPNEs = false; + return isOK; +}; + +const StartAction * newStartProcessAction(process* pro, const_symbol_list* csl,Validator * v) +{ + effect_lists * elc = new effect_lists(); + + for(pc_list::const_iterator i = pro->effects->timed_effects.begin(); + i != pro->effects->timed_effects.end();++i) + { + if((*i)->ts == E_CONTINUOUS) + { + insert_effects(elc,(*i)->effs); + }; + }; + + //create a StartAction here + action * das = new safeaction(pro->name,pro->parameters,new conj_goal(new goal_list()),new effect_lists(),pro->symtab); + return new StartAction(v,das,csl,new conj_goal(new goal_list()),elc,0.0,new goal_list(),vector(),vector()); + +}; + +const EndAction * newEndProcess(const StartAction * sa,const_symbol_list * csl,Validator * v) +{ + //create end action to end the process + const operator_ * pro = sa->getAction(); + action * dae = new safeaction(pro->name,pro->parameters,new conj_goal(new goal_list()),new effect_lists(),pro->symtab); + const EndAction * endAct = new EndAction(v,dae,csl,sa,0,new goal_list()); + return endAct; +}; + +//trigger processes given by discrete change +bool Events::triggerDiscreteProcesses(Validator * v) +{ + if(EventPNEJuddering) JudderPNEs = true; + bool isOK = true; + vector processes; + double time = v->getState().getTime(); + + //find processes that are ended + if(time > 0) + { + vector eraseElements; + for(map >::iterator ap = activeProcesses.begin(); + ap != activeProcesses.end() ; ++ap) + { + const_cast(ap->second.first)->resetCtsFunctions(); //ensure we are checking the precondition at a point not on an interval + + if(!(ap->second.first->evaluate(&v->getState())) && !(isProcessTriggered(ap->first))) + { + const EndAction * endAct = addEndProcess(processes,ap->first,ap->second.second,v); + oldTriggeredEvents.push_back(endAct); + ap->second.first->destroy(); delete ap->second.second; eraseElements.push_back(ap->first); + untriggeredProcesses.insert(ap->first->getName0()); + }; + }; + + for(vector::iterator ee = eraseElements.begin(); ee != eraseElements.end(); ++ee) + activeProcesses.erase(*ee); + }; + + for(vector::const_iterator p = ungroundProcesses.begin(); p != ungroundProcesses.end(); ++p) + { + //for every process check if it could be triggered in the initial state or later on + //get list of parameters (may be empty) + vector listOfParameters; + if(time == 0.0) + { + listOfParameters = getParametersDiscreteInitialFinal((*p)->precondition,*p,v); + } + else + { + listOfParameters = getParametersDiscreteFinal((*p)->precondition,*p,v->getState()); //need to check for all changes after the event cascade, this is the best way, only consider the process if something has changed + }; + //cout << "Process " << (*p)->name->getName() << " with " << listOfParameters.size() << "\n"; + + //add processes to an event happening and remove repetitions + for(vector::iterator pa = listOfParameters.begin(); pa != listOfParameters.end(); ++pa) + { + if(!isProcessActive(*p,*pa) /*&& !isProcessUntriggered(*p,*pa)*/) //no need to check if it has not been untriggered, because above we now check that the process is triggered by something that has changed + { + const StartAction * sa = newStartProcessAction(*p,*pa,v); + processes.push_back(sa); + //only add the precondition to the list of triggered processes, as we already know it to be satisfied when applied + const Proposition * prop = v->pf.buildProposition((*p)->precondition,*(buildBindings(*p,**pa).copy(v))); + activeProcesses[sa] = make_pair(prop,*pa); + oldTriggeredEvents.push_back(sa); + triggeredProcesses.insert(sa); + //cout << "Triggered " << *sa << "\n"; + } + else + delete *pa; + + }; //end of looping thro' parameters + + + }; //end of looping thro' processes + + //apply processes as a happening to the state + if(processes.size() != 0) + { + if(Verbose) cout << "\n"; + ActiveCtsEffects * ace = v->getActiveCtsEffects(); + Happening * eventHappening = new Happening(v,processes,true); + eventHappening->adjustActiveCtsEffects(*ace); + isOK = v->executeHappening(eventHappening); + eventHappening->clearActions(); delete eventHappening; + if(!isOK && !ContinueAnyway) return false; + + }; + + if(EventPNEJuddering) JudderPNEs = false; + return isOK; +}; + +const vector getParametersDiscreteInitialFinal(goal * g,operator_ * op,Validator * v) +{ + vector aParameterList; + const_symbol_list * blankcsl = newBlankConstSymbolList(op->parameters,v); + aParameterList.push_back(blankcsl); + const vector listOfParameters0 = getParametersList(g,op,v,aParameterList,false,true); + delete blankcsl; + const vector listOfParameters00 = removeRepeatedParameters(listOfParameters0); + const set svs = getVariables(op); + return defineUndefinedParameters(listOfParameters00,op,v,svs); +}; + +const vector getParametersDiscreteFinal(goal * g,operator_ * op, const State & s) +{ + //get list of parameters (may be empty) + const vector listOfParameters0 = getParametersDiscrete(g,op,s); + const vector listOfParameters00 = removeRepeatedParameters(listOfParameters0); + const set svs = getVariables(op); + return defineUndefinedParameters(listOfParameters00,op,s.getValidator(),svs); +}; + +const vector getParametersCtsFinal(goal * g,operator_ * op,Validator * v) +{ + const vector listOfParameters0 = getParametersCts(g,op,v,false,false); + const vector listOfParameters00 = removeRepeatedParameters(listOfParameters0); + const set svs = getVariables(op); + return defineUndefinedParameters(listOfParameters00,op,v,svs); +}; + +//trigger events given by ctsly changing PNEs +bool Events::triggerContinuousEvents(Validator * v,bool init) +{ + if(!init && v->isLastHappening()) return true; + if(EventPNEJuddering) JudderPNEs = true; + ctsEventTriggered = false; + ActiveCtsEffects * ace = v->getActiveCtsEffects(); + ExecutionContext * ec = v->getExecutionContext(); + vector listOfParameters; + + double currentTime = v->getState().getTime(); + double nextTime; + if(!init) nextTime = v->getNextHappeningTime(); else nextTime = v->getCurrentHappeningTime(); + double localTime = nextTime - currentTime; + if(localTime == 0) return true; + + bool isOK = true; + vector acts; + vector processes; + + ace->setLocalUpdateTime(localTime); //set value of LocalUpdateTime - time since last regular happening + + //process cts effects, build polys etc, conditional cts effects handled here also + + if(TestingPNERobustness) ace->addActiveFEs(true); + else ace->addActiveFEs(); + + + if(!ace->hasCtsEffects()) return true; + + //get parameters for all events that may be triggered due to cts effects + for(vector::iterator e = ungroundEvents.begin(); e != ungroundEvents.end(); ++e) + { + listOfParameters = getParametersCtsFinal((*e)->precondition,*e,v); + + for(vector::iterator p = listOfParameters.begin(); p != listOfParameters.end(); ++p) + { + const Action * anAction = new Action(v,*e,*p); + const_cast(anAction->getPrecondition())->setUpComparisons(ace); + acts.push_back(anAction); + };//end of loop thro' parameters + + deleteParameters(listOfParameters); + }; + + //find out when events are first triggered, if at all + vector > ctsTriggeredEvents; + Intervals eventIntervals; + for(vector::iterator e = acts.begin(); e != acts.end(); ++e) + { + try + { + eventIntervals = (*e)->getPrecondition()->getIntervals(&(v->getState())); + } + catch(BadAccessError & e) + { + //if a PNE is not defined, then no problem, the event is simply not triggered + }; + + if(!eventIntervals.intervals.empty()) + { + ctsTriggeredEvents.push_back(make_pair(*e, eventIntervals.intervals.begin()->first));//intervals are constructed left to right so this is the minimum point + } + else + delete *e; + + }; + + //get start time for processes to trigger - add to list of actions + map > startProcesses; + for(vector::iterator pro = ungroundProcesses.begin(); pro != ungroundProcesses.end(); ++pro) + { + listOfParameters = getParametersCtsFinal((*pro)->precondition,*pro,v); + + for(vector::iterator p = listOfParameters.begin(); p != listOfParameters.end(); ++p) + { + if(!isProcessActive(*pro,*p) /*&& !isProcessUntriggered(*pro,*p)*/) + { + //create a StartAction here + const StartAction * sa = newStartProcessAction(*pro,*p,v); + const Proposition * prop = v->pf.buildProposition((*pro)->precondition,*(buildBindings(*pro,**p).copy(v))); + const_cast(prop)->setUpComparisons(ace); + eventIntervals = prop->getIntervals(&(v->getState())); + + if(!eventIntervals.intervals.empty()) + { + intervalEnd startTime = make_pair(-1,true); + + //do not trigger a process on an isolated point + for(vector< pair >::const_iterator ei = eventIntervals.intervals.begin(); ei != eventIntervals.intervals.end();++ei) + { + if(ei->first.first != ei->second.first) + { + startTime = ei->first; break; + }; + }; + + if(startTime.first != -1) + { + ctsTriggeredEvents.push_back(make_pair(sa, startTime));//intervals are constructed left to right so this is the minimum point + startProcesses[sa] = make_pair(prop,new const_symbol_list(**p)); + }; + } + else + { + delete sa; + prop->destroy(); + }; + }; + }; + + deleteParameters(listOfParameters); + }; + + map endStartMap; + //find processes that could be ended + for(map >::iterator ap = activeProcesses.begin(); ap != activeProcesses.end() ; ++ap) + { + const_cast(ap->second.first)->setUpComparisons(ace); + Intervals eventIntervals0 = ap->second.first->getIntervals(&(v->getState())); + eventIntervals = setComplement(eventIntervals0,localTime); + if(!(eventIntervals.intervals.empty())) + { + const EndAction * endAct = newEndProcess(ap->first,ap->second.second,v); + endStartMap[endAct] = ap->first; + + intervalEnd startTime = make_pair(-1,true); + + //do not untrigger a process on an isolated point + for(vector< pair >::const_iterator ei = eventIntervals.intervals.begin(); ei != eventIntervals.intervals.end();++ei) + { + if(ei->first.first != ei->second.first) + { + startTime = ei->first; break; + }; + }; + + if((startTime.first != -1) && isProcessTriggered(ap->first)) + { + ctsTriggeredEvents.push_back(make_pair(endAct, startTime)); + }; + }; + }; + + vector eventsToTrigger; + CoScalar eventTriggerTime = 0; + //extract the first group of events to be triggered (including processes) + for(vector >::iterator i = ctsTriggeredEvents.begin(); i != ctsTriggeredEvents.end(); ++i) + { + if(eventsToTrigger.empty()) + { + eventTriggerTime = i->second.first; + eventsToTrigger.push_back(i->first); + } + else if(i->second.first == eventTriggerTime) + { + eventsToTrigger.push_back(i->first); + } + else if(i->second.first < eventTriggerTime) + { + eventTriggerTime = i->second.first; + for(vector::iterator k = eventsToTrigger.begin(); k != eventsToTrigger.end(); ++k) delete *k; + eventsToTrigger.clear(); + eventsToTrigger.push_back(i->first); + } + else + delete i->first; + + }; + + //trigger events + Happening * eventHappening; + updateHappeningTime(eventTriggerTime + currentTime); + bool triggerEventsExist = !eventsToTrigger.empty(); + + //remember the no loops rule, i.e. an event cannot be triggered more than once at a given time point, only the same time point as last trigger + //loop thro' events check if they have already been triggered (unless a process) + if(triggerEventsExist) + { + for(vector::const_iterator j = eventsToTrigger.begin(); j != eventsToTrigger.end(); ++j) + if(isTriggered(*j)) + { + if(!ContinueAnyway) return false; + isOK = false; + }; + }; + + if(triggerEventsExist && isOK) + { + ctsEventTriggered = true; + + ace->setTime(eventTriggerTime + currentTime); //same time as event trigger time + ace->setLocalUpdateTime(eventTriggerTime); + + if(eventTriggerTime != 0) + { + //execute invariant happening + ec->setActiveCtsEffects(ace); + ec->setTime(eventTriggerTime + currentTime); //same time as event trigger time + if(ec->hasInvariants()) {if(Verbose) cout << "\n"; isOK = v->executeHappening(ec->getInvariants()) && isOK;}; + ec->setTime(nextTime); //same time as event trigger time + + //execute cts update happening + if(Verbose) cout << "\n"; + isOK = v->executeHappening(ace->getCtsEffectUpdate()) && isOK; + }; + + //execute event happening + if(Verbose) cout << "\n"; + eventHappening = new Happening(v,eventsToTrigger,eventTriggerTime + currentTime,true); + eventHappening->adjustContext(*ec); + eventHappening->adjustActiveCtsEffects(*ace); //update cts effects for interval after event happening + isOK = v->executeHappeningCtsEvent(eventHappening) && isOK; + + lastHappeningTime = eventTriggerTime + currentTime; + vector triggeredStartProcesses; + vector triggeredEndProcesses; + vector events; + + //add to list of triggered events + for(vector::const_iterator j = eventsToTrigger.begin(); j != eventsToTrigger.end(); ++j) + { + (*j)->addTriggeredEvents(events,oldTriggeredEvents,triggeredStartProcesses,triggeredEndProcesses); + }; + + //check triggered events have falsified their preconditions and add to list of triggered events + isOK = checkPreconditionsAreNotSatisfied(&(v->getState()),events) && isOK; + for(vector::const_iterator te = events.begin(); te != events.end(); ++te) triggeredEvents.insert((*te)->getName0()); + + //add triggered processes to list of triggered processes + for(vector::const_iterator trs = triggeredStartProcesses.begin(); trs != triggeredStartProcesses.end(); ++trs) + { + pair propcsl = startProcesses[*trs]; + activeProcesses[*trs] = make_pair(propcsl.first,propcsl.second); + triggeredProcesses.insert(*trs); + startProcesses.erase(*trs); + }; + + //delete unused startProcesses' props and csls + for(map >::iterator sp = startProcesses.begin(); sp != startProcesses.end(); ++sp) + { + sp->second.first->destroy(); //delete sp->second.first; + }; + + //remove untriggered processes from list of triggered processes + for(vector::const_iterator trs = triggeredEndProcesses.begin(); trs != triggeredEndProcesses.end(); ++trs) + { + const StartAction * stAction = endStartMap[*trs]; + map >::iterator ap = activeProcesses.find(stAction); + if(ap != activeProcesses.end()) + { + ap->second.first->destroy(); delete ap->second.second; + activeProcesses.erase(ap); + untriggeredProcesses.insert(stAction->getName0()); + }; + + }; + + eventHappening->clearActions(); delete eventHappening; + + //ready for triggering discrete events + ace->setTime(nextTime); + ace->setEventTime(eventTriggerTime + currentTime); + } + else + for(vector::iterator k = eventsToTrigger.begin(); k != eventsToTrigger.end(); ++k) delete *k; + + + + if(EventPNEJuddering) JudderPNEs = false; + return isOK; +}; + +//for discretly triggered events +const vector getParametersDiscrete(goal * g,operator_ * op, const State & s,bool neg) +{ + vector listOfparameters; + + ///Comparison + if(const comparison * comp = dynamic_cast(g)) + { + //get list of PNEs, then make list of parameter lists from them + set pnes; + getPNEs(comp->getLHS(),pnes); + getPNEs(comp->getRHS(),pnes); + + set changedPNEs = s.getChangedPNEs(); + + for(set::iterator pne = pnes.begin(); pne != pnes.end(); ++pne) + { + //has pne changed since last happening + for(set::const_iterator fe = changedPNEs.begin(); fe != changedPNEs.end(); ++fe) + { + if(((*fe)->getName() == (*pne)->getFunction()->getName()) + && (*fe)->checkConstantsMatch((*pne)->getArgs())) //+check consts match! + { + const_symbol_list* parametersForEvent = new const_symbol_list(); + + for(var_symbol_list::iterator j = op->parameters->begin(); j != op->parameters->end(); ++j) + { + string para = getParameter(*fe,*j,*pne); + + const_symbol * cs = para==""?0:s.getValidator()->getAnalysis()->const_tab.symbol_get(para); + + parametersForEvent->push_back(cs); + + }; //end of filling in parameters + + //ground out undefineds here to produce list of parameter lists + //check the comp holds for each parameter list! use only parameters used in comp + set svs = getVariables(comp); + listOfparameters = defineUndefinedParametersPropVar(parametersForEvent,op,s.getValidator(),g,false,neg,svs); + + }; + + };//end of loop for checking if pne could be a changed fe + + }; //end of looping thro' pnes in expression + + return listOfparameters; + }; + + //Literal + if(const simple_goal * sg = dynamic_cast(g)) + { + //handle derived predicates first! + string literalName = sg->getProp()->head->getName(); + vector aParameterList; + if(s.getValidator()->getDerivRules()->isDerivedPred(literalName)) + { + aParameterList.push_back(newBlankConstSymbolList(op->parameters,s.getValidator())); + return getParametersList(g,op,s.getValidator(),aParameterList,neg,true); + }; + + //check if literal is one that has changed since last happening + //if so fill in parameters with one from a simple prop + set changedLiterals = s.getChangedLiterals(); + for(set::const_iterator sp = changedLiterals.begin(); sp != changedLiterals.end(); ++sp) + { + if( ((*sp)->getPropName() == literalName) && ((!neg && s.evaluate(*sp)) || (neg && !s.evaluate(*sp))) + && (*sp)->checkConstantsMatch(sg->getProp()->args) ) + { + const_symbol_list* parametersForEvent = new const_symbol_list(); + + //fill in parameters for event + for(var_symbol_list::iterator j = op->parameters->begin(); j != op->parameters->end(); ++j) + { + string para = getParameter(*sp,*j,sg); + const_symbol * cs = para==""?0:s.getValidator()->getAnalysis()->const_tab.symbol_get(para); + + parametersForEvent->push_back(cs); + }; //end of filling in parameters + + listOfparameters.push_back(parametersForEvent); + }; + + }; + + return listOfparameters; + }; + + //Negation + if(dynamic_cast(g)) + { + return getParametersDiscrete(const_cast(dynamic_cast(g)->getGoal()),op,s,!neg); + }; + + //Other + listOfparameters = getParameters(g,op,s.getValidator(),true,neg); + + return listOfparameters; +}; + +goal * newQfiedGoal(const qfied_goal * qg,operator_ * op,Validator * v) +{ + //get list of instansigated parameters for the qfied prop, so for forall(?z ?y), we have a grounded list for every z? and ?y + set svs = getVariables(qg); + vector constantsList = defineUndefinedParameters(newBlankConstSymbolList(const_cast(qg->getVars()),v),const_cast(qg->getVars()),v,svs); + + //now create a conjunction or disjunction with the qfied variables substituted + map newvars; + goal_list* theGoals = new goal_list(); + + for(vector::iterator k = constantsList.begin(); k != constantsList.end(); ++k) + { + const goal * aGoal = copyGoal(qg->getGoal()); + + //define mapping of parameter symbol to constant + const_symbol_list::iterator consList = (*k)->begin(); + for(var_symbol_list::const_iterator i = qg->getVars()->begin(); i != qg->getVars()->end(); ++i) + { + newvars[const_cast(*i)] = *consList; + consList++; + }; + //add conjunct/disjunct with qfied variables substituted + changeVars(const_cast(aGoal),newvars); + theGoals->push_back(const_cast(aGoal)); + }; + + deleteParameters(constantsList); + + goal * goalToCheck; + if(qg->getQuantifier()==E_FORALL) + { + goalToCheck = new conj_goal(theGoals); + } + else + { + goalToCheck = new disj_goal(theGoals); + }; + + return goalToCheck; +}; + +//for ctsly triggered events +const vector getParametersCts(goal * g,operator_ * op,Validator * v,bool neg,bool atAPoint) +{ + vector listOfparameters; + vector alistOfparameters; + + ///Comparison + if(const comparison * comp = dynamic_cast(g)) + { + //get list of PNEs, then make list of parameter lists from them + set pnes; + getPNEs(comp->getLHS(),pnes); + getPNEs(comp->getRHS(),pnes); + + for(set::iterator pne = pnes.begin(); pne != pnes.end(); ++pne) + { + //loop thro' ctsly changing PNEs + for(map::const_iterator fe = v->getActiveCtsEffects()->activeFEs.begin(); fe != v->getActiveCtsEffects()->activeFEs.end(); ++fe) + { + if(fe->first->getName() == (*pne)->getFunction()->getName() + && fe->first->checkConstantsMatch((*pne)->getArgs())) + { + const_symbol_list* parametersForEvent = new const_symbol_list(); + + //fill in parameters for event + for(var_symbol_list::iterator j = op->parameters->begin(); j != op->parameters->end(); ++j) + { + string para = getParameter(fe->first,*j,*pne); + const_symbol * cs = para==""?0:v->getAnalysis()->const_tab.symbol_get(para); + + parametersForEvent->push_back(cs); + }; //end of filling in parameters + + //any undefined parameters will be ground out and checked later, unless we are checking at a point for mutex checks with actions at the same time. + if(!atAPoint) listOfparameters.push_back(parametersForEvent); + else + { + set svs = getVariables(comp); + alistOfparameters = defineUndefinedParametersPropVar(parametersForEvent,op,v,g,false,neg,svs,true); + + for(vector::const_iterator l = alistOfparameters.begin(); l != alistOfparameters.end(); ++l) + listOfparameters.push_back(*l); + }; + + }; + + };//end of loop for checking if pne could be a changed fe + + }; //end of looping thro' pnes in expression + + return listOfparameters; + }; + + + //Literal + if(dynamic_cast(g)) + { + //return an empty list, literals do not change ctsly, so cannot trigger a event by cts activity + return listOfparameters; + }; + + //Negation + if(dynamic_cast(g)) + { + return getParametersCts(const_cast(dynamic_cast(g)->getGoal()),op,v,!neg,atAPoint); + }; + + //Others + listOfparameters = getParameters(g,op,v,false,neg,atAPoint); + + return listOfparameters; +}; + +//for both discrete and cts +const vector getParameters(goal * g,operator_ * op,Validator * v,bool discrete,bool neg,bool atAPoint) +{ + vector listOfparameters; + + ///Conjunction + if((!neg && (dynamic_cast(g))) || (neg && (dynamic_cast(g)))) + { + const goal_list* goalList; + if(dynamic_cast(g)) + { + goalList = dynamic_cast(g)->getGoals(); + } + else + { + goalList = dynamic_cast(g)->getGoals(); + }; + + //loop thro' conjuncts + //get all parameters from each + for(pc_list::const_iterator i = goalList->begin(); i != goalList->end(); ++i) + { + + vector someParameters; + if(discrete) someParameters = getParametersDiscrete(*i,op,v->getState(),neg); + else someParameters = getParametersCts(*i,op,v,neg,atAPoint); + + + //whittle down the list of parameters depending if they satisfy the rest of the conjunction + vector alistOfparameters; + if(!someParameters.empty()) alistOfparameters = getParametersList(g,op,v,someParameters,neg,discrete,atAPoint); + deleteParameters(someParameters); + + for(vector::const_iterator l = alistOfparameters.begin(); l != alistOfparameters.end(); ++l) + listOfparameters.push_back(*l); + + + }; + + return listOfparameters; + }; + + ///Disjunction + if((!neg && (dynamic_cast(g))) || (neg && (dynamic_cast(g)))) + { + const goal_list* goalList; + if(dynamic_cast(g)) + { + goalList = dynamic_cast(g)->getGoals(); + } + else + { + goalList = dynamic_cast(g)->getGoals(); + }; + //loop thro' disjuncts + for(pc_list::const_iterator i = goalList->begin(); i != goalList->end(); ++i) + { + vector someParameters; + if(discrete) someParameters = getParametersDiscrete(*i,op,v->getState(),neg); + else someParameters = getParametersCts(*i,op,v,neg,atAPoint); + + for(vector::const_iterator l = someParameters.begin(); l != someParameters.end(); ++l) + listOfparameters.push_back(*l); + //All remaining undefineds are given by existing objects and could be anything since + //remaining disjuncts need not be satisfied - thus leave as undefined + }; + + return listOfparameters; + }; + + + if(const qfied_goal* qg = dynamic_cast(g)) + { + goal * goalToCheck = newQfiedGoal(qg,op,v); + + if(discrete) listOfparameters = getParametersDiscrete(goalToCheck,op,v->getState(),neg); + else listOfparameters = getParametersCts(goalToCheck,op,v,neg,atAPoint); + + delete goalToCheck; + + return listOfparameters; + }; + + if(const imply_goal * ig = dynamic_cast(g)) + { + neg_goal * ng = new neg_goal(const_cast(ig->getAntecedent())); + goal_list * gl = new goal_list();; + goal * agoal = new goal(*const_cast(ig->getConsequent())); + gl->push_back(ng); + gl->push_back(agoal); + disj_goal * goalToCheck = new disj_goal(gl); + + if(discrete) listOfparameters = getParametersDiscrete(goalToCheck,op,v->getState(),neg); + else listOfparameters = getParametersCts(goalToCheck,op,v,neg,atAPoint); + gl->clear(); + ng->destroy(); + delete agoal; + delete goalToCheck; + + + return listOfparameters; + }; + + return listOfparameters; +}; + +void unionVariables(set & svs1,set & svs2) +{ + + for(set::const_iterator i = svs2.begin(); i != svs2.end(); ++i) + { + svs1.insert(*i); + }; + +}; + +//does the goal contain a negation or a comparsion? +bool containsNegationComp(goal * g,bool neg) +{ + + if(dynamic_cast(g)) + { + return true; + }; + + if(const conj_goal * cg = dynamic_cast(g)) + { + for(pc_list::const_iterator i = cg->getGoals()->begin(); i != cg->getGoals()->end(); ++i) + { + if(containsNegationComp(*i,neg)) return true; + }; + return false; + }; + + + if(const disj_goal * dg = dynamic_cast(g)) + { + for(pc_list::const_iterator i = dg->getGoals()->begin(); i != dg->getGoals()->end(); ++i) + { + if(containsNegationComp(*i,neg)) return true; + }; + return false; + }; + + if(const neg_goal * ng = dynamic_cast(g)) + { + return containsNegationComp(const_cast(ng->getGoal()),!neg); + }; + + + if(const imply_goal * ig = dynamic_cast(g)) + { + + return containsNegationComp(const_cast(ig->getAntecedent()),neg) || + containsNegationComp(const_cast(ig->getConsequent()),neg); + }; + + if(dynamic_cast(g)) + { + return neg; + }; + + if(const qfied_goal * qg = dynamic_cast(g)) + { + return containsNegationComp(const_cast(qg->getGoal()),neg); + }; + + return false; +}; + +const vector getCopyCSL(const vector & lop) +{ + vector listOfparameters; + + for(vector::const_iterator p = lop.begin(); p != lop.end(); ++p) + { + listOfparameters.push_back(new const_symbol_list(**p)); + }; + + return listOfparameters; +}; + +//find the list of parameters lists that satisfy g from the given list of parameter lists lop (psi as in paper) +const vector getParametersList(goal * g,operator_ * op,Validator * v,const vector & lop,bool neg,bool discrete,bool atAPoint) +{ + vector listOfparameters; + + ///Comparison + if(const comparison * comp = dynamic_cast(g)) + { + //if checking for ctsly triggered events we need to assume any comps with ctsly changing pnes are true + //at this stage. The comps are checked later, so do not do any checking here, it is done later (which will also include any comps with no ctsly changing PNEs that may be given here) + if(!discrete && !atAPoint) + { + //get list of PNEs, then make list of parameter lists from them + set pnes; + getPNEs(comp->getLHS(),pnes); + getPNEs(comp->getRHS(),pnes); + bool hasCtsPNE = false; + + for(set::iterator pne = pnes.begin(); pne != pnes.end(); ++pne) + { + //loop thro' ctsly changing PNEs + for(map::const_iterator fe = v->getActiveCtsEffects()->activeFEs.begin(); fe != v->getActiveCtsEffects()->activeFEs.end(); ++fe) + { + if(fe->first->getName() == (*pne)->getFunction()->getName()) + { + hasCtsPNE = true; + }; + + };//end of loop for checking if pne could be a changed fe + + }; //end of looping thro' pnes in expression + + //return copy of lop + if(hasCtsPNE) + { + return getCopyCSL(lop); + }; + }; + + //get list of unique parameters from g + set svs = getVariables(comp->getLHS()); + set svs2 =getVariables(comp->getRHS()); + unionVariables(svs,svs2); + + //dont want to delete lop + vector someParameters; + for(vector::const_iterator p = lop.begin(); p != lop.end(); ++p) + { + someParameters.push_back(new const_symbol_list(**p)); + }; + vector listOfparameters = defineUndefinedParametersPropVar(someParameters,op,v,g,false,neg,svs,atAPoint); + + return listOfparameters; + }; + + //Literal + if(const simple_goal * sg = dynamic_cast(g)) + { + + //look in state, look up all simple props that are true with this name. Get a list of constant symbols + //corresponding to the true literals. Create a list of partially ground parameters from these and lop + string literalName = sg->getProp()->head->getName(); + bool isDerivedPred = v->getDerivRules()->isDerivedPred(literalName); + + LogicalState logState = v->getState().getLogicalState(); + if(!neg && !isDerivedPred) + { + for(LogicalState::const_iterator i = logState.begin(); i != logState.end(); ++i) + { + if(i->second && (i->first->getPropName() == literalName)) + { + if(i->first->checkParametersConstantsMatch(sg->getProp()->args)) + { + addToListOfParameters(listOfparameters,lop,i->first->getConstants(op->parameters,sg->getProp()->args,v)); + } + }; + }; + } + else + { + //old style method for negations and derived predicates + set svs = getVariables(sg); + vector someParameters; + for(vector::const_iterator p = lop.begin(); p != lop.end(); ++p) + { + someParameters.push_back(new const_symbol_list(**p)); + }; + listOfparameters = defineUndefinedParametersPropVar(someParameters,op,v,g,isDerivedPred,neg,svs); + + }; + return listOfparameters; + }; + + //Negation + if(dynamic_cast(g)) + { + return getParametersList(const_cast(dynamic_cast(g)->getGoal()),op,v,lop,!neg,discrete,atAPoint); + }; + + ///Conjunction + if((!neg && (dynamic_cast(g))) || (neg && (dynamic_cast(g)))) + { + const goal_list* goalList; + if(dynamic_cast(g)) + { + goalList = dynamic_cast(g)->getGoals(); + } + else + { + goalList = dynamic_cast(g)->getGoals(); + }; + + if(goalList->empty()) return getCopyCSL(lop); + + vector aListOfparameters; + vector aListOfparametersTemp; + for(vector::const_iterator p = lop.begin(); p != lop.end(); ++p) aListOfparametersTemp.push_back(new const_symbol_list(**p)); + + + vector negCompGoals; //do negative ones (and comparisons) later as these often cause a lot of work, try to reduce list first + //loop thro' conjuncts + for(pc_list::const_iterator i = goalList->begin(); i != goalList->end(); ++i) + { + if(containsNegationComp(*i,neg)) negCompGoals.push_back(*i); + else + { + //get the list of parameters for each conjunct and then pass on list for next conjunct + if(!aListOfparametersTemp.empty()) + { + aListOfparameters = getParametersList(*i,op,v,aListOfparametersTemp,neg,discrete,atAPoint);//cout << " size of temp = "<::const_iterator j = negCompGoals.begin(); j != negCompGoals.end(); ++j) + { + if(!aListOfparametersTemp.empty()) + { + aListOfparameters = getParametersList(*j,op,v,aListOfparametersTemp,neg,discrete,atAPoint);//cout << " size of temp = "<(g))) || (neg && (dynamic_cast(g)))) + { + const goal_list* goalList; + if(dynamic_cast(g)) + { + goalList = dynamic_cast(g)->getGoals(); + } + else + { + goalList = dynamic_cast(g)->getGoals(); + }; + //loop thro' disjuncts + for(pc_list::const_iterator i = goalList->begin(); i != goalList->end(); ++i) + { + vector someParameters; + someParameters = getParametersList(*i,op,v,lop,neg,discrete,atAPoint); + for(vector::iterator j = someParameters.begin(); j != someParameters.end(); ++j) + listOfparameters.push_back(*j); + + //All remaining undefineds are given by existing objects and could be anything since + //remaining disjuncts need not be satisfied - thus leave as undefined + }; + + return listOfparameters; + }; + + + if(const qfied_goal* qg = dynamic_cast(g)) + { + goal * goalToCheck = newQfiedGoal(qg,op,v); + + listOfparameters = getParametersList(goalToCheck,op,v,lop,neg,discrete,atAPoint); + + delete goalToCheck; + + return listOfparameters; + }; + + if(const imply_goal * ig = dynamic_cast(g)) + { + neg_goal * ng = new neg_goal(const_cast(ig->getAntecedent())); + goal_list * gl = new goal_list();; + goal * agoal = new goal(*const_cast(ig->getConsequent())); + gl->push_back(ng); + gl->push_back(agoal); + disj_goal * goalToCheck = new disj_goal(gl); + + listOfparameters = getParametersList(goalToCheck,op,v,lop,neg,discrete,atAPoint); + gl->clear(); + ng->destroy(); + delete agoal; + delete goalToCheck; + + return listOfparameters; + }; + + return listOfparameters; +}; + + //find vs in the simple_goal parameters, map this to the parameter instantigation in sp +string getParameter(const SimpleProposition * sp,var_symbol * vs,const simple_goal * sg) +{ + string parameterName = ""; + int parameterNo = 1; + parameter_symbol_list::iterator p = sg->getProp()->args->begin(); + for(; p != sg->getProp()->args->end(); ++p) + { + if(vs == *p) break; + ++parameterNo; + }; + + if( p != sg->getProp()->args->end()) + { + parameterName = sp->getParameter(parameterNo); + }; + + return parameterName; +}; + +//find vs in the func_term parameters, map this to the parameter instantigation in fe +string getParameter(const FuncExp * fe,var_symbol * vs,const func_term * pne) +{ + string parameterName = ""; + int parameterNo = 1; + parameter_symbol_list * psl = const_cast(pne->getArgs()); + parameter_symbol_list::iterator p = psl->begin(); + for(; p != psl->end(); ++p) + { + if(vs == *p) break; + ++parameterNo; + }; + + if( p != psl->end()) + { + parameterName = fe->getParameter(parameterNo); + }; + + return parameterName; +}; + +bool undefinedParameterExists(const_symbol_list * csl) +{ + + for(const_symbol_list::iterator cs = csl->begin(); cs != csl->end(); ++cs) + { + if(!(*cs)) return true; + }; + + return false; +}; + +const set getVariables(const expression * e) +{ + set theVariables; + + if(dynamic_cast(e)) + { + const binary_expression * be = dynamic_cast(e); + theVariables = getVariables(be->getLHS()); + set svs2 =getVariables(be->getRHS()); + unionVariables(theVariables,svs2); + return theVariables; + }; + + if(dynamic_cast(e)) + { + const uminus_expression * ue = dynamic_cast(e); + theVariables = getVariables(ue->getExpr()); + return theVariables; + }; + + if(const func_term * fe = dynamic_cast(e)) + { + parameter_symbol_list *param_list = const_cast(fe->getArgs()); + + for(parameter_symbol_list::iterator i = param_list->begin(); i != param_list->end();++i) + { + if(dynamic_cast(*i)) + { + theVariables.insert(const_cast(dynamic_cast(*i))); + }; + }; + }; + + return theVariables; +}; + +const set getVariables(const simple_goal * sg) +{ + set theVariables; + + for(parameter_symbol_list::iterator i = sg->getProp()->args->begin(); i != sg->getProp()->args->end();++i) + { + if(dynamic_cast(*i)) + { + theVariables.insert(const_cast(dynamic_cast(*i))); + }; + }; + + return theVariables; +}; + +const set getVariables(const qfied_goal * qg) +{ + set theVariables; + + for(var_symbol_list::const_iterator i = qg->getVars()->begin(); i != qg->getVars()->end();++i) + { + theVariables.insert(const_cast(*i)); + }; + + return theVariables; +}; + +const set getVariables(const operator_ * op) +{ + set theVariables; + + for(var_symbol_list::const_iterator i = op->parameters->begin(); i != op->parameters->end();++i) + { + theVariables.insert(*i); + }; + + return theVariables; +}; + +//fill in parameters in lop with those in csl and return results, discard csl also +void addToListOfParameters(vector & vcsl,const vector & lop,const_symbol_list * csl) +{ + + bool satisfied; + + for(vector::const_iterator i = lop.begin(); i != lop.end(); ++i) + { + const_symbol_list * aConstList = new const_symbol_list(**i); + + satisfied = true; + const_symbol_list::const_iterator j = csl->begin(); + const_symbol_list::iterator l = aConstList->begin(); + for(const_symbol_list::const_iterator k = (*i)->begin(); k != (*i)->end(); ++k) + { + if((*j)) + { + if(!(*k)) + *l = *j; + else if(*l != *j) + satisfied = false; //the literal(or other) is not satisfied by previously defined parameters so not add to list of parameters + }; + + ++j; ++l; + }; + + if(satisfied) vcsl.push_back(aConstList); + else delete aConstList; + + + }; + + delete csl; + + //test + /* cout << " results\n"; + for(vector::const_iterator k = vcsl.begin(); k != vcsl.end() ; ++k) + { + for(const_symbol_list::iterator l = (*k)->begin(); l != (*k)->end(); ++l) + { + cout << (*l)->getName(); + + }; + cout <<"\n"; + }; */ + //end test + + +}; + +//for function below +bool isInList(const set & svs, var_symbol * vs) +{ + set::const_iterator i = svs.find(vs); + return (i != svs.end()); +}; + +//returns new set of parameter lists based on csl, only defines undefined variables if they are in svs +const vector defineUndefinedParameters(const_symbol_list * csl,var_symbol_list* variables,Validator * vld,const set & svs) +{ + map definedLists; + vector finalDefinedLists; + + if(csl->size() == 0 || !undefinedParameterExists(csl)) + { + finalDefinedLists.push_back(new const_symbol_list(*csl)); delete csl; + + return finalDefinedLists; + }; + + definedLists[1] = new const_symbol_list(*csl); + const_symbol_list* considerList = definedLists[1]; + unsigned int definedListNoConsider = 0; + unsigned int definedListNoAdd = 1; + + //loop thro definedLists until every parameter is ground, adding to definedLists when grounding a variable and other undefineds remain + + int paraNumber; + int paraNumber0; + bool remainingParasDefined; + + do{ + ++definedListNoConsider; + map::iterator dl = definedLists.find(definedListNoConsider); + if(dl == definedLists.end()) break; + considerList = dl->second; + + //choose the first undefined parameter + const_symbol_list::iterator cs = considerList->begin(); + var_symbol_list::iterator vs = variables->begin(); paraNumber = 1; + for(; cs != considerList->end(); ++cs) + { + if(!(*cs) && isInList(svs,*vs)) break; + ++vs; ++paraNumber; + }; + + if(cs == considerList->end()) {delete considerList; break;}; + + //are remaining parameters defined in list? + remainingParasDefined = true; var_symbol_list::iterator vs0 = variables->begin(); paraNumber0 = 1; + for(const_symbol_list::iterator cs0 = considerList->begin(); cs0 != considerList->end(); ++cs0) + { + if((!(*cs0)) && isInList(svs,*vs0) && (paraNumber0 > paraNumber)) remainingParasDefined = false; + ++vs0; ++paraNumber0; + }; + + //define the parameter for every possibility and add to list of definedLists + //cout << "Seeking range for " << **vs << "\n"; + vector vals = vld->range(*vs); + //cout << "Got\n"; + for(vector::const_iterator obj = vals.begin(); obj != vals.end(); ++obj) + { + const_symbol_list* parameters = new const_symbol_list(*considerList); + + const_symbol_list::iterator j = parameters->begin(); + for(int k = 1 ; k < paraNumber; ++k) {++j;}; + *j = *obj; + + if(!remainingParasDefined) definedLists[++definedListNoAdd] = parameters; + else finalDefinedLists.push_back(parameters); + }; + + delete considerList; //delete each consider list + }while(true);//end of looping thro defined lists, for given parameter, move to next parameter if considered parameter set was last in list when chosen + + /* + if(finalDefinedLists.empty()) + { + finalDefinedLists.push_back(new const_symbol_list(*csl)); + }; + */ + //test + /* cout << finalDefinedLists.size() << " results\n"; + + for(vector::const_iterator k = finalDefinedLists.begin(); k != finalDefinedLists.end() ; ++k) + { + for(const_symbol_list::iterator l = (*k)->begin(); l != (*k)->end(); ++l) + { + cout << (*l)->getName(); + + }; + cout <<"\n"; + }; //end test + */ + + delete csl; + return finalDefinedLists; +}; + + +const vector defineUndefinedParameters(const vector & vcsl,operator_ * op,Validator * vld,const set & svs) +{ + vector definedLists; + vector someDefinedLists; + + for(vector::const_iterator csl = vcsl.begin(); csl != vcsl.end(); ++csl) + { + someDefinedLists = defineUndefinedParameters(*csl,op->parameters,vld,svs); + + for(vector::const_iterator i = someDefinedLists.begin(); i != someDefinedLists.end(); ++i) + definedLists.push_back(*i); + + }; + + return definedLists; +}; + +//return parameter lists such that they satisfy the goal g, also delete reject candidate parameter lists! +const vector checkParametersProp(const vector & vcsl,operator_ * op,Validator * vld,goal * g,bool neg,bool dp,bool compError) +{ + vector definedLists; + + for(vector::const_iterator gp = vcsl.begin(); gp != vcsl.end(); ++gp) + { + bool propSatisfied; + if(dynamic_cast(g) && !dp) + { + const Proposition * prop = vld->pf.buildProposition(g,*(buildBindings(op,**gp).copy(vld))); + propSatisfied = prop->evaluate(&vld->getState()); + prop->destroy(); + } + else + { + const Proposition * prop = vld->pf.buildProposition(g,*(buildBindings(op,**gp).copy(vld))); + try + { + if(compError) propSatisfied = prop->evaluateAtPointWithinError(&vld->getState()); + else propSatisfied = prop->evaluate(&vld->getState()); + } + catch(BadAccessError & e) + { + if(!neg) propSatisfied = false; + else propSatisfied = true; //if a PNE is not defined, then no problem, the event is simply not triggered + }; + prop->destroy(); + }; + + if((propSatisfied && !neg) || (!propSatisfied && neg) ) + { + definedLists.push_back(*gp); + } + else + delete *gp; + + }; + + return definedLists; +}; + + +//define undefined parameters in csl (but only if in svs!) and ensure they satisfy the goal of the event +const vector defineUndefinedParametersPropVar(const_symbol_list * csl,operator_ * op,Validator * vld,goal * g,bool dp,bool neg,const set & svs,bool compError) +{ + vector groundListOfParameters; + + //if there are variables to ground then ground 'em! + if(!svs.empty()) groundListOfParameters = defineUndefinedParameters(csl,op->parameters,vld,svs); + else + { + groundListOfParameters.push_back(new const_symbol_list(*csl)); + delete csl; + }; + + return checkParametersProp(groundListOfParameters,op,vld,g,neg,dp,compError); +}; + +const vector defineUndefinedParametersPropVar(const vector & vcsl,operator_ * op,Validator * vld,goal * g,bool dp,bool neg,const set & svs,bool compError) +{ + vector definedLists; + vector someDefinedLists; + + for(vector::const_iterator csl = vcsl.begin(); csl != vcsl.end(); ++csl) + { + someDefinedLists = defineUndefinedParametersPropVar(*csl,op,vld,g,dp,neg,svs,compError); + + for(vector::const_iterator i = someDefinedLists.begin(); i != someDefinedLists.end(); ++i) + definedLists.push_back(*i); + }; + + return definedLists; +}; + +//get pnes in expression e +void getPNEs(const expression * e,set & pnes) +{ + + if(const func_term * fexpression = dynamic_cast(e)) + { + pnes.insert(fexpression); + return; + }; + + + if(const binary_expression * bexp = dynamic_cast(e)) + { + getPNEs(bexp->getLHS(),pnes); + getPNEs(bexp->getRHS(),pnes); + return; + }; + + if(const uminus_expression * uexp = dynamic_cast(e)) + { + getPNEs(uexp->getExpr(),pnes); + }; + + +}; + +//copy a goal including all subgoals +const goal * copyGoal(const goal * g) +{ + + if(dynamic_cast(g)) + { + const goal * ng = (dynamic_cast(g))->getGoal(); + + return new neg_goal(const_cast(copyGoal(ng))); + }; + + if(dynamic_cast(g)) + { + const imply_goal * ig = dynamic_cast(g); + + neg_goal * ng = new neg_goal(const_cast(copyGoal(ig->getAntecedent()))); + goal_list * gl = new goal_list();; + goal * agoal = const_cast(copyGoal(ig->getConsequent())); + gl->push_back(ng); + gl->push_back(agoal); + const disj_goal * dg = new disj_goal(gl); + + return copyGoal(dg); + }; + + if(dynamic_cast(g)) + { + const conj_goal * cg = dynamic_cast(g); + goal_list * gl = new goal_list(); + for(pc_list::const_iterator i = cg->getGoals()->begin(); i != cg->getGoals()->end(); ++i) + { + gl->push_back(const_cast(copyGoal(*i))); + }; + return new conj_goal(gl); + }; + + + if(dynamic_cast(g)) + { + const disj_goal * dg = dynamic_cast(g); + goal_list * gl = new goal_list(); + for(pc_list::const_iterator i = dg->getGoals()->begin(); i != dg->getGoals()->end(); ++i) + { + gl->push_back(const_cast(copyGoal(*i))); + }; + const disj_goal * d_goal = new disj_goal(gl); + + return d_goal; + }; + + + if(dynamic_cast(g)) + { + const qfied_goal * qg = dynamic_cast(g); + + const qfied_goal * ans; + var_symbol_table * sym_tab = new var_symbol_table(); + for(map::const_iterator i = qg->getSymTab()->begin(); i != qg->getSymTab()->end(); ++i) + { + sym_tab->symbol_put(i->first); + }; + + if(qg->getQuantifier() == E_EXISTS) + ans = new qfied_goal(E_EXISTS,new var_symbol_list(*const_cast(qg->getVars())), + const_cast(copyGoal(const_cast(qg->getGoal()))),sym_tab); + else + ans = new qfied_goal(E_FORALL,new var_symbol_list(*const_cast(qg->getVars())), + const_cast(copyGoal(const_cast(qg->getGoal()))),sym_tab); + + return ans; + }; + + if(dynamic_cast(g)) + { + const simple_goal * sg = dynamic_cast(g); + parameter_symbol_list* newpsl = new parameter_symbol_list(); + for(parameter_symbol_list::iterator i = sg->getProp()->args->begin();i != sg->getProp()->args->end();++i) + { + newpsl->push_back(*i); + }; + const proposition * prop = new proposition(sg->getProp()->head,newpsl); + const simple_goal * sim_goal = new simple_goal(const_cast(prop),sg->getPolarity()); + + return sim_goal; + }; + + if(dynamic_cast(g)) + { + const comparison * comp = dynamic_cast(g); + const expression * e1 = copyExpression(comp->getLHS()); //copy + const expression * e2 = copyExpression(comp->getRHS()); + + return new comparison(comp->getOp(),const_cast(e1),const_cast(e2)); + }; + + return g; +}; + +const expression * copyExpression(const expression * e) +{ + + if(const div_expression * fexpression = dynamic_cast(e)) + { + return new div_expression(const_cast(copyExpression(fexpression->getLHS())),const_cast(copyExpression(fexpression->getRHS()))); + }; + + if(const minus_expression * fexpression = dynamic_cast(e)) + { + return new minus_expression(const_cast(copyExpression(fexpression->getLHS())),const_cast(copyExpression(fexpression->getRHS()))); + }; + + if(const mul_expression * fexpression = dynamic_cast(e)) + { + return new mul_expression(const_cast(copyExpression(fexpression->getLHS())),const_cast(copyExpression(fexpression->getRHS()))); + }; + + if(const plus_expression * fexpression = dynamic_cast(e)) + { + return new plus_expression(const_cast(copyExpression(fexpression->getLHS())),const_cast(copyExpression(fexpression->getRHS()))); + }; + + if(const int_expression * fexpression = dynamic_cast(e)) + { + int aNumber = int(fexpression->double_value()); + return new int_expression(aNumber); + }; + + if(const float_expression * fexpression = dynamic_cast(e)) + { + NumScalar aNumber = fexpression->double_value(); + return new float_expression(aNumber); + }; + + if(const uminus_expression * fexpression = dynamic_cast(e)) + { + return new uminus_expression(const_cast(copyExpression(fexpression->getExpr()))); + }; + + if(const func_term * fexpression = dynamic_cast(e)) + { + parameter_symbol_list* newpsl = new parameter_symbol_list(); + for(parameter_symbol_list::const_iterator i = fexpression->getArgs()->begin();i != fexpression->getArgs()->end();++i) + { + newpsl->push_back(*i); + }; + + return new func_term(const_cast(fexpression->getFunction()),newpsl); + }; + + if(dynamic_cast(e)) + { + return e; + }; + + return e; +}; + +}; diff --git a/src/lex.yy.cc b/src/lex.yy.cc new file mode 100644 index 0000000..9a05b35 --- /dev/null +++ b/src/lex.yy.cc @@ -0,0 +1,2791 @@ + +#line 3 "lex.yy.cc" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 35 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + + /* The c++ scanner is a mess. The FlexLexer.h header file relies on the + * following macro. This is required in order to pass the c++-multiple-scanners + * test in the regression suite. We get reports that it breaks inheritance. + * We will address this in a future release of flex, or omit the C++ scanner + * altogether. + */ + #define yyFlexLexer yyFlexLexer + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ +#include +#include +#include +#include +#include +#include +/* end standard C++ headers. */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN (yy_start) = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START (((yy_start) - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +extern int yyleng; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, (yytext_ptr) ) + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + + std::istream* yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) + +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + +void *yyalloc (yy_size_t ); +void *yyrealloc (void *,yy_size_t ); +void yyfree (void * ); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +typedef unsigned char YY_CHAR; + +#define yytext_ptr yytext +#define YY_INTERACTIVE + +#include + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + yyleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; + +#define YY_NUM_RULES 115 +#define YY_END_OF_BUFFER 116 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[743] = + { 0, + 112, 112, 116, 115, 109, 111, 115, 1, 2, 97, + 95, 96, 105, 98, 112, 104, 115, 101, 67, 99, + 103, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 3, 4, 108, 109, 75, + 112, 113, 112, 114, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 110, 102, 100, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 55, 108, 108, 108, 108, + 108, 108, 108, 108, 113, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 108, 54, + 108, 0, 0, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 59, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 0, 8, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 108, 108, 0, 107, 0, 0, + + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 60, 108, 78, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 66, 65, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 19, 0, 0, 0, 108, 108, 107, 0, 0, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 58, 108, + 108, 108, 108, 108, 0, 108, 108, 108, 108, 108, + 108, 0, 26, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, + 0, 86, 84, 107, 47, 0, 108, 108, 34, 35, + 108, 61, 56, 57, 108, 108, 108, 108, 108, 108, + 79, 0, 108, 108, 108, 108, 108, 88, 36, 0, + 0, 0, 0, 0, 0, 0, 63, 0, 49, 0, + 0, 0, 0, 0, 0, 0, 0, 68, 71, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 69, 0, 7, 0, 9, 0, 108, 0, 108, + + 108, 108, 108, 108, 108, 108, 108, 108, 0, 108, + 62, 108, 108, 108, 108, 0, 25, 0, 0, 0, + 0, 40, 0, 0, 0, 0, 0, 0, 0, 15, + 0, 0, 0, 106, 0, 0, 0, 64, 0, 0, + 0, 0, 0, 37, 0, 0, 0, 0, 0, 108, + 46, 108, 81, 76, 108, 108, 80, 108, 73, 72, + 48, 108, 108, 82, 87, 108, 0, 0, 0, 0, + 0, 0, 0, 53, 0, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 108, 108, 108, 108, 108, + + 108, 108, 108, 108, 0, 43, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 24, 0, 52, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 108, 108, 94, 108, 108, 85, 83, 108, 108, + 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 41, 0, 23, 0, + 0, 0, 0, 0, 0, 108, 108, 93, 74, 108, + 108, 0, 0, 21, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, + 0, 0, 0, 108, 89, 108, 108, 18, 0, 0, + + 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, + 0, 42, 0, 5, 0, 0, 0, 92, 108, 108, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 90, 108, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 0, 0, 17, + 0, 0, 0, 0, 91, 0, 0, 0, 0, 0, + 39, 0, 0, 0, 16, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 28, 45, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 30, 32, 0, 0, 0, 0, + + 0, 44, 0, 0, 14, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 0, 0, 0, 0, 31, 0, + 33, 0, 0, 0, 0, 12, 0, 0, 13, 10, + 11, 0 + } ; + +static yyconst flex_int32_t yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 1, 1, 5, 1, 1, 1, 1, 6, + 7, 8, 9, 1, 10, 11, 12, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 14, 15, 16, + 17, 18, 19, 1, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 1, 47, 1, 30, 1, 48, 49, 50, 51, + + 52, 53, 54, 55, 56, 57, 30, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst flex_int32_t yy_meta[73] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 3, 1, 4, 1, 1, 1, 1, 1, 1, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4 + } ; + +static yyconst flex_int16_t yy_base[747] = + { 0, + 0, 34, 699, 1802, 72, 1802, 36, 1802, 1802, 1802, + 1802, 684, 1802, 1802, 66, 83, 682, 666, 1802, 664, + 1802, 141, 68, 142, 70, 143, 147, 151, 76, 152, + 177, 158, 178, 183, 210, 1802, 1802, 214, 80, 1802, + 74, 549, 77, 80, 147, 144, 206, 218, 224, 67, + 125, 73, 245, 232, 78, 212, 186, 86, 211, 246, + 235, 554, 1802, 1802, 1802, 0, 82, 279, 288, 290, + 283, 294, 295, 299, 310, 305, 300, 312, 316, 340, + 223, 322, 346, 321, 356, 328, 358, 362, 332, 371, + 381, 385, 387, 389, 524, 291, 309, 209, 313, 321, + + 336, 345, 352, 358, 382, 367, 384, 384, 384, 378, + 386, 393, 394, 391, 386, 404, 402, 399, 400, 395, + 415, 418, 406, 406, 434, 428, 426, 435, 455, 464, + 468, 482, 495, 441, 470, 499, 491, 500, 504, 480, + 515, 513, 519, 528, 438, 530, 539, 541, 558, 556, + 560, 562, 543, 574, 568, 581, 590, 586, 466, 1802, + 451, 567, 474, 532, 556, 560, 573, 511, 582, 482, + 544, 592, 591, 597, 590, 583, 603, 598, 590, 588, + 609, 607, 610, 615, 614, 620, 611, 606, 622, 616, + 628, 634, 644, 619, 664, 656, 472, 533, 628, 636, + + 642, 680, 679, 681, 685, 701, 703, 705, 707, 713, + 709, 651, 717, 718, 728, 730, 734, 735, 746, 752, + 754, 758, 768, 762, 712, 717, 673, 721, 746, 738, + 743, 760, 751, 770, 759, 764, 760, 761, 770, 770, + 765, 1802, 769, 768, 768, 780, 780, 774, 777, 787, + 811, 785, 795, 805, 809, 796, 811, 824, 808, 813, + 822, 811, 817, 828, 843, 845, 459, 831, 839, 825, + 873, 855, 878, 884, 879, 885, 886, 880, 891, 900, + 868, 896, 905, 909, 894, 917, 943, 922, 947, 924, + 926, 908, 925, 906, 942, 914, 931, 918, 925, 935, + + 926, 929, 941, 1802, 946, 454, 941, 943, 956, 954, + 957, 965, 964, 961, 966, 957, 969, 977, 972, 980, + 971, 971, 983, 976, 983, 383, 980, 314, 1802, 993, + 984, 1015, 1021, 301, 1802, 987, 987, 1033, 1039, 1044, + 1045, 1046, 1050, 1051, 1012, 1002, 1057, 1019, 1062, 1063, + 1068, 1031, 1072, 1070, 1061, 1077, 1027, 1078, 284, 1048, + 1064, 1061, 1077, 1059, 1080, 1082, 1802, 1076, 1802, 1081, + 1061, 1078, 1090, 1078, 1084, 1088, 1103, 1802, 1802, 1092, + 1098, 1118, 1131, 1123, 1110, 1127, 1132, 1129, 1117, 1131, + 1134, 1802, 1125, 1802, 1133, 1802, 1125, 1122, 1126, 273, + + 1149, 1161, 1131, 1135, 1185, 1157, 1190, 1194, 1148, 1175, + 1200, 1159, 1167, 1202, 1155, 1194, 1802, 1188, 1184, 1189, + 1190, 237, 1186, 1195, 1195, 1208, 1188, 1194, 1209, 1802, + 1203, 221, 1205, 1802, 1215, 215, 1215, 1802, 1212, 1217, + 1220, 1214, 1223, 1802, 1229, 1229, 1227, 1233, 1251, 1244, + 1802, 1240, 1265, 1269, 1253, 1253, 1274, 1247, 1279, 1284, + 1802, 1285, 1248, 0, 1293, 1264, 1268, 1271, 1272, 1278, + 1272, 1279, 1280, 211, 205, 1281, 1802, 1288, 1293, 1282, + 1297, 1285, 163, 1297, 1294, 1802, 1289, 1288, 1304, 1308, + 1308, 1309, 1310, 1312, 1312, 1306, 1315, 1318, 1324, 1335, + + 1353, 1331, 1353, 1341, 1329, 1349, 1802, 1332, 1338, 1342, + 1339, 1353, 1363, 1352, 1366, 1364, 1802, 1364, 1802, 1357, + 1364, 1356, 1361, 1362, 1362, 1380, 1385, 1377, 1391, 1376, + 157, 1393, 1399, 0, 1398, 1402, 1418, 0, 1404, 1406, + 0, 1394, 1403, 1397, 153, 1414, 1415, 1410, 1418, 1421, + 1415, 1425, 1425, 1417, 1415, 1427, 1802, 1422, 1802, 1421, + 149, 1424, 1430, 1437, 1434, 1443, 1450, 0, 0, 1437, + 1452, 1442, 120, 1802, 1460, 1462, 119, 1463, 1450, 1464, + 102, 1455, 1471, 1473, 1474, 1467, 1468, 1802, 1469, 1468, + 1475, 1489, 1474, 1481, 0, 1493, 1485, 1802, 1498, 1499, + + 1501, 1497, 1498, 1502, 1497, 1504, 1802, 1518, 1520, 1511, + 1508, 1802, 1511, 1802, 1526, 1520, 1529, 0, 1518, 1519, + 1535, 1537, 1542, 1530, 1529, 1538, 1537, 1536, 1537, 1545, + 1541, 1546, 1561, 1558, 84, 1565, 0, 1565, 1566, 1571, + 1577, 1574, 1581, 1571, 1571, 1578, 1802, 1575, 1571, 1802, + 1588, 1573, 1585, 1584, 0, 1596, 1599, 1585, 1600, 1596, + 1590, 1600, 1612, 1614, 1802, 1606, 1613, 1614, 1611, 1624, + 1613, 1623, 1619, 1628, 1802, 1802, 1624, 1631, 1628, 1629, + 1625, 1643, 1629, 1634, 1635, 1643, 1638, 1645, 1642, 1659, + 1653, 1659, 1661, 1654, 1802, 1802, 1670, 1668, 1674, 1670, + + 1673, 1802, 1669, 1668, 1802, 1674, 1685, 1684, 1680, 1676, + 1696, 1690, 1681, 1684, 1684, 1694, 1700, 1700, 1698, 1707, + 1802, 1708, 1700, 1705, 1705, 1712, 1714, 1717, 1802, 1719, + 1802, 1715, 1722, 1724, 1722, 1802, 1723, 1724, 1802, 1802, + 1802, 1802, 1787, 1791, 1794, 1797 + } ; + +static yyconst flex_int16_t yy_def[747] = + { 0, + 742, 1, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 743, 742, 744, 742, 742, 742, + 742, 745, 745, 745, 745, 745, 745, 745, 745, 745, + 745, 745, 745, 745, 745, 742, 742, 745, 742, 742, + 742, 742, 743, 743, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 744, 742, 742, 742, 746, 745, 745, 745, 745, + 745, 745, 745, 745, 745, 745, 745, 745, 745, 745, + 745, 745, 745, 745, 745, 745, 745, 745, 745, 745, + 745, 745, 745, 745, 742, 742, 742, 742, 742, 742, + + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 745, 745, + 745, 742, 742, 746, 745, 745, 745, 745, 745, 745, + 745, 745, 745, 745, 746, 745, 745, 745, 745, 745, + 745, 745, 745, 745, 745, 745, 745, 745, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 745, 745, 742, 742, 742, 742, + + 746, 745, 745, 745, 745, 745, 745, 745, 745, 745, + 745, 746, 745, 745, 745, 745, 745, 745, 745, 745, + 745, 745, 745, 745, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 745, 745, 742, 742, 742, 746, + 745, 745, 745, 745, 745, 745, 745, 746, 745, 745, + 746, 745, 745, 745, 742, 745, 745, 745, 745, 745, + 745, 742, 742, 742, 742, 742, 742, 742, 742, 742, + + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 745, 745, 742, 742, 742, 746, 745, 745, 745, + 745, 745, 745, 745, 746, 746, 745, 746, 745, 745, + 745, 742, 745, 745, 746, 745, 746, 745, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 746, 742, 746, + + 745, 745, 746, 746, 745, 746, 745, 745, 742, 745, + 745, 746, 746, 745, 746, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 746, + 742, 746, 745, 745, 746, 746, 745, 746, 745, 745, + 742, 745, 746, 746, 745, 746, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 746, 746, 746, 746, 746, + + 745, 746, 746, 746, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 746, 746, 746, 746, 746, 745, 746, 746, 746, + 746, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 746, 746, 746, 746, 746, + 746, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 746, 746, 746, 746, 742, 742, 742, + + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 746, 746, 746, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 746, 746, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 746, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 0, 742, 742, 742, 742 + } ; + +static yyconst flex_int16_t yy_nxt[1875] = + { 0, + 4, 5, 6, 5, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 23, 24, 25, 26, 23, 27, 28, 23, 23, + 23, 29, 30, 31, 32, 23, 23, 33, 34, 23, + 23, 35, 23, 23, 23, 36, 37, 22, 23, 23, + 24, 25, 26, 23, 27, 28, 23, 23, 29, 30, + 31, 32, 23, 23, 33, 34, 23, 23, 35, 23, + 23, 23, 38, 39, 40, 39, 42, 66, 43, 66, + 66, 39, 66, 39, 42, 66, 41, 42, 66, 43, + 742, 66, 742, 653, 66, 82, 114, 75, 119, 38, + + 112, 40, 45, 83, 46, 47, 48, 49, 50, 123, + 51, 606, 76, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 82, 114, 75, 119, 112, 602, 599, + 45, 83, 46, 47, 48, 49, 50, 123, 51, 76, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 66, 66, 66, 66, 66, 66, 66, 113, 589, 66, + 66, 66, 575, 66, 66, 72, 565, 66, 96, 97, + 66, 68, 520, 69, 98, 73, 77, 99, 70, 71, + 78, 74, 79, 80, 113, 84, 66, 66, 81, 66, + 66, 85, 66, 72, 88, 66, 96, 97, 68, 89, + + 69, 98, 73, 77, 99, 70, 71, 78, 74, 79, + 80, 90, 84, 86, 513, 81, 91, 87, 85, 66, + 512, 88, 66, 66, 484, 122, 66, 89, 161, 100, + 481, 120, 145, 101, 124, 66, 92, 93, 90, 102, + 86, 94, 104, 91, 87, 103, 472, 91, 121, 125, + 105, 109, 122, 106, 110, 117, 161, 100, 107, 120, + 108, 101, 124, 111, 92, 93, 102, 128, 115, 94, + 104, 118, 103, 126, 91, 121, 125, 105, 116, 109, + 106, 110, 452, 117, 132, 107, 133, 108, 66, 127, + 111, 66, 134, 416, 128, 66, 115, 66, 118, 66, + + 66, 126, 66, 66, 66, 116, 66, 66, 66, 66, + 130, 66, 66, 334, 66, 135, 127, 66, 136, 66, + 129, 66, 66, 395, 66, 66, 137, 131, 66, 159, + 66, 66, 140, 66, 66, 138, 141, 66, 130, 160, + 66, 66, 142, 135, 66, 162, 136, 129, 139, 66, + 143, 153, 66, 137, 131, 66, 159, 163, 66, 148, + 140, 144, 138, 141, 146, 66, 160, 66, 66, 142, + 66, 66, 162, 164, 66, 139, 165, 143, 147, 153, + 66, 150, 167, 66, 163, 151, 148, 149, 166, 144, + 66, 146, 393, 66, 66, 152, 66, 66, 66, 66, + + 164, 66, 154, 165, 168, 147, 169, 170, 156, 150, + 167, 171, 175, 151, 149, 166, 172, 173, 174, 155, + 158, 176, 152, 178, 179, 157, 180, 181, 183, 154, + 182, 184, 168, 169, 177, 170, 156, 187, 185, 171, + 175, 188, 189, 172, 173, 174, 155, 158, 186, 176, + 178, 179, 157, 190, 180, 181, 183, 182, 184, 192, + 193, 177, 194, 373, 66, 187, 185, 66, 188, 189, + 191, 334, 201, 66, 195, 186, 66, 66, 212, 66, + 66, 190, 66, 132, 198, 132, 192, 193, 226, 66, + 194, 197, 66, 225, 198, 196, 132, 191, 132, 201, + + 66, 230, 195, 66, 197, 212, 202, 198, 66, 66, + 204, 66, 66, 66, 237, 226, 66, 207, 199, 205, + 235, 225, 66, 196, 66, 66, 203, 66, 66, 230, + 206, 66, 200, 202, 208, 209, 95, 66, 204, 66, + 66, 237, 66, 267, 207, 198, 199, 205, 66, 210, + 66, 66, 66, 66, 203, 66, 63, 213, 206, 200, + 231, 95, 208, 209, 211, 66, 214, 66, 66, 66, + 66, 66, 66, 219, 66, 232, 210, 66, 215, 233, + 66, 238, 218, 66, 217, 213, 66, 221, 231, 227, + 66, 211, 216, 66, 214, 66, 234, 220, 66, 66, + + 219, 236, 66, 232, 228, 229, 215, 233, 238, 224, + 218, 239, 217, 222, 240, 221, 223, 227, 241, 216, + 242, 243, 244, 245, 234, 220, 246, 247, 248, 236, + 249, 228, 229, 250, 251, 252, 253, 224, 254, 239, + 222, 255, 240, 256, 223, 257, 241, 242, 243, 258, + 244, 245, 259, 246, 247, 260, 248, 261, 249, 264, + 268, 250, 251, 252, 253, 66, 254, 262, 66, 255, + 256, 263, 257, 66, 269, 270, 66, 258, 281, 259, + 65, 266, 64, 260, 63, 261, 264, 268, 66, 66, + 66, 66, 66, 66, 66, 262, 41, 66, 742, 263, + + 294, 269, 270, 271, 742, 742, 281, 265, 273, 266, + 66, 272, 66, 66, 66, 66, 278, 66, 66, 66, + 742, 66, 66, 274, 275, 66, 66, 66, 294, 66, + 66, 271, 280, 285, 265, 277, 273, 66, 272, 66, + 66, 276, 66, 66, 66, 292, 66, 66, 282, 283, + 274, 284, 275, 742, 293, 66, 279, 286, 66, 295, + 280, 66, 277, 66, 66, 287, 66, 66, 276, 288, + 66, 66, 292, 296, 66, 282, 283, 66, 297, 284, + 66, 293, 298, 279, 290, 286, 295, 299, 742, 300, + 289, 301, 287, 302, 303, 291, 309, 288, 304, 305, + + 306, 296, 307, 308, 310, 297, 311, 312, 316, 298, + 313, 290, 314, 315, 742, 299, 300, 289, 319, 301, + 302, 303, 320, 291, 309, 304, 305, 306, 321, 307, + 308, 310, 322, 311, 323, 312, 316, 313, 324, 314, + 315, 317, 318, 325, 328, 319, 326, 327, 329, 330, + 320, 331, 66, 335, 66, 66, 321, 66, 336, 742, + 322, 323, 337, 742, 66, 742, 324, 66, 317, 318, + 742, 325, 328, 326, 327, 329, 330, 333, 339, 331, + 332, 335, 66, 742, 742, 66, 336, 66, 66, 337, + 66, 66, 338, 66, 66, 66, 66, 66, 66, 345, + + 66, 348, 346, 66, 333, 66, 339, 332, 66, 66, + 340, 341, 66, 352, 66, 342, 344, 66, 66, 347, + 338, 66, 343, 349, 742, 742, 66, 345, 348, 66, + 346, 355, 350, 357, 66, 66, 66, 340, 66, 341, + 359, 352, 342, 344, 361, 351, 364, 347, 360, 343, + 366, 349, 66, 353, 365, 66, 66, 367, 358, 66, + 350, 362, 368, 742, 369, 370, 354, 359, 371, 372, + 375, 361, 351, 364, 356, 376, 360, 366, 363, 374, + 353, 377, 365, 378, 367, 358, 379, 380, 381, 362, + 368, 369, 370, 382, 354, 383, 371, 372, 375, 384, + + 385, 387, 356, 376, 386, 363, 374, 388, 389, 377, + 390, 378, 391, 392, 379, 380, 381, 394, 396, 742, + 397, 382, 383, 399, 398, 400, 384, 66, 385, 387, + 66, 386, 742, 66, 388, 389, 403, 742, 390, 391, + 392, 404, 66, 742, 394, 66, 396, 397, 66, 406, + 399, 66, 400, 66, 66, 66, 66, 66, 66, 66, + 66, 409, 66, 66, 403, 415, 66, 742, 404, 66, + 401, 66, 66, 742, 66, 66, 406, 66, 402, 66, + 66, 66, 66, 412, 66, 417, 66, 66, 409, 66, + 66, 418, 415, 419, 405, 410, 420, 401, 421, 427, + + 413, 411, 422, 423, 426, 402, 407, 408, 414, 424, + 428, 412, 417, 429, 742, 430, 425, 431, 432, 418, + 419, 405, 433, 410, 420, 421, 427, 413, 411, 434, + 422, 423, 426, 407, 408, 414, 424, 428, 435, 436, + 437, 429, 430, 425, 431, 432, 439, 742, 440, 441, + 433, 442, 443, 742, 444, 445, 434, 446, 66, 447, + 448, 66, 449, 450, 451, 435, 742, 436, 438, 455, + 66, 456, 453, 66, 439, 440, 458, 441, 461, 442, + 443, 444, 466, 445, 66, 446, 447, 66, 448, 449, + 450, 451, 463, 454, 66, 438, 455, 66, 456, 66, + + 453, 464, 66, 66, 458, 461, 66, 462, 457, 66, + 466, 66, 66, 459, 66, 467, 470, 460, 475, 463, + 454, 468, 469, 471, 473, 465, 742, 474, 464, 476, + 742, 477, 478, 479, 462, 480, 457, 482, 483, 485, + 487, 459, 486, 467, 470, 460, 475, 488, 468, 469, + 471, 473, 489, 465, 474, 490, 491, 476, 477, 478, + 492, 479, 480, 493, 482, 494, 483, 485, 487, 486, + 495, 496, 742, 497, 66, 488, 498, 66, 66, 489, + 499, 66, 490, 66, 491, 500, 66, 492, 66, 502, + 493, 66, 494, 66, 66, 504, 66, 66, 495, 496, + + 497, 505, 503, 506, 498, 66, 501, 511, 499, 507, + 508, 509, 500, 510, 514, 515, 502, 516, 742, 517, + 518, 521, 504, 519, 522, 523, 524, 525, 505, 526, + 506, 527, 528, 529, 501, 511, 507, 508, 509, 530, + 510, 514, 531, 515, 532, 516, 517, 533, 518, 521, + 519, 522, 523, 524, 534, 525, 535, 526, 536, 527, + 528, 529, 66, 538, 541, 66, 542, 530, 543, 531, + 544, 532, 539, 540, 533, 545, 537, 742, 546, 547, + 548, 534, 549, 535, 550, 551, 536, 552, 553, 558, + 538, 554, 541, 542, 555, 556, 543, 544, 557, 559, + + 539, 540, 545, 560, 537, 546, 547, 561, 548, 562, + 549, 550, 563, 551, 564, 552, 553, 558, 554, 566, + 567, 555, 556, 568, 569, 557, 559, 66, 570, 571, + 66, 560, 572, 573, 574, 561, 562, 576, 577, 579, + 563, 564, 578, 580, 742, 581, 582, 566, 567, 583, + 586, 568, 569, 584, 585, 587, 570, 571, 588, 572, + 573, 574, 590, 591, 592, 576, 577, 579, 593, 578, + 594, 580, 581, 595, 582, 596, 597, 583, 586, 598, + 584, 585, 587, 600, 601, 588, 603, 742, 604, 590, + 591, 605, 592, 607, 608, 593, 609, 610, 594, 611, + + 612, 595, 596, 613, 597, 614, 598, 615, 616, 742, + 617, 600, 601, 618, 603, 604, 619, 742, 620, 605, + 607, 621, 608, 622, 609, 610, 611, 612, 623, 626, + 613, 624, 614, 625, 615, 627, 616, 617, 628, 629, + 618, 630, 742, 631, 619, 620, 632, 633, 634, 621, + 635, 622, 636, 742, 637, 638, 623, 626, 624, 639, + 625, 640, 627, 641, 645, 628, 642, 629, 643, 630, + 631, 644, 646, 632, 633, 647, 634, 635, 648, 649, + 636, 637, 638, 650, 651, 652, 654, 639, 655, 640, + 656, 641, 645, 642, 657, 643, 658, 659, 644, 646, + + 660, 663, 647, 661, 662, 648, 649, 664, 665, 666, + 650, 667, 651, 652, 654, 668, 655, 669, 656, 670, + 671, 673, 657, 672, 658, 659, 674, 675, 660, 663, + 661, 662, 676, 677, 664, 665, 678, 666, 667, 679, + 680, 681, 668, 682, 669, 683, 685, 670, 671, 673, + 672, 684, 686, 674, 675, 687, 742, 688, 689, 676, + 690, 677, 691, 692, 678, 693, 679, 694, 680, 681, + 682, 695, 696, 683, 685, 697, 698, 699, 684, 686, + 700, 701, 703, 687, 688, 702, 689, 690, 704, 691, + 692, 705, 706, 693, 694, 707, 708, 709, 695, 696, + + 710, 713, 697, 698, 699, 711, 712, 700, 714, 701, + 703, 715, 702, 716, 717, 718, 704, 719, 705, 720, + 706, 721, 722, 707, 708, 709, 723, 724, 710, 713, + 725, 726, 711, 712, 727, 728, 714, 729, 730, 715, + 716, 717, 731, 718, 732, 719, 720, 733, 721, 722, + 734, 735, 736, 723, 737, 724, 738, 725, 726, 739, + 740, 741, 727, 728, 729, 730, 742, 742, 742, 731, + 742, 732, 742, 742, 733, 742, 742, 734, 735, 736, + 742, 737, 742, 738, 742, 742, 739, 740, 741, 44, + 44, 62, 62, 62, 62, 67, 742, 67, 66, 742, + + 66, 3, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742 + } ; + +static yyconst flex_int16_t yy_chk[1875] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 5, 7, 5, 15, 23, 15, 25, + 23, 39, 25, 39, 41, 29, 41, 43, 29, 43, + 44, 67, 44, 635, 67, 29, 52, 25, 55, 2, + + 50, 7, 16, 29, 16, 16, 16, 16, 16, 58, + 16, 581, 25, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 29, 52, 25, 55, 50, 577, 573, + 16, 29, 16, 16, 16, 16, 16, 58, 16, 25, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 22, 24, 26, 22, 24, 26, 27, 51, 561, 27, + 28, 30, 545, 28, 30, 24, 531, 32, 45, 45, + 32, 22, 483, 22, 46, 24, 26, 46, 22, 22, + 27, 24, 28, 28, 51, 30, 31, 33, 28, 31, + 33, 30, 34, 24, 32, 34, 45, 45, 22, 33, + + 22, 46, 24, 26, 46, 22, 22, 27, 24, 28, + 28, 33, 30, 31, 475, 28, 34, 31, 30, 35, + 474, 32, 35, 38, 436, 57, 38, 33, 98, 47, + 432, 56, 81, 47, 59, 81, 35, 35, 33, 47, + 31, 38, 48, 34, 31, 47, 422, 38, 56, 59, + 48, 49, 57, 48, 49, 54, 98, 47, 48, 56, + 48, 47, 59, 49, 35, 35, 47, 61, 53, 38, + 48, 54, 47, 60, 38, 56, 59, 48, 53, 49, + 48, 49, 400, 54, 71, 48, 71, 48, 68, 60, + 49, 68, 71, 359, 61, 71, 53, 69, 54, 70, + + 69, 60, 70, 72, 73, 53, 72, 73, 74, 77, + 69, 74, 77, 334, 76, 72, 60, 76, 72, 75, + 68, 78, 75, 328, 78, 79, 73, 70, 79, 96, + 84, 82, 76, 84, 82, 74, 77, 86, 69, 97, + 86, 89, 78, 72, 89, 99, 72, 68, 75, 80, + 79, 89, 80, 73, 70, 83, 96, 100, 83, 84, + 76, 80, 74, 77, 82, 85, 97, 87, 85, 78, + 87, 88, 99, 101, 88, 75, 102, 79, 83, 89, + 90, 87, 104, 90, 100, 88, 84, 85, 103, 80, + 91, 82, 326, 91, 92, 88, 93, 92, 94, 93, + + 101, 94, 90, 102, 105, 83, 106, 107, 92, 87, + 104, 108, 112, 88, 85, 103, 109, 110, 111, 91, + 94, 113, 88, 114, 115, 93, 116, 117, 119, 90, + 118, 120, 105, 106, 113, 107, 92, 122, 121, 108, + 112, 123, 124, 109, 110, 111, 91, 94, 121, 113, + 114, 115, 93, 125, 116, 117, 119, 118, 120, 126, + 127, 113, 128, 306, 129, 122, 121, 129, 123, 124, + 125, 267, 134, 130, 129, 121, 130, 131, 145, 135, + 131, 125, 135, 132, 197, 132, 126, 127, 161, 140, + 128, 132, 140, 159, 132, 131, 133, 125, 133, 134, + + 137, 163, 129, 137, 133, 145, 135, 133, 136, 138, + 137, 136, 138, 139, 170, 161, 139, 140, 133, 138, + 168, 159, 142, 131, 141, 142, 136, 141, 143, 163, + 139, 143, 133, 135, 141, 142, 95, 144, 137, 146, + 144, 170, 146, 198, 140, 198, 133, 138, 147, 143, + 148, 147, 153, 148, 136, 153, 62, 146, 139, 133, + 164, 42, 141, 142, 144, 150, 147, 149, 150, 151, + 149, 152, 151, 153, 152, 165, 143, 155, 149, 166, + 155, 171, 152, 154, 151, 146, 154, 155, 164, 162, + 156, 144, 150, 156, 147, 158, 167, 154, 158, 157, + + 153, 169, 157, 165, 162, 162, 149, 166, 171, 158, + 152, 172, 151, 156, 173, 155, 157, 162, 174, 150, + 175, 176, 177, 178, 167, 154, 179, 180, 181, 169, + 182, 162, 162, 183, 184, 185, 185, 158, 185, 172, + 156, 186, 173, 187, 157, 188, 174, 175, 176, 189, + 177, 178, 190, 179, 180, 191, 181, 192, 182, 194, + 199, 183, 184, 185, 185, 196, 185, 193, 196, 186, + 187, 193, 188, 195, 200, 201, 195, 189, 212, 190, + 20, 196, 18, 191, 17, 192, 194, 199, 203, 202, + 204, 203, 202, 204, 205, 193, 12, 205, 3, 193, + + 227, 200, 201, 202, 0, 0, 212, 195, 204, 196, + 206, 203, 207, 206, 208, 207, 209, 208, 211, 209, + 0, 211, 210, 205, 206, 210, 213, 214, 227, 213, + 214, 202, 211, 216, 195, 208, 204, 215, 203, 216, + 215, 207, 216, 217, 218, 225, 217, 218, 213, 214, + 205, 215, 206, 0, 226, 219, 210, 217, 219, 228, + 211, 220, 208, 221, 220, 218, 221, 222, 207, 219, + 222, 224, 225, 229, 224, 213, 214, 223, 230, 215, + 223, 226, 231, 210, 221, 217, 228, 232, 0, 233, + 220, 234, 218, 235, 236, 223, 243, 219, 237, 238, + + 239, 229, 240, 241, 244, 230, 245, 246, 250, 231, + 247, 221, 248, 249, 0, 232, 233, 220, 252, 234, + 235, 236, 253, 223, 243, 237, 238, 239, 254, 240, + 241, 244, 255, 245, 256, 246, 250, 247, 257, 248, + 249, 251, 251, 258, 261, 252, 259, 260, 262, 263, + 253, 264, 265, 268, 266, 265, 254, 266, 269, 0, + 255, 256, 270, 0, 272, 0, 257, 272, 251, 251, + 0, 258, 261, 259, 260, 262, 263, 266, 272, 264, + 265, 268, 271, 0, 0, 271, 269, 273, 275, 270, + 273, 275, 271, 274, 276, 277, 274, 276, 277, 278, + + 279, 281, 278, 279, 266, 282, 272, 265, 282, 280, + 273, 274, 280, 285, 283, 275, 277, 283, 284, 280, + 271, 284, 276, 282, 0, 0, 286, 278, 281, 286, + 278, 288, 283, 290, 288, 291, 290, 273, 291, 274, + 292, 285, 275, 277, 294, 284, 296, 280, 293, 276, + 298, 282, 287, 286, 297, 287, 289, 299, 291, 289, + 283, 295, 300, 0, 301, 302, 287, 292, 303, 305, + 308, 294, 284, 296, 289, 309, 293, 298, 295, 307, + 286, 310, 297, 311, 299, 291, 312, 313, 314, 295, + 300, 301, 302, 315, 287, 316, 303, 305, 308, 317, + + 318, 320, 289, 309, 319, 295, 307, 321, 322, 310, + 323, 311, 324, 325, 312, 313, 314, 327, 330, 0, + 331, 315, 316, 336, 332, 337, 317, 332, 318, 320, + 333, 319, 0, 333, 321, 322, 345, 0, 323, 324, + 325, 346, 338, 0, 327, 338, 330, 331, 339, 348, + 336, 339, 337, 340, 341, 342, 340, 341, 342, 343, + 344, 352, 343, 344, 345, 357, 347, 0, 346, 347, + 338, 349, 350, 0, 349, 350, 348, 351, 341, 354, + 351, 353, 354, 355, 353, 360, 356, 358, 352, 356, + 358, 361, 357, 362, 347, 353, 363, 338, 364, 371, + + 355, 354, 365, 366, 370, 341, 349, 350, 356, 368, + 372, 355, 360, 373, 0, 374, 368, 375, 376, 361, + 362, 347, 377, 353, 363, 364, 371, 355, 354, 380, + 365, 366, 370, 349, 350, 356, 368, 372, 381, 382, + 383, 373, 374, 368, 375, 376, 384, 0, 385, 386, + 377, 387, 388, 0, 389, 390, 380, 391, 401, 393, + 395, 401, 397, 398, 399, 381, 0, 382, 383, 403, + 402, 404, 401, 402, 384, 385, 406, 386, 409, 387, + 388, 389, 415, 390, 410, 391, 393, 410, 395, 397, + 398, 399, 412, 402, 405, 383, 403, 405, 404, 407, + + 401, 413, 407, 408, 406, 409, 408, 410, 405, 411, + 415, 414, 411, 407, 414, 416, 420, 408, 425, 412, + 402, 418, 419, 421, 423, 414, 0, 424, 413, 426, + 0, 427, 428, 429, 410, 431, 405, 433, 435, 437, + 440, 407, 439, 416, 420, 408, 425, 441, 418, 419, + 421, 423, 442, 414, 424, 443, 445, 426, 427, 428, + 446, 429, 431, 447, 433, 448, 435, 437, 440, 439, + 449, 450, 0, 452, 453, 441, 455, 453, 454, 442, + 456, 454, 443, 457, 445, 458, 457, 446, 459, 463, + 447, 459, 448, 460, 462, 466, 460, 462, 449, 450, + + 452, 467, 465, 468, 455, 465, 462, 473, 456, 469, + 470, 471, 458, 472, 476, 478, 463, 479, 0, 480, + 481, 484, 466, 482, 485, 487, 488, 489, 467, 490, + 468, 491, 492, 493, 462, 473, 469, 470, 471, 494, + 472, 476, 495, 478, 496, 479, 480, 497, 481, 484, + 482, 485, 487, 488, 498, 489, 499, 490, 500, 491, + 492, 493, 501, 502, 504, 501, 505, 494, 506, 495, + 508, 496, 503, 503, 497, 509, 501, 0, 510, 511, + 512, 498, 513, 499, 514, 515, 500, 516, 518, 524, + 502, 520, 504, 505, 521, 522, 506, 508, 523, 525, + + 503, 503, 509, 526, 501, 510, 511, 527, 512, 528, + 513, 514, 529, 515, 530, 516, 518, 524, 520, 532, + 533, 521, 522, 535, 536, 523, 525, 537, 539, 540, + 537, 526, 542, 543, 544, 527, 528, 546, 547, 549, + 529, 530, 548, 550, 0, 551, 552, 532, 533, 553, + 556, 535, 536, 554, 555, 558, 539, 540, 560, 542, + 543, 544, 562, 563, 564, 546, 547, 549, 565, 548, + 566, 550, 551, 567, 552, 570, 571, 553, 556, 572, + 554, 555, 558, 575, 576, 560, 578, 0, 579, 562, + 563, 580, 564, 582, 583, 565, 584, 585, 566, 586, + + 587, 567, 570, 589, 571, 590, 572, 591, 592, 0, + 593, 575, 576, 594, 578, 579, 596, 0, 597, 580, + 582, 599, 583, 600, 584, 585, 586, 587, 601, 604, + 589, 602, 590, 603, 591, 605, 592, 593, 606, 608, + 594, 609, 0, 610, 596, 597, 611, 613, 615, 599, + 616, 600, 617, 0, 619, 620, 601, 604, 602, 621, + 603, 622, 605, 623, 627, 606, 624, 608, 625, 609, + 610, 626, 628, 611, 613, 629, 615, 616, 630, 631, + 617, 619, 620, 632, 633, 634, 636, 621, 638, 622, + 639, 623, 627, 624, 640, 625, 641, 642, 626, 628, + + 643, 646, 629, 644, 645, 630, 631, 648, 649, 651, + 632, 652, 633, 634, 636, 653, 638, 654, 639, 656, + 657, 659, 640, 658, 641, 642, 660, 661, 643, 646, + 644, 645, 662, 663, 648, 649, 664, 651, 652, 666, + 667, 668, 653, 669, 654, 670, 672, 656, 657, 659, + 658, 671, 673, 660, 661, 674, 0, 677, 678, 662, + 679, 663, 680, 681, 664, 682, 666, 683, 667, 668, + 669, 684, 685, 670, 672, 686, 687, 688, 671, 673, + 689, 690, 692, 674, 677, 691, 678, 679, 693, 680, + 681, 694, 697, 682, 683, 698, 699, 700, 684, 685, + + 701, 706, 686, 687, 688, 703, 704, 689, 707, 690, + 692, 708, 691, 709, 710, 711, 693, 712, 694, 713, + 697, 714, 715, 698, 699, 700, 716, 717, 701, 706, + 718, 719, 703, 704, 720, 722, 707, 723, 724, 708, + 709, 710, 725, 711, 726, 712, 713, 727, 714, 715, + 728, 730, 732, 716, 733, 717, 734, 718, 719, 735, + 737, 738, 720, 722, 723, 724, 0, 0, 0, 725, + 0, 726, 0, 0, 727, 0, 0, 728, 730, 732, + 0, 733, 0, 734, 0, 0, 735, 737, 738, 743, + 743, 744, 744, 744, 744, 745, 0, 745, 746, 0, + + 746, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 742, 742 + } ; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +#line 1 "pddl+.lex" +#line 2 "pddl+.lex" + +#include + +#include + using std::cin; + using std::cout; + using std::cerr; + using std::istream; + using namespace VAL; +extern "C" int yywrap(); + +#line 1086 "lex.yy.cc" + +#define INITIAL 0 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ); +#endif + +#ifndef YY_NO_INPUT + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +#define ECHO LexerOutput( yytext, yyleng ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ +\ + if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) LexerError( msg ) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 +#define YY_DECL int yyFlexLexer::yylex() +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + if ( yyleng > 0 ) \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 27 "pddl+.lex" + +#line 1196 "lex.yy.cc" + + if ( !(yy_init) ) + { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! yyin ) + yyin = & std::cin; + + if ( ! yyout ) + yyout = & std::cout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE ); + } + + yy_load_buffer_state( ); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of yytext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); + yy_current_state += YY_AT_BOL(); +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 743 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 1802 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 28 "pddl+.lex" +{return OPEN_BRAC;} + YY_BREAK +case 2: +YY_RULE_SETUP +#line 29 "pddl+.lex" +{return CLOSE_BRAC;} + YY_BREAK +case 3: +YY_RULE_SETUP +#line 30 "pddl+.lex" +{return OPEN_SQ;} + YY_BREAK +case 4: +YY_RULE_SETUP +#line 31 "pddl+.lex" +{return CLOSE_SQ;} + YY_BREAK +case 5: +YY_RULE_SETUP +#line 32 "pddl+.lex" +{return REQS;} + YY_BREAK +case 6: +YY_RULE_SETUP +#line 33 "pddl+.lex" +{return EQUALITY;} + YY_BREAK +case 7: +YY_RULE_SETUP +#line 34 "pddl+.lex" +{return STRIPS;} + YY_BREAK +case 8: +YY_RULE_SETUP +#line 35 "pddl+.lex" +{return ADL;} + YY_BREAK +case 9: +YY_RULE_SETUP +#line 36 "pddl+.lex" +{return TYPING;} + YY_BREAK +case 10: +YY_RULE_SETUP +#line 37 "pddl+.lex" +{return DISJUNCTIVE_PRECONDS;} + YY_BREAK +case 11: +YY_RULE_SETUP +#line 38 "pddl+.lex" +{return EXT_PRECS;} + YY_BREAK +case 12: +YY_RULE_SETUP +#line 39 "pddl+.lex" +{return UNIV_PRECS;} + YY_BREAK +case 13: +YY_RULE_SETUP +#line 40 "pddl+.lex" +{return QUANT_PRECS;} + YY_BREAK +case 14: +YY_RULE_SETUP +#line 41 "pddl+.lex" +{return COND_EFFS;} + YY_BREAK +case 15: +YY_RULE_SETUP +#line 42 "pddl+.lex" +{return FLUENTS;} + YY_BREAK +case 16: +YY_RULE_SETUP +#line 43 "pddl+.lex" +{return NUMERICFLUENTS;} + YY_BREAK +case 17: +YY_RULE_SETUP +#line 44 "pddl+.lex" +{return OBJECTFLUENTS;} + YY_BREAK +case 18: +YY_RULE_SETUP +#line 45 "pddl+.lex" +{return ACTIONCOSTS;} + YY_BREAK +case 19: +YY_RULE_SETUP +#line 46 "pddl+.lex" +{return TIME;} + YY_BREAK +case 20: +YY_RULE_SETUP +#line 47 "pddl+.lex" +{return PREFERENCES;} + YY_BREAK +case 21: +YY_RULE_SETUP +#line 48 "pddl+.lex" +{return CONSTRAINTS;} + YY_BREAK +case 22: +YY_RULE_SETUP +#line 49 "pddl+.lex" +{return CONSTANTS;} + YY_BREAK +case 23: +YY_RULE_SETUP +#line 50 "pddl+.lex" +{return PREDS;} + YY_BREAK +case 24: +YY_RULE_SETUP +#line 51 "pddl+.lex" +{return FUNCTIONS;} + YY_BREAK +case 25: +YY_RULE_SETUP +#line 52 "pddl+.lex" +{return CLASSES;} + YY_BREAK +case 26: +YY_RULE_SETUP +#line 53 "pddl+.lex" +{return CLASS;} + YY_BREAK +case 27: +YY_RULE_SETUP +#line 54 "pddl+.lex" +{return TYPES;} + YY_BREAK +case 28: +YY_RULE_SETUP +#line 55 "pddl+.lex" +{return DURATIVE_ACTIONS;} + YY_BREAK +case 29: +YY_RULE_SETUP +#line 56 "pddl+.lex" +{return DURATION_INEQUALITIES;} + YY_BREAK +case 30: +YY_RULE_SETUP +#line 57 "pddl+.lex" +{return CONTINUOUS_EFFECTS;} + YY_BREAK +case 31: +YY_RULE_SETUP +#line 58 "pddl+.lex" +{return NEGATIVE_PRECONDITIONS;} + YY_BREAK +case 32: +YY_RULE_SETUP +#line 59 "pddl+.lex" +{return DERIVED_PREDICATES;} + YY_BREAK +case 33: +YY_RULE_SETUP +#line 60 "pddl+.lex" +{return TIMED_INITIAL_LITERALS;} + YY_BREAK +case 34: +YY_RULE_SETUP +#line 61 "pddl+.lex" +{return DEFINE;} + YY_BREAK +case 35: +YY_RULE_SETUP +#line 62 "pddl+.lex" +{return PDDLDOMAIN;} + YY_BREAK +case 36: +YY_RULE_SETUP +#line 63 "pddl+.lex" +{return ACTION;} + YY_BREAK +case 37: +YY_RULE_SETUP +#line 64 "pddl+.lex" +{return PROCESS;} + YY_BREAK +case 38: +YY_RULE_SETUP +#line 65 "pddl+.lex" +{return EVENT;} + YY_BREAK +case 39: +YY_RULE_SETUP +#line 66 "pddl+.lex" +{return DURATIVE_ACTION;} + YY_BREAK +case 40: +YY_RULE_SETUP +#line 67 "pddl+.lex" +{return DERIVED;} + YY_BREAK +case 41: +YY_RULE_SETUP +#line 68 "pddl+.lex" +{return ARGS;} + YY_BREAK +case 42: +YY_RULE_SETUP +#line 69 "pddl+.lex" +{return PRE;} + YY_BREAK +case 43: +YY_RULE_SETUP +#line 70 "pddl+.lex" +{return CONDITION;} + YY_BREAK +case 44: +YY_RULE_SETUP +#line 71 "pddl+.lex" +{return START_PRE;} + YY_BREAK +case 45: +YY_RULE_SETUP +#line 72 "pddl+.lex" +{return END_PRE;} + YY_BREAK +case 46: +YY_RULE_SETUP +#line 73 "pddl+.lex" +{return AT_START;} + YY_BREAK +case 47: +YY_RULE_SETUP +#line 74 "pddl+.lex" +{return AT_END;} + YY_BREAK +case 48: +YY_RULE_SETUP +#line 75 "pddl+.lex" +{return OVER_ALL;} + YY_BREAK +case 49: +YY_RULE_SETUP +#line 76 "pddl+.lex" +{return EFFECTS;} + YY_BREAK +case 50: +YY_RULE_SETUP +#line 77 "pddl+.lex" +{return INITIAL_EFFECT;} + YY_BREAK +case 51: +YY_RULE_SETUP +#line 78 "pddl+.lex" +{return FINAL_EFFECT;} + YY_BREAK +case 52: +YY_RULE_SETUP +#line 79 "pddl+.lex" +{return INVARIANT;} + YY_BREAK +case 53: +YY_RULE_SETUP +#line 80 "pddl+.lex" +{return DURATION;} + YY_BREAK +case 54: +YY_RULE_SETUP +#line 81 "pddl+.lex" +{return AND;} + YY_BREAK +case 55: +YY_RULE_SETUP +#line 82 "pddl+.lex" +{return OR;} + YY_BREAK +case 56: +YY_RULE_SETUP +#line 83 "pddl+.lex" +{return EXISTS;} + YY_BREAK +case 57: +YY_RULE_SETUP +#line 84 "pddl+.lex" +{return FORALL;} + YY_BREAK +case 58: +YY_RULE_SETUP +#line 85 "pddl+.lex" +{return IMPLY;} + YY_BREAK +case 59: +YY_RULE_SETUP +#line 86 "pddl+.lex" +{return NOT;} + YY_BREAK +case 60: +YY_RULE_SETUP +#line 87 "pddl+.lex" +{return WHEN;} + YY_BREAK +case 61: +YY_RULE_SETUP +#line 88 "pddl+.lex" +{return EITHER;} + YY_BREAK +case 62: +YY_RULE_SETUP +#line 89 "pddl+.lex" +{return PROBLEM;} + YY_BREAK +case 63: +YY_RULE_SETUP +#line 90 "pddl+.lex" +{return FORDOMAIN;} + YY_BREAK +case 64: +YY_RULE_SETUP +#line 91 "pddl+.lex" +{return OBJECTS;} + YY_BREAK +case 65: +YY_RULE_SETUP +#line 92 "pddl+.lex" +{return INITIALLY;} + YY_BREAK +case 66: +YY_RULE_SETUP +#line 93 "pddl+.lex" +{return GOALS;} + YY_BREAK +case 67: +YY_RULE_SETUP +#line 94 "pddl+.lex" +{return EQ;} + YY_BREAK +case 68: +YY_RULE_SETUP +#line 95 "pddl+.lex" +{return LENGTH;} + YY_BREAK +case 69: +YY_RULE_SETUP +#line 96 "pddl+.lex" +{return SERIAL;} + YY_BREAK +case 70: +YY_RULE_SETUP +#line 97 "pddl+.lex" +{return PARALLEL;} + YY_BREAK +case 71: +YY_RULE_SETUP +#line 98 "pddl+.lex" +{return METRIC;} + YY_BREAK +case 72: +YY_RULE_SETUP +#line 99 "pddl+.lex" +{return MINIMIZE;} + YY_BREAK +case 73: +YY_RULE_SETUP +#line 100 "pddl+.lex" +{return MAXIMIZE;} + YY_BREAK +case 74: +YY_RULE_SETUP +#line 101 "pddl+.lex" +{return ISVIOLATED;} + YY_BREAK +case 75: +YY_RULE_SETUP +#line 102 "pddl+.lex" +{return HASHT;} + YY_BREAK +case 76: +YY_RULE_SETUP +#line 103 "pddl+.lex" +{return DURATION_VAR;} + YY_BREAK +case 77: +YY_RULE_SETUP +#line 104 "pddl+.lex" +{return TOTAL_TIME;} + YY_BREAK +case 78: +YY_RULE_SETUP +#line 105 "pddl+.lex" +{return TIME;} + YY_BREAK +case 79: +YY_RULE_SETUP +#line 106 "pddl+.lex" +{return NUMBER;} + YY_BREAK +case 80: +YY_RULE_SETUP +#line 107 "pddl+.lex" +{return INCREASE;} + YY_BREAK +case 81: +YY_RULE_SETUP +#line 108 "pddl+.lex" +{return DECREASE;} + YY_BREAK +case 82: +YY_RULE_SETUP +#line 109 "pddl+.lex" +{return SCALE_UP;} + YY_BREAK +case 83: +YY_RULE_SETUP +#line 110 "pddl+.lex" +{return SCALE_DOWN;} + YY_BREAK +case 84: +YY_RULE_SETUP +#line 111 "pddl+.lex" +{return ASSIGN;} + YY_BREAK +case 85: +YY_RULE_SETUP +#line 112 "pddl+.lex" +{return PREFERENCE;} + YY_BREAK +case 86: +YY_RULE_SETUP +#line 113 "pddl+.lex" +{return ALWAYS;} + YY_BREAK +case 87: +YY_RULE_SETUP +#line 114 "pddl+.lex" +{return SOMETIME;} + YY_BREAK +case 88: +YY_RULE_SETUP +#line 115 "pddl+.lex" +{return WITHIN;} + YY_BREAK +case 89: +YY_RULE_SETUP +#line 116 "pddl+.lex" +{return ATMOSTONCE;} + YY_BREAK +case 90: +YY_RULE_SETUP +#line 117 "pddl+.lex" +{return SOMETIMEAFTER;} + YY_BREAK +case 91: +YY_RULE_SETUP +#line 118 "pddl+.lex" +{return SOMETIMEBEFORE;} + YY_BREAK +case 92: +YY_RULE_SETUP +#line 119 "pddl+.lex" +{return ALWAYSWITHIN;} + YY_BREAK +case 93: +YY_RULE_SETUP +#line 120 "pddl+.lex" +{return HOLDDURING;} + YY_BREAK +case 94: +YY_RULE_SETUP +#line 121 "pddl+.lex" +{return HOLDAFTER;} + YY_BREAK +case 95: +YY_RULE_SETUP +#line 122 "pddl+.lex" +{return PLUS;} + YY_BREAK +case 96: +YY_RULE_SETUP +#line 123 "pddl+.lex" +{return HYPHEN;} + YY_BREAK +case 97: +YY_RULE_SETUP +#line 124 "pddl+.lex" +{return MUL;} + YY_BREAK +case 98: +YY_RULE_SETUP +#line 125 "pddl+.lex" +{return DIV;} + YY_BREAK +case 99: +YY_RULE_SETUP +#line 126 "pddl+.lex" +{return GREATER;} + YY_BREAK +case 100: +YY_RULE_SETUP +#line 127 "pddl+.lex" +{return GREATEQ;} + YY_BREAK +case 101: +YY_RULE_SETUP +#line 128 "pddl+.lex" +{return LESS;} + YY_BREAK +case 102: +YY_RULE_SETUP +#line 129 "pddl+.lex" +{return LESSEQ;} + YY_BREAK +case 103: +YY_RULE_SETUP +#line 130 "pddl+.lex" +{return Q;} + YY_BREAK +case 104: +YY_RULE_SETUP +#line 131 "pddl+.lex" +{return COLON;} + YY_BREAK +case 105: +YY_RULE_SETUP +#line 132 "pddl+.lex" +{return DOT;} + YY_BREAK +case 106: +YY_RULE_SETUP +#line 133 "pddl+.lex" +{return MODULES;} + YY_BREAK +case 107: +YY_RULE_SETUP +#line 135 "pddl+.lex" +{unsigned int i; + for(i = 3;i < strlen(yytext);++i) + { + if(yytext[i] != '\t' && yytext[i] != ' ') break; + }; + yylval.fval = atof(yytext+i); + return (AT_TIME); + } + YY_BREAK +case 108: +YY_RULE_SETUP +#line 145 "pddl+.lex" +{unsigned int i; + yylval.cp = new char[strlen(yytext)+1]; + strcpy(yylval.cp,yytext); + for(i = 0;ifunc_tab.symbol_probe(yylval.cp) != NULL) + return FUNCTION_SYMBOL; + else + return NAME;} + YY_BREAK +case 109: +YY_RULE_SETUP +#line 158 "pddl+.lex" +; + YY_BREAK +case 110: +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 159 "pddl+.lex" +; + YY_BREAK +case 111: +/* rule 111 can match eol */ +YY_RULE_SETUP +#line 160 "pddl+.lex" +{line_no++;}; + YY_BREAK +case 112: +YY_RULE_SETUP +#line 162 "pddl+.lex" +{yylval.ival = atoi(yytext);return (INTVAL);} + YY_BREAK +case 113: +YY_RULE_SETUP +#line 163 "pddl+.lex" +{yylval.fval = atof(yytext);return (FLOATVAL);} + YY_BREAK +case 114: +YY_RULE_SETUP +#line 164 "pddl+.lex" +{printf("Illegal symbol: %s\n",yytext); exit(0); return 0;} + YY_BREAK +case 115: +YY_RULE_SETUP +#line 166 "pddl+.lex" +ECHO; + YY_BREAK +#line 1877 "lex.yy.cc" +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( yywrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ +} /* end of yylex */ + +/* The contents of this function are C++ specific, so the () macro is not used. + */ +yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout ) +{ + yyin = arg_yyin; + yyout = arg_yyout; + yy_c_buf_p = 0; + yy_init = 0; + yy_start = 0; + yy_flex_debug = 0; + yylineno = 1; // this will only get updated if %option yylineno + + yy_did_buffer_switch_on_eof = 0; + + yy_looking_for_trail_begin = 0; + yy_more_flag = 0; + yy_more_len = 0; + yy_more_offset = yy_prev_more_offset = 0; + + yy_start_stack_ptr = yy_start_stack_depth = 0; + yy_start_stack = NULL; + + yy_buffer_stack = 0; + yy_buffer_stack_top = 0; + yy_buffer_stack_max = 0; + + yy_state_buf = 0; + +} + +/* The contents of this function are C++ specific, so the () macro is not used. + */ +yyFlexLexer::~yyFlexLexer() +{ + delete [] yy_state_buf; + yyfree(yy_start_stack ); + yy_delete_buffer( YY_CURRENT_BUFFER ); + yyfree(yy_buffer_stack ); +} + +/* The contents of this function are C++ specific, so the () macro is not used. + */ +void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out ) +{ + if ( new_in ) + { + yy_delete_buffer( YY_CURRENT_BUFFER ); + yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) ); + } + + if ( new_out ) + yyout = new_out; +} + +#ifdef YY_INTERACTIVE +int yyFlexLexer::LexerInput( char* buf, int /* max_size */ ) +#else +int yyFlexLexer::LexerInput( char* buf, int max_size ) +#endif +{ + if ( yyin->eof() || yyin->fail() ) + return 0; + +#ifdef YY_INTERACTIVE + yyin->get( buf[0] ); + + if ( yyin->eof() ) + return 0; + + if ( yyin->bad() ) + return -1; + + return 1; + +#else + (void) yyin->read( buf, max_size ); + + if ( yyin->bad() ) + return -1; + else + return yyin->gcount(); +#endif +} + +void yyFlexLexer::LexerOutput( const char* buf, int size ) +{ + (void) yyout->write( buf, size ); +} + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +int yyFlexLexer::yy_get_next_buffer() +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), (size_t) num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + yy_state_type yyFlexLexer::yy_get_previous_state() +{ + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = (yy_start); + yy_current_state += YY_AT_BOL(); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 743 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) +{ + register int yy_is_jam; + register char *yy_cp = (yy_c_buf_p); + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 743 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 742); + + return yy_is_jam ? 0 : yy_current_state; +} + + void yyFlexLexer::yyunput( int c, register char* yy_bp) +{ + register char *yy_cp; + + yy_cp = (yy_c_buf_p); + + /* undo effects of setting up yytext */ + *yy_cp = (yy_hold_char); + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; +} + + int yyFlexLexer::yyinput() +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + int offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( ) ) + return EOF; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ + (yy_hold_char) = *++(yy_c_buf_p); + + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); + + return c; +} + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyFlexLexer::yyrestart( std::istream* input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE ); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; +} + + void yyFlexLexer::yy_load_buffer_state() +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size ) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * + */ + void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b ) +{ + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree((void *) b->yy_ch_buf ); + + yyfree((void *) b ); +} + +extern "C" int isatty (int ); + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file ) + +{ + int oerrno = errno; + + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b ) +{ + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer) +{ + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void yyFlexLexer::yypop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +void yyFlexLexer::yyensure_buffer_stack(void) +{ + int num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + + void yyFlexLexer::yy_push_state( int new_state ) +{ + if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) + { + yy_size_t new_size; + + (yy_start_stack_depth) += YY_START_STACK_INCR; + new_size = (yy_start_stack_depth) * sizeof( int ); + + if ( ! (yy_start_stack) ) + (yy_start_stack) = (int *) yyalloc(new_size ); + + else + (yy_start_stack) = (int *) yyrealloc((void *) (yy_start_stack),new_size ); + + if ( ! (yy_start_stack) ) + YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); + } + + (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; + + BEGIN(new_state); +} + + void yyFlexLexer::yy_pop_state() +{ + if ( --(yy_start_stack_ptr) < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); +} + + int yyFlexLexer::yy_top_state() +{ + return (yy_start_stack)[(yy_start_stack_ptr) - 1]; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +void yyFlexLexer::LexerError( yyconst char msg[] ) +{ + std::cerr << msg << std::endl; + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * s ) +{ + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size ) +{ + return (void *) malloc( size ); +} + +void *yyrealloc (void * ptr, yy_size_t size ) +{ + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); +} + +void yyfree (void * ptr ) +{ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 166 "pddl+.lex" + + + + +extern "C++" { + int yyFlexLexer::yywrap() +{ + return 1; +}; +}; + + diff --git a/src/pddl+.cpp b/src/pddl+.cpp new file mode 100644 index 0000000..3b998d9 --- /dev/null +++ b/src/pddl+.cpp @@ -0,0 +1,5256 @@ +/* A Bison parser, made by GNU Bison 2.4.3. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2009, 2010 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.4.3" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + + + +/* Copy the first part of user declarations. */ + +/* Line 189 of yacc.c */ +#line 17 "src/pddl+.yacc" + +/* +Error reporting: +Intention is to provide error token on most bracket expressions, +so synchronisation can occur on next CLOSE_BRAC. +Hence error should be generated for innermost expression containing error. +Expressions which cause errors return a NULL values, and parser +always attempts to carry on. +This won't behave so well if CLOSE_BRAC is missing. + +Naming conventions: +Generally, the names should be similar to the PDDL2.1 spec. +During development, they have also been based on older PDDL specs, +older PDDL+ and TIM parsers, and this shows in places. + +All the names of fields in the semantic value type begin with t_ +Corresponding categories in the grammar begin with c_ +Corresponding classes have no prefix. + +PDDL grammar yacc grammar type of corresponding semantic val. + +thing+ c_things thing_list +(thing+) c_thing_list thing_list + +*/ + +#include +#include +#include +#include + +// This is now copied locally to avoid relying on installation +// of flex++. + +//#include "FlexLexer.h" +//#include + +#include "ptree.h" +#include "parse_error.h" + +#define YYDEBUG 1 + +int yyerror(char *); + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", ((char *)msgid)) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) ((char *) msgid) +# endif +#endif + +extern int yylex(); + +using namespace VAL; + + + +/* Line 189 of yacc.c */ +#line 135 "src/pddl+.cpp" + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + OPEN_BRAC = 258, + CLOSE_BRAC = 259, + MODULES = 260, + OPEN_SQ = 261, + CLOSE_SQ = 262, + DOT = 263, + CLASSES = 264, + CLASS = 265, + DEFINE = 266, + PDDLDOMAIN = 267, + REQS = 268, + EQUALITY = 269, + STRIPS = 270, + ADL = 271, + NEGATIVE_PRECONDITIONS = 272, + TYPING = 273, + DISJUNCTIVE_PRECONDS = 274, + EXT_PRECS = 275, + UNIV_PRECS = 276, + QUANT_PRECS = 277, + COND_EFFS = 278, + FLUENTS = 279, + OBJECTFLUENTS = 280, + NUMERICFLUENTS = 281, + ACTIONCOSTS = 282, + TIME = 283, + DURATIVE_ACTIONS = 284, + DURATION_INEQUALITIES = 285, + CONTINUOUS_EFFECTS = 286, + DERIVED_PREDICATES = 287, + TIMED_INITIAL_LITERALS = 288, + PREFERENCES = 289, + CONSTRAINTS = 290, + ACTION = 291, + PROCESS = 292, + EVENT = 293, + DURATIVE_ACTION = 294, + DERIVED = 295, + CONSTANTS = 296, + PREDS = 297, + FUNCTIONS = 298, + TYPES = 299, + ARGS = 300, + PRE = 301, + CONDITION = 302, + PREFERENCE = 303, + START_PRE = 304, + END_PRE = 305, + EFFECTS = 306, + INITIAL_EFFECT = 307, + FINAL_EFFECT = 308, + INVARIANT = 309, + DURATION = 310, + AT_START = 311, + AT_END = 312, + OVER_ALL = 313, + AND = 314, + OR = 315, + EXISTS = 316, + FORALL = 317, + IMPLY = 318, + NOT = 319, + WHEN = 320, + WHENEVER = 321, + EITHER = 322, + PROBLEM = 323, + FORDOMAIN = 324, + INITIALLY = 325, + OBJECTS = 326, + GOALS = 327, + EQ = 328, + LENGTH = 329, + SERIAL = 330, + PARALLEL = 331, + METRIC = 332, + MINIMIZE = 333, + MAXIMIZE = 334, + HASHT = 335, + DURATION_VAR = 336, + TOTAL_TIME = 337, + INCREASE = 338, + DECREASE = 339, + SCALE_UP = 340, + SCALE_DOWN = 341, + ASSIGN = 342, + GREATER = 343, + GREATEQ = 344, + LESS = 345, + LESSEQ = 346, + Q = 347, + COLON = 348, + NUMBER = 349, + ALWAYS = 350, + SOMETIME = 351, + WITHIN = 352, + ATMOSTONCE = 353, + SOMETIMEAFTER = 354, + SOMETIMEBEFORE = 355, + ALWAYSWITHIN = 356, + HOLDDURING = 357, + HOLDAFTER = 358, + ISVIOLATED = 359, + BOGUS = 360, + NAME = 361, + FUNCTION_SYMBOL = 362, + INTVAL = 363, + FLOATVAL = 364, + AT_TIME = 365, + PLUS = 366, + HYPHEN = 367, + DIV = 368, + MUL = 369, + UMINUS = 370 + }; +#endif + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +{ + +/* Line 214 of yacc.c */ +#line 79 "src/pddl+.yacc" + + parse_category* t_parse_category; + + effect_lists* t_effect_lists; + effect* t_effect; + simple_effect* t_simple_effect; + cond_effect* t_cond_effect; + forall_effect* t_forall_effect; + timed_effect* t_timed_effect; + + quantifier t_quantifier; + metric_spec* t_metric; + optimization t_optimization; + + symbol* t_symbol; + var_symbol* t_var_symbol; + pddl_type* t_type; + pred_symbol* t_pred_symbol; + func_symbol* t_func_symbol; + const_symbol* t_const_symbol; + class_symbol* t_class; + + parameter_symbol_list* t_parameter_symbol_list; + var_symbol_list* t_var_symbol_list; + const_symbol_list* t_const_symbol_list; + pddl_type_list* t_type_list; + + proposition* t_proposition; + pred_decl* t_pred_decl; + pred_decl_list* t_pred_decl_list; + func_decl* t_func_decl; + func_decl_list* t_func_decl_list; + + goal* t_goal; + con_goal * t_con_goal; + goal_list* t_goal_list; + + func_term* t_func_term; + assignment* t_assignment; + expression* t_expression; + num_expression* t_num_expression; + assign_op t_assign_op; + comparison_op t_comparison_op; + + structure_def* t_structure_def; + structure_store* t_structure_store; + + action* t_action_def; + event* t_event_def; + process* t_process_def; + durative_action* t_durative_action_def; + derivation_rule* t_derivation_rule; + + problem* t_problem; + length_spec* t_length_spec; + + domain* t_domain; + + pddl_req_flag t_pddl_req_flag; + + plan* t_plan; + plan_step* t_step; + + int ival; + double fval; + + char* cp; + int t_dummy; + + var_symbol_table * vtab; + + class_def * t_class_def; + // classes_list* t_classes; + + + + +/* Line 214 of yacc.c */ +#line 364 "src/pddl+.cpp" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +#endif + + +/* Copy the second part of user declarations. */ + + +/* Line 264 of yacc.c */ +#line 376 "src/pddl+.cpp" + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int yyi) +#else +static int +YYID (yyi) + int yyi; +#endif +{ + return yyi; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 17 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 967 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 116 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 129 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 350 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 810 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 370 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 5, 7, 9, 15, 20, 23, 26, + 29, 32, 35, 38, 41, 43, 48, 50, 52, 57, + 60, 61, 66, 71, 74, 75, 78, 80, 85, 89, + 91, 93, 95, 97, 100, 101, 107, 111, 114, 115, + 117, 122, 127, 129, 133, 134, 139, 144, 146, 149, + 150, 153, 154, 159, 164, 166, 169, 173, 174, 176, + 178, 180, 182, 187, 189, 191, 194, 195, 198, 199, + 206, 209, 212, 215, 216, 221, 224, 227, 230, 231, + 233, 235, 237, 239, 241, 246, 248, 250, 252, 254, + 257, 260, 263, 264, 269, 274, 279, 287, 293, 299, + 301, 303, 306, 307, 312, 317, 323, 329, 333, 339, + 345, 349, 354, 362, 368, 370, 373, 374, 379, 381, + 383, 385, 387, 390, 393, 396, 397, 403, 409, 415, + 421, 427, 433, 439, 444, 447, 448, 450, 453, 455, + 457, 463, 469, 475, 481, 486, 493, 503, 513, 515, + 517, 519, 521, 524, 525, 530, 532, 537, 539, 547, + 553, 559, 565, 571, 577, 583, 588, 594, 600, 606, + 612, 614, 616, 622, 628, 630, 632, 634, 639, 644, + 646, 653, 658, 663, 665, 667, 669, 671, 673, 675, + 677, 682, 690, 694, 697, 702, 708, 713, 721, 723, + 728, 734, 739, 747, 750, 752, 757, 763, 765, 768, + 770, 775, 783, 788, 793, 798, 804, 809, 815, 821, + 828, 835, 841, 843, 848, 853, 858, 864, 872, 880, + 886, 889, 891, 894, 896, 898, 900, 905, 910, 915, + 920, 925, 930, 935, 940, 945, 950, 955, 958, 960, + 962, 964, 966, 968, 970, 972, 978, 980, 986, 999, + 1004, 1017, 1022, 1035, 1040, 1052, 1057, 1061, 1065, 1066, + 1068, 1073, 1076, 1077, 1082, 1087, 1092, 1098, 1103, 1105, + 1107, 1109, 1111, 1113, 1115, 1117, 1119, 1121, 1123, 1125, + 1127, 1129, 1131, 1133, 1135, 1137, 1139, 1141, 1143, 1145, + 1147, 1149, 1151, 1153, 1158, 1163, 1176, 1182, 1185, 1188, + 1191, 1194, 1197, 1200, 1203, 1204, 1209, 1214, 1216, 1221, + 1227, 1232, 1240, 1246, 1252, 1254, 1256, 1260, 1262, 1264, + 1266, 1271, 1275, 1279, 1283, 1287, 1291, 1293, 1296, 1298, + 1301, 1304, 1308, 1312, 1313, 1317, 1319, 1324, 1326, 1331, + 1333 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int16 yyrhs[] = +{ + 117, 0, -1, 118, -1, 227, -1, 240, -1, 3, + 11, 120, 119, 4, -1, 3, 11, 120, 1, -1, + 125, 119, -1, 226, 119, -1, 225, 119, -1, 206, + 119, -1, 207, 119, -1, 208, 119, -1, 123, 119, + -1, 210, -1, 3, 12, 106, 4, -1, 106, -1, + 106, -1, 3, 9, 124, 4, -1, 121, 124, -1, + -1, 3, 13, 126, 4, -1, 3, 13, 1, 4, + -1, 126, 224, -1, -1, 128, 127, -1, 128, -1, + 3, 129, 136, 4, -1, 3, 1, 4, -1, 106, + -1, 73, -1, 106, -1, 106, -1, 132, 133, -1, + -1, 3, 135, 136, 4, 134, -1, 3, 1, 4, + -1, 112, 94, -1, -1, 106, -1, 137, 112, 149, + 136, -1, 137, 112, 147, 136, -1, 137, -1, 92, + 143, 137, -1, -1, 140, 112, 149, 138, -1, 140, + 112, 147, 138, -1, 140, -1, 145, 139, -1, -1, + 146, 140, -1, -1, 150, 112, 149, 141, -1, 150, + 112, 147, 141, -1, 150, -1, 142, 145, -1, 142, + 92, 144, -1, -1, 106, -1, 106, -1, 106, -1, + 106, -1, 3, 67, 151, 4, -1, 106, -1, 106, + -1, 150, 148, -1, -1, 151, 149, -1, -1, 152, + 3, 73, 188, 187, 4, -1, 152, 181, -1, 152, + 180, -1, 152, 153, -1, -1, 3, 110, 152, 4, + -1, 156, 154, -1, 183, 154, -1, 182, 154, -1, + -1, 159, -1, 179, -1, 178, -1, 183, -1, 182, + -1, 3, 59, 158, 4, -1, 157, -1, 178, -1, + 179, -1, 184, -1, 158, 178, -1, 158, 179, -1, + 158, 184, -1, -1, 3, 59, 154, 4, -1, 3, + 59, 1, 4, -1, 3, 59, 161, 4, -1, 3, + 201, 3, 136, 4, 160, 4, -1, 3, 65, 220, + 160, 4, -1, 3, 66, 198, 164, 4, -1, 162, + -1, 184, -1, 161, 160, -1, -1, 3, 56, 166, + 4, -1, 3, 57, 166, 4, -1, 3, 83, 188, + 186, 4, -1, 3, 84, 188, 186, 4, -1, 3, + 1, 4, -1, 3, 83, 188, 186, 4, -1, 3, + 84, 188, 186, 4, -1, 3, 1, 4, -1, 3, + 59, 165, 4, -1, 3, 201, 3, 136, 4, 164, + 4, -1, 3, 66, 198, 164, 4, -1, 163, -1, + 165, 164, -1, -1, 3, 59, 168, 4, -1, 167, + -1, 178, -1, 179, -1, 169, -1, 168, 178, -1, + 168, 179, -1, 168, 169, -1, -1, 3, 87, 188, + 172, 4, -1, 3, 83, 188, 172, 4, -1, 3, + 84, 188, 172, 4, -1, 3, 85, 188, 172, 4, + -1, 3, 86, 188, 172, 4, -1, 3, 83, 188, + 186, 4, -1, 3, 84, 188, 186, 4, -1, 3, + 59, 171, 4, -1, 171, 170, -1, -1, 173, -1, + 92, 81, -1, 187, -1, 188, -1, 3, 111, 172, + 172, 4, -1, 3, 112, 172, 172, 4, -1, 3, + 114, 172, 172, 4, -1, 3, 113, 172, 172, 4, + -1, 3, 59, 177, 4, -1, 3, 175, 92, 81, + 176, 4, -1, 3, 56, 3, 175, 92, 81, 176, + 4, 4, -1, 3, 57, 3, 175, 92, 81, 176, + 4, 4, -1, 91, -1, 89, -1, 73, -1, 185, + -1, 177, 174, -1, -1, 3, 64, 203, 4, -1, + 203, -1, 3, 64, 205, 4, -1, 205, -1, 3, + 201, 3, 136, 4, 155, 4, -1, 3, 65, 198, + 154, 4, -1, 3, 87, 188, 185, 4, -1, 3, + 83, 188, 185, 4, -1, 3, 84, 188, 185, 4, + -1, 3, 85, 188, 185, 4, -1, 3, 86, 188, + 185, 4, -1, 3, 112, 185, 4, -1, 3, 111, + 185, 185, 4, -1, 3, 112, 185, 185, 4, -1, + 3, 114, 185, 185, 4, -1, 3, 113, 185, 185, + 4, -1, 187, -1, 188, -1, 3, 114, 80, 185, + 4, -1, 3, 114, 185, 80, 4, -1, 80, -1, + 108, -1, 109, -1, 3, 107, 142, 4, -1, 3, + 106, 142, 4, -1, 107, -1, 3, 122, 8, 107, + 142, 4, -1, 3, 107, 142, 4, -1, 3, 106, + 142, 4, -1, 107, -1, 88, -1, 89, -1, 90, + -1, 91, -1, 73, -1, 195, -1, 3, 59, 199, + 4, -1, 3, 201, 3, 136, 4, 191, 4, -1, + 3, 59, 4, -1, 3, 4, -1, 3, 48, 197, + 4, -1, 3, 48, 106, 197, 4, -1, 3, 59, + 194, 4, -1, 3, 201, 3, 136, 4, 193, 4, + -1, 197, -1, 3, 48, 197, 4, -1, 3, 48, + 106, 197, 4, -1, 3, 59, 194, 4, -1, 3, + 201, 3, 136, 4, 193, 4, -1, 194, 192, -1, + 192, -1, 3, 48, 198, 4, -1, 3, 48, 106, + 198, 4, -1, 198, -1, 196, 197, -1, 197, -1, + 3, 59, 196, 4, -1, 3, 201, 3, 136, 4, + 197, 4, -1, 3, 57, 198, 4, -1, 3, 95, + 198, 4, -1, 3, 96, 198, 4, -1, 3, 97, + 187, 198, 4, -1, 3, 98, 198, 4, -1, 3, + 99, 198, 198, 4, -1, 3, 100, 198, 198, 4, + -1, 3, 101, 187, 198, 198, 4, -1, 3, 102, + 187, 187, 198, 4, -1, 3, 103, 187, 198, 4, + -1, 203, -1, 3, 64, 198, 4, -1, 3, 59, + 200, 4, -1, 3, 60, 200, 4, -1, 3, 63, + 198, 198, 4, -1, 3, 201, 3, 136, 4, 198, + 4, -1, 3, 202, 3, 136, 4, 198, 4, -1, + 3, 190, 185, 185, 4, -1, 199, 191, -1, 191, + -1, 200, 198, -1, 198, -1, 62, -1, 61, -1, + 3, 130, 142, 4, -1, 3, 130, 136, 4, -1, + 3, 131, 142, 4, -1, 3, 42, 127, 4, -1, + 3, 42, 1, 4, -1, 3, 43, 132, 4, -1, + 3, 43, 1, 4, -1, 3, 35, 197, 4, -1, + 3, 35, 1, 4, -1, 3, 35, 192, 4, -1, + 3, 35, 1, 4, -1, 210, 211, -1, 211, -1, + 215, -1, 216, -1, 217, -1, 218, -1, 214, -1, + 212, -1, 3, 10, 122, 207, 4, -1, 40, -1, + 3, 213, 204, 198, 4, -1, 3, 36, 106, 223, + 3, 136, 4, 46, 191, 51, 155, 4, -1, 3, + 36, 1, 4, -1, 3, 38, 106, 223, 3, 136, + 4, 46, 198, 51, 155, 4, -1, 3, 38, 1, + 4, -1, 3, 37, 106, 223, 3, 136, 4, 46, + 198, 51, 170, 4, -1, 3, 37, 1, 4, -1, + 3, 39, 106, 223, 3, 136, 4, 55, 174, 219, + 4, -1, 3, 39, 1, 4, -1, 219, 51, 160, + -1, 219, 47, 220, -1, -1, 222, -1, 3, 59, + 221, 4, -1, 221, 220, -1, -1, 3, 56, 198, + 4, -1, 3, 57, 198, 4, -1, 3, 58, 198, + 4, -1, 3, 48, 106, 222, 4, -1, 3, 48, + 222, 4, -1, 45, -1, 14, -1, 15, -1, 18, + -1, 17, -1, 19, -1, 20, -1, 21, -1, 23, + -1, 24, -1, 29, -1, 28, -1, 27, -1, 25, + -1, 26, -1, 5, -1, 16, -1, 22, -1, 30, + -1, 31, -1, 32, -1, 33, -1, 34, -1, 35, + -1, 106, -1, 3, 41, 138, 4, -1, 3, 44, + 141, 4, -1, 3, 11, 3, 68, 106, 4, 3, + 69, 106, 4, 228, 4, -1, 3, 11, 3, 68, + 1, -1, 125, 228, -1, 229, 228, -1, 230, 228, + -1, 232, 228, -1, 209, 228, -1, 233, 228, -1, + 234, 228, -1, -1, 3, 71, 138, 4, -1, 3, + 70, 152, 4, -1, 72, -1, 3, 231, 191, 4, + -1, 3, 77, 235, 236, 4, -1, 3, 77, 1, + 4, -1, 3, 74, 75, 108, 76, 108, 4, -1, + 3, 74, 75, 108, 4, -1, 3, 74, 76, 108, + 4, -1, 78, -1, 79, -1, 3, 237, 4, -1, + 189, -1, 187, -1, 82, -1, 3, 104, 106, 4, + -1, 3, 82, 4, -1, 111, 236, 238, -1, 112, + 236, 236, -1, 114, 236, 239, -1, 113, 236, 236, + -1, 236, -1, 236, 238, -1, 236, -1, 236, 239, + -1, 241, 240, -1, 28, 109, 240, -1, 28, 108, + 240, -1, -1, 244, 93, 242, -1, 242, -1, 243, + 6, 244, 7, -1, 243, -1, 3, 106, 139, 4, + -1, 109, -1, 108, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 260, 260, 261, 262, 266, 272, 279, 280, 281, + 282, 284, 286, 288, 289, 292, 296, 299, 301, 303, + 304, 308, 315, 322, 323, 328, 330, 335, 337, 345, + 353, 355, 363, 368, 370, 374, 376, 383, 383, 386, + 399, 408, 417, 429, 431, 437, 446, 456, 461, 462, + 466, 467, 475, 482, 491, 497, 499, 501, 508, 514, + 518, 522, 526, 531, 538, 543, 545, 549, 551, 555, + 568, 570, 572, 575, 579, 585, 586, 588, 590, 599, + 600, 601, 602, 603, 607, 608, 612, 614, 616, 623, + 624, 625, 627, 631, 633, 641, 643, 651, 656, 661, + 664, 671, 672, 676, 678, 680, 684, 688, 694, 698, + 702, 708, 710, 718, 723, 729, 730, 734, 735, 739, + 741, 743, 750, 751, 752, 754, 759, 761, 763, 765, + 767, 772, 778, 784, 789, 790, 794, 795, 797, 798, + 802, 804, 806, 808, 813, 815, 818, 821, 827, 828, + 829, 837, 841, 844, 848, 853, 860, 865, 870, 875, + 880, 882, 884, 886, 888, 893, 895, 897, 899, 901, + 903, 904, 908, 910, 912, 918, 919, 922, 925, 927, + 930, 947, 949, 951, 957, 958, 959, 960, 961, 973, + 980, 982, 986, 987, 991, 993, 995, 997, 1001, 1006, + 1008, 1010, 1012, 1019, 1021, 1026, 1028, 1032, 1037, 1039, + 1044, 1046, 1049, 1051, 1053, 1055, 1057, 1059, 1061, 1063, + 1065, 1067, 1072, 1074, 1078, 1080, 1083, 1086, 1089, 1092, + 1098, 1100, 1105, 1107, 1117, 1124, 1131, 1136, 1141, 1146, + 1148, 1155, 1157, 1164, 1166, 1173, 1175, 1182, 1183, 1187, + 1188, 1189, 1190, 1191, 1192, 1195, 1204, 1210, 1219, 1230, + 1237, 1248, 1254, 1264, 1270, 1285, 1292, 1294, 1296, 1300, + 1302, 1307, 1310, 1314, 1316, 1318, 1320, 1325, 1330, 1335, + 1336, 1338, 1339, 1341, 1343, 1344, 1345, 1346, 1347, 1349, + 1352, 1355, 1356, 1357, 1359, 1368, 1371, 1374, 1376, 1378, + 1380, 1382, 1384, 1390, 1394, 1399, 1411, 1418, 1419, 1420, + 1421, 1422, 1424, 1426, 1427, 1430, 1433, 1436, 1439, 1443, + 1445, 1452, 1455, 1459, 1466, 1467, 1472, 1473, 1474, 1475, + 1476, 1478, 1482, 1483, 1484, 1485, 1489, 1490, 1495, 1496, + 1502, 1505, 1507, 1510, 1514, 1518, 1524, 1528, 1534, 1542, + 1543 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "OPEN_BRAC", "CLOSE_BRAC", "MODULES", + "OPEN_SQ", "CLOSE_SQ", "DOT", "CLASSES", "CLASS", "DEFINE", "PDDLDOMAIN", + "REQS", "EQUALITY", "STRIPS", "ADL", "NEGATIVE_PRECONDITIONS", "TYPING", + "DISJUNCTIVE_PRECONDS", "EXT_PRECS", "UNIV_PRECS", "QUANT_PRECS", + "COND_EFFS", "FLUENTS", "OBJECTFLUENTS", "NUMERICFLUENTS", "ACTIONCOSTS", + "TIME", "DURATIVE_ACTIONS", "DURATION_INEQUALITIES", + "CONTINUOUS_EFFECTS", "DERIVED_PREDICATES", "TIMED_INITIAL_LITERALS", + "PREFERENCES", "CONSTRAINTS", "ACTION", "PROCESS", "EVENT", + "DURATIVE_ACTION", "DERIVED", "CONSTANTS", "PREDS", "FUNCTIONS", "TYPES", + "ARGS", "PRE", "CONDITION", "PREFERENCE", "START_PRE", "END_PRE", + "EFFECTS", "INITIAL_EFFECT", "FINAL_EFFECT", "INVARIANT", "DURATION", + "AT_START", "AT_END", "OVER_ALL", "AND", "OR", "EXISTS", "FORALL", + "IMPLY", "NOT", "WHEN", "WHENEVER", "EITHER", "PROBLEM", "FORDOMAIN", + "INITIALLY", "OBJECTS", "GOALS", "EQ", "LENGTH", "SERIAL", "PARALLEL", + "METRIC", "MINIMIZE", "MAXIMIZE", "HASHT", "DURATION_VAR", "TOTAL_TIME", + "INCREASE", "DECREASE", "SCALE_UP", "SCALE_DOWN", "ASSIGN", "GREATER", + "GREATEQ", "LESS", "LESSEQ", "Q", "COLON", "NUMBER", "ALWAYS", + "SOMETIME", "WITHIN", "ATMOSTONCE", "SOMETIMEAFTER", "SOMETIMEBEFORE", + "ALWAYSWITHIN", "HOLDDURING", "HOLDAFTER", "ISVIOLATED", "BOGUS", "NAME", + "FUNCTION_SYMBOL", "INTVAL", "FLOATVAL", "AT_TIME", "PLUS", "HYPHEN", + "DIV", "MUL", "UMINUS", "$accept", "mystartsymbol", "c_domain", + "c_preamble", "c_domain_name", "c_new_class", "c_class", "c_classes", + "c_class_seq", "c_domain_require_def", "c_reqs", "c_pred_decls", + "c_pred_decl", "c_new_pred_symbol", "c_pred_symbol", + "c_init_pred_symbol", "c_func_decls", "c_func_decl", "c_ntype", + "c_new_func_symbol", "c_typed_var_list", "c_var_symbol_list", + "c_typed_consts", "c_const_symbols", "c_new_const_symbols", + "c_typed_types", "c_parameter_symbols", "c_declaration_var_symbol", + "c_var_symbol", "c_const_symbol", "c_new_const_symbol", "c_either_type", + "c_new_primitive_type", "c_primitive_type", "c_new_primitive_types", + "c_primitive_types", "c_init_els", "c_timed_initial_literal", + "c_effects", "c_effect", "c_a_effect", "c_p_effect", "c_p_effects", + "c_conj_effect", "c_da_effect", "c_da_effects", "c_timed_effect", + "c_cts_only_timed_effect", "c_da_cts_only_effect", + "c_da_cts_only_effects", "c_a_effect_da", "c_p_effect_da", + "c_p_effects_da", "c_f_assign_da", "c_proc_effect", "c_proc_effects", + "c_f_exp_da", "c_binary_expr_da", "c_duration_constraint", "c_d_op", + "c_d_value", "c_duration_constraints", "c_neg_simple_effect", + "c_pos_simple_effect", "c_init_neg_simple_effect", + "c_init_pos_simple_effect", "c_forall_effect", "c_cond_effect", + "c_assignment", "c_f_exp", "c_f_exp_t", "c_number", "c_f_head", + "c_ground_f_head", "c_comparison_op", "c_pre_goal_descriptor", + "c_pref_con_goal", "c_pref_goal", "c_pref_con_goal_list", + "c_pref_goal_descriptor", "c_constraint_goal_list", "c_constraint_goal", + "c_goal_descriptor", "c_pre_goal_descriptor_list", "c_goal_list", + "c_forall", "c_exists", "c_proposition", "c_derived_proposition", + "c_init_proposition", "c_predicates", "c_functions_def", + "c_constraints_def", "c_constraints_probdef", "c_structure_defs", + "c_structure_def", "c_class_def", "c_rule_head", "c_derivation_rule", + "c_action_def", "c_event_def", "c_process_def", "c_durative_action_def", + "c_da_def_body", "c_da_gd", "c_da_gds", "c_timed_gd", "c_args_head", + "c_require_key", "c_domain_constants", "c_type_names", "c_problem", + "c_problem_body", "c_objects", "c_initial_state", "c_goals", + "c_goal_spec", "c_metric_spec", "c_length_spec", "c_optimization", + "c_ground_f_exp", "c_binary_ground_f_exp", "c_binary_ground_f_pexps", + "c_binary_ground_f_mexps", "c_plan", "c_step_t_d", "c_step_d", "c_step", + "c_float", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 116, 117, 117, 117, 118, 118, 119, 119, 119, + 119, 119, 119, 119, 119, 120, 121, 122, 123, 124, + 124, 125, 125, 126, 126, 127, 127, 128, 128, 129, + 130, 130, 131, 132, 132, 133, 133, 134, 134, 135, + 136, 136, 136, 137, 137, 138, 138, 138, 139, 139, + 140, 140, 141, 141, 141, 142, 142, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 150, 151, 151, 152, + 152, 152, 152, 152, 153, 154, 154, 154, 154, 155, + 155, 155, 155, 155, 156, 156, 157, 157, 157, 158, + 158, 158, 158, 159, 159, 160, 160, 160, 160, 160, + 160, 161, 161, 162, 162, 162, 162, 162, 163, 163, + 163, 164, 164, 164, 164, 165, 165, 166, 166, 167, + 167, 167, 168, 168, 168, 168, 169, 169, 169, 169, + 169, 170, 170, 170, 171, 171, 172, 172, 172, 172, + 173, 173, 173, 173, 174, 174, 174, 174, 175, 175, + 175, 176, 177, 177, 178, 179, 180, 181, 182, 183, + 184, 184, 184, 184, 184, 185, 185, 185, 185, 185, + 185, 185, 186, 186, 186, 187, 187, 188, 188, 188, + 188, 189, 189, 189, 190, 190, 190, 190, 190, 191, + 191, 191, 191, 191, 192, 192, 192, 192, 192, 193, + 193, 193, 193, 194, 194, 195, 195, 195, 196, 196, + 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, + 197, 197, 198, 198, 198, 198, 198, 198, 198, 198, + 199, 199, 200, 200, 201, 202, 203, 204, 205, 206, + 206, 207, 207, 208, 208, 209, 209, 210, 210, 211, + 211, 211, 211, 211, 211, 212, 213, 214, 215, 215, + 216, 216, 217, 217, 218, 218, 219, 219, 219, 220, + 220, 221, 221, 222, 222, 222, 222, 222, 223, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 225, 226, 227, 227, 228, 228, 228, + 228, 228, 228, 228, 228, 229, 230, 231, 232, 233, + 233, 234, 234, 234, 235, 235, 236, 236, 236, 236, + 236, 236, 237, 237, 237, 237, 238, 238, 239, 239, + 240, 240, 240, 240, 241, 241, 242, 242, 243, 244, + 244 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 1, 1, 1, 5, 4, 2, 2, 2, + 2, 2, 2, 2, 1, 4, 1, 1, 4, 2, + 0, 4, 4, 2, 0, 2, 1, 4, 3, 1, + 1, 1, 1, 2, 0, 5, 3, 2, 0, 1, + 4, 4, 1, 3, 0, 4, 4, 1, 2, 0, + 2, 0, 4, 4, 1, 2, 3, 0, 1, 1, + 1, 1, 4, 1, 1, 2, 0, 2, 0, 6, + 2, 2, 2, 0, 4, 2, 2, 2, 0, 1, + 1, 1, 1, 1, 4, 1, 1, 1, 1, 2, + 2, 2, 0, 4, 4, 4, 7, 5, 5, 1, + 1, 2, 0, 4, 4, 5, 5, 3, 5, 5, + 3, 4, 7, 5, 1, 2, 0, 4, 1, 1, + 1, 1, 2, 2, 2, 0, 5, 5, 5, 5, + 5, 5, 5, 4, 2, 0, 1, 2, 1, 1, + 5, 5, 5, 5, 4, 6, 9, 9, 1, 1, + 1, 1, 2, 0, 4, 1, 4, 1, 7, 5, + 5, 5, 5, 5, 5, 4, 5, 5, 5, 5, + 1, 1, 5, 5, 1, 1, 1, 4, 4, 1, + 6, 4, 4, 1, 1, 1, 1, 1, 1, 1, + 4, 7, 3, 2, 4, 5, 4, 7, 1, 4, + 5, 4, 7, 2, 1, 4, 5, 1, 2, 1, + 4, 7, 4, 4, 4, 5, 4, 5, 5, 6, + 6, 5, 1, 4, 4, 4, 5, 7, 7, 5, + 2, 1, 2, 1, 1, 1, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 2, 1, 1, + 1, 1, 1, 1, 1, 5, 1, 5, 12, 4, + 12, 4, 12, 4, 11, 4, 3, 3, 0, 1, + 4, 2, 0, 4, 4, 4, 5, 4, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 4, 4, 12, 5, 2, 2, 2, + 2, 2, 2, 2, 0, 4, 4, 1, 4, 5, + 4, 7, 5, 5, 1, 1, 3, 1, 1, 1, + 4, 3, 3, 3, 3, 3, 1, 2, 1, 2, + 2, 3, 3, 0, 3, 1, 4, 1, 4, 1, + 1 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint16 yydefact[] = +{ + 343, 0, 0, 350, 349, 0, 2, 3, 4, 343, + 345, 347, 0, 0, 49, 343, 343, 1, 0, 340, + 0, 0, 0, 0, 60, 0, 49, 342, 341, 0, + 344, 0, 0, 6, 0, 0, 0, 0, 0, 0, + 0, 14, 248, 254, 253, 249, 250, 251, 252, 0, + 0, 348, 48, 346, 0, 306, 0, 20, 0, 0, + 0, 0, 0, 0, 0, 256, 51, 0, 0, 66, + 0, 5, 13, 7, 10, 11, 12, 0, 247, 9, + 8, 15, 0, 16, 20, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 61, 0, 47, 51, 0, 0, 0, 26, 0, + 0, 0, 54, 0, 0, 0, 19, 18, 0, 0, + 22, 21, 293, 279, 280, 294, 282, 281, 283, 284, + 285, 295, 286, 287, 291, 292, 290, 289, 288, 296, + 297, 298, 299, 300, 301, 302, 23, 244, 0, 0, + 234, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 243, 259, 278, 0, 263, 0, 261, 0, 265, + 0, 303, 0, 50, 240, 0, 29, 44, 239, 25, + 242, 0, 241, 33, 304, 63, 0, 65, 30, 31, + 44, 0, 0, 222, 0, 255, 0, 0, 209, 0, + 0, 175, 176, 0, 0, 0, 0, 0, 0, 0, + 44, 44, 44, 44, 44, 0, 64, 51, 51, 28, + 0, 0, 42, 0, 39, 44, 66, 66, 0, 0, + 0, 235, 0, 0, 188, 184, 185, 186, 187, 57, + 0, 0, 0, 257, 0, 212, 210, 208, 213, 214, + 0, 216, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 68, 46, 45, 58, 44, 27, 0, 36, + 0, 53, 52, 237, 233, 0, 0, 0, 0, 0, + 0, 179, 0, 170, 171, 44, 44, 314, 215, 217, + 218, 0, 0, 221, 0, 0, 0, 0, 0, 0, + 43, 44, 44, 38, 224, 232, 225, 0, 223, 236, + 0, 55, 57, 57, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 314, 314, 0, 314, 314, 314, 314, + 314, 219, 220, 0, 0, 0, 0, 0, 62, 67, + 41, 40, 0, 35, 226, 59, 56, 0, 0, 0, + 0, 0, 0, 0, 229, 0, 0, 0, 73, 51, + 317, 0, 0, 0, 307, 311, 305, 308, 309, 310, + 312, 313, 211, 0, 0, 189, 207, 0, 0, 0, + 268, 37, 178, 177, 0, 165, 0, 0, 0, 57, + 0, 0, 0, 0, 0, 198, 0, 0, 0, 0, + 0, 324, 325, 0, 0, 193, 0, 0, 0, 0, + 0, 0, 0, 0, 153, 150, 149, 148, 0, 0, + 166, 167, 169, 168, 0, 227, 228, 246, 0, 0, + 0, 245, 0, 316, 72, 71, 70, 157, 315, 0, + 0, 320, 0, 329, 183, 328, 327, 0, 318, 0, + 0, 192, 231, 207, 0, 44, 0, 0, 79, 81, + 80, 83, 82, 155, 0, 0, 0, 0, 0, 0, + 0, 264, 0, 0, 180, 0, 0, 204, 0, 198, + 44, 0, 0, 32, 73, 57, 322, 0, 323, 0, + 0, 57, 57, 0, 0, 0, 0, 0, 319, 0, + 205, 190, 230, 0, 0, 0, 0, 0, 258, 135, + 0, 0, 262, 260, 0, 0, 144, 152, 0, 0, + 267, 269, 0, 266, 99, 100, 0, 194, 196, 203, + 0, 0, 0, 0, 0, 0, 0, 0, 331, 0, + 0, 0, 0, 0, 0, 0, 326, 206, 0, 0, + 0, 0, 78, 85, 86, 87, 78, 78, 88, 0, + 0, 78, 44, 0, 0, 0, 0, 0, 0, 151, + 0, 0, 0, 0, 272, 0, 0, 0, 102, 0, + 0, 0, 0, 0, 0, 0, 0, 195, 0, 156, + 0, 74, 238, 321, 330, 182, 181, 336, 332, 333, + 335, 338, 334, 0, 0, 94, 92, 0, 0, 93, + 75, 77, 76, 154, 0, 0, 133, 134, 0, 174, + 0, 0, 0, 0, 145, 0, 0, 0, 0, 0, + 0, 0, 107, 0, 0, 118, 121, 119, 120, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, + 0, 69, 337, 339, 191, 0, 0, 0, 159, 0, + 0, 131, 132, 0, 0, 0, 277, 273, 274, 275, + 270, 271, 125, 0, 0, 0, 0, 0, 103, 104, + 95, 101, 0, 0, 114, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 197, 0, + 84, 89, 90, 91, 0, 0, 0, 0, 0, 276, + 0, 0, 0, 0, 0, 0, 97, 0, 116, 0, + 0, 0, 0, 98, 0, 161, 105, 162, 106, 163, + 164, 160, 0, 0, 0, 0, 44, 158, 0, 0, + 146, 147, 0, 117, 124, 122, 123, 0, 0, 0, + 136, 138, 139, 0, 0, 0, 0, 110, 0, 0, + 0, 0, 44, 0, 0, 0, 199, 201, 0, 172, + 173, 0, 0, 0, 0, 137, 127, 128, 129, 130, + 126, 111, 115, 0, 0, 0, 0, 96, 200, 0, + 0, 0, 0, 0, 113, 108, 109, 0, 0, 0, + 0, 0, 0, 0, 202, 140, 141, 143, 142, 112 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 5, 6, 35, 23, 84, 318, 36, 85, 37, + 89, 107, 108, 177, 239, 485, 110, 183, 343, 225, + 221, 222, 102, 25, 103, 111, 279, 266, 346, 311, + 104, 217, 187, 218, 112, 299, 396, 434, 551, 457, + 552, 553, 655, 458, 523, 640, 524, 684, 685, 758, + 634, 635, 710, 636, 465, 563, 749, 750, 380, 418, + 568, 469, 554, 555, 435, 436, 556, 557, 558, 569, + 620, 283, 284, 446, 240, 374, 477, 650, 478, 375, + 197, 333, 376, 454, 275, 507, 242, 193, 114, 437, + 38, 39, 40, 324, 41, 42, 43, 70, 44, 45, + 46, 47, 48, 419, 520, 631, 521, 164, 146, 49, + 50, 7, 325, 326, 327, 363, 328, 329, 330, 403, + 597, 497, 598, 602, 8, 9, 10, 11, 12 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -688 +static const yytype_int16 yypact[] = +{ + 48, 63, 121, -688, -688, 38, -688, -688, -688, 176, + -688, 62, -20, 80, -21, 176, 176, -688, -14, -688, + 131, 251, 11, 57, -688, 231, -21, -688, -688, 261, + -688, 177, 8, -688, 720, 268, 286, 286, 286, 286, + 286, 290, -688, -688, -688, -688, -688, -688, -688, 286, + 286, -688, -688, -688, 294, -688, 299, 203, 206, 495, + 274, 20, 25, 56, 79, -688, 209, 329, 369, -688, + 320, -688, -688, -688, -688, -688, -688, 702, -688, -688, + -688, -688, 324, -688, 203, 330, -688, 336, 341, 628, + 363, 624, 376, 398, 366, 409, 366, 412, 366, 416, + 366, -688, 474, 354, 209, 484, 104, 486, 504, 494, + 244, 527, -37, -25, 532, 469, -688, -688, 497, 539, + -688, -688, -688, -688, -688, -688, -688, -688, -688, -688, + -688, -688, -688, -688, -688, -688, -688, -688, -688, -688, + -688, -688, -688, -688, -688, -688, -688, -688, 532, 542, + -688, 532, 532, 153, 532, 532, 532, 153, 153, 153, + 570, -688, -688, -688, 572, -688, 576, -688, 579, -688, + 592, -688, 19, -688, -688, 599, -688, 514, -688, -688, + -688, 108, -688, -688, -688, -688, 19, -688, -688, -688, + 514, 508, 604, -688, 507, -688, 611, 371, -688, 614, + 623, -688, -688, 532, 633, 532, 532, 532, 153, 532, + 514, 514, 514, 514, 514, 567, -688, 209, 209, -688, + 560, 668, 556, 670, -688, 514, -688, -688, 673, 532, + 532, -688, 532, 532, 135, -688, -688, -688, -688, -688, + 75, 679, 681, -688, 683, -688, -688, -688, -688, -688, + 689, -688, 696, 727, 532, 532, 728, 731, 739, 742, + 748, 749, -688, -688, -688, -688, 514, -688, 19, -688, + 750, -688, -688, -688, -688, 381, 396, 532, 767, 136, + 517, -688, 75, -688, -688, 514, 514, 769, -688, -688, + -688, 770, 773, -688, 542, 740, 741, 747, 718, 86, + -688, 514, 514, 676, -688, -688, -688, 790, -688, -688, + 690, -688, 787, -688, 75, 75, 75, 75, 789, 794, + 795, 796, 462, 769, 769, 797, 769, 769, 769, 769, + 769, -688, -688, 798, 800, 532, 532, 801, -688, -688, + -688, -688, 711, -688, -688, -688, -688, 199, 207, 75, + 59, 75, 75, 699, -688, 532, 532, 353, -688, 209, + -688, 332, 195, 800, -688, -688, -688, -688, -688, -688, + -688, -688, -688, 298, 756, -688, -688, 757, 758, 485, + -688, -688, -688, -688, 806, -688, 807, 808, 809, -688, + 810, 811, 812, 355, 813, -688, 430, 814, 712, 713, + 815, -688, -688, 46, 818, -688, 42, 439, 820, 821, + 822, 821, 823, 824, -688, -688, -688, -688, 736, 37, + -688, -688, -688, -688, 215, -688, -688, -688, 109, 826, + 827, -688, 182, -688, -688, -688, -688, -688, -688, 82, + 828, -688, 498, -688, -688, -688, -688, 829, -688, 532, + 830, -688, -688, -688, 444, 514, 373, 831, -688, -688, + -688, -688, -688, -688, 166, 832, 833, 180, 180, 459, + 759, -688, 835, 836, -688, 542, 837, -688, 468, -688, + 514, 839, 34, -688, -688, -688, -688, 723, -688, 840, + 737, -688, -688, 46, 46, 46, 46, 841, -688, 842, + -688, -688, -688, 843, 418, 845, 532, 846, -688, -688, + 34, 34, -688, -688, 760, 761, -688, -688, 75, 307, + -688, -688, 408, -688, -688, -688, 847, -688, -688, -688, + 850, 744, 851, 370, 153, 477, 230, 852, -688, 853, + 232, 241, 46, 46, 46, 46, -688, -688, 800, 854, + 605, 855, 857, -688, -688, -688, 857, 857, -688, -25, + 858, 857, 514, 483, 58, 58, 780, 782, 860, -688, + 110, 532, 532, 532, -688, 861, 863, 863, -688, 835, + 532, 34, 34, 34, 34, 34, 864, -688, 865, -688, + 866, -688, -688, -688, -688, -688, -688, 46, -688, -688, + -688, 46, -688, 867, 810, -688, -688, 34, 34, -688, + -688, -688, -688, -688, 868, 869, -688, -688, 755, -688, + 870, 871, 75, 75, -688, 292, 873, 874, 875, 876, + 877, 502, -688, 612, 878, -688, -688, -688, -688, 879, + 561, 836, 881, 52, 52, 75, 75, 75, 514, 489, + 882, -688, -688, -688, -688, 574, 75, 75, -688, 821, + 64, -688, -688, 883, 884, 885, -688, -688, -688, -688, + -688, -688, -688, 34, 34, 34, 34, 34, -688, -688, + -688, -688, 886, 269, -688, 887, 669, 888, 889, 890, + 891, 892, 893, 894, 895, 116, 826, 897, -688, 630, + -688, -688, -688, -688, 898, 75, 805, 899, 900, -688, + 590, 99, 99, 99, 99, 99, -688, 901, -688, 532, + 34, 34, 903, -688, 64, -688, -688, -688, -688, -688, + -688, -688, 836, 542, 904, 613, 514, -688, 905, 906, + -688, -688, 664, -688, -688, -688, -688, 678, 834, 907, + -688, -688, -688, 908, 909, 910, 912, -688, 622, 881, + 58, 58, 514, 67, 913, 914, -688, -688, 915, -688, + -688, 99, 99, 99, 99, -688, -688, -688, -688, -688, + -688, -688, -688, 916, 917, 918, 919, -688, -688, 865, + 99, 99, 99, 99, -688, -688, -688, 881, 920, 921, + 922, 923, 924, 925, -688, -688, -688, -688, -688, -688 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -688, -688, -688, 729, -688, -688, 819, -688, 817, 378, + -688, 799, -688, -688, 825, -688, -688, -688, -688, -688, + -179, 665, -189, 911, 838, 453, -259, -688, -688, 51, + -688, -139, -688, -172, -688, -688, 446, -688, -151, -407, + -688, -688, -688, -688, -403, -688, -688, -688, -687, -688, + 356, -688, -688, 222, 372, -688, -289, -688, 465, 242, + 122, -688, -399, -396, -688, -688, -393, -392, -446, -216, + -540, -152, -395, -688, -688, -343, -354, 147, 243, -688, + -688, -60, -112, -688, 710, -83, -688, -359, -688, 460, + -688, 856, -688, -688, -688, 926, -688, -688, -688, -688, + -688, -688, -688, -688, -549, -688, -339, 208, -688, -688, + -688, -688, 226, -688, -688, -688, -688, -688, -688, -688, + -344, -688, 347, 344, 249, -688, 927, -688, 929 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -79 +static const yytype_int16 yytable[] = +{ + 92, 203, 192, 394, 466, 207, 208, 209, 160, 55, + 459, 228, 459, 460, 227, 460, 461, 462, 461, 462, + 404, 93, 215, 31, 282, 621, 95, 525, 263, 264, + 641, 257, 258, 259, 260, 261, 196, 533, 17, 199, + 200, 471, 204, 205, 206, 191, 270, 226, 188, 442, + 463, 1, 463, 347, 348, 686, 255, 97, 33, 447, + 34, 618, 280, 385, 452, 26, 319, 280, 20, 185, + 280, 782, 783, 21, 13, 186, 2, 26, 280, 32, + 99, 189, 671, 22, 472, 24, 486, 534, 473, 198, + 338, 250, 14, 252, 253, 254, 302, 256, 349, 350, + 351, 352, 747, 688, 690, 175, 320, 321, 241, 223, + 803, 502, 91, 625, 56, 564, 565, 274, 274, 91, + 277, 278, 340, 341, 529, 216, 94, 339, 443, 301, + 424, 96, 619, 384, 386, 387, 388, 247, 619, -30, + 309, 281, 291, 292, 705, 463, 560, 739, 449, 542, + 543, 544, 545, 444, 201, 202, 3, 4, 487, 281, + 201, 202, 98, 305, 305, 307, 281, 201, 202, 14, + 397, 281, 201, 202, 281, 201, 202, 637, 637, 18, + 638, 638, 281, 201, 202, 100, 643, 644, 645, 646, + 647, 748, 216, 463, 525, 525, 400, 463, 463, 599, + 600, 601, 463, 382, 2, 603, 281, 201, 202, 703, + 176, 383, 656, 657, 224, 475, 626, 463, 463, 474, + 784, 785, 733, 377, 378, 509, 536, -30, 310, 15, + 16, 627, 540, 541, 592, 51, 595, 681, 682, 3, + 4, -30, 24, 390, 391, 596, 481, 181, 182, 510, + 511, 445, 704, 415, 18, 482, 701, 601, 19, 702, + 459, 201, 202, 460, 27, 28, 461, 462, 53, 416, + 717, 417, 71, 401, 402, 90, 503, 91, 711, 712, + 713, 714, 715, 54, 3, 4, 525, 665, 483, 34, + 408, 310, 484, 77, 450, 453, 463, 395, 81, 310, + 463, 530, 405, 82, 166, 24, 168, 310, 170, 83, + 430, 745, 86, 24, 746, 101, 752, 752, 752, 752, + 752, 24, 310, 113, 310, 760, 761, 115, 718, 764, + 105, 150, 106, 310, 117, 719, 24, 499, 24, 118, + 570, 445, 445, 445, 445, 120, 406, 24, 571, 572, + 573, 463, 720, 721, 392, 570, 393, 407, 230, 231, + 150, 232, 233, 571, 572, 573, 574, 147, 476, 479, + 109, 234, -34, -34, 91, 246, 752, 752, 752, 752, + 161, 529, 590, 615, 191, 304, 235, 236, 237, 238, + 445, 445, 445, 445, 561, 752, 752, 752, 752, 191, + 306, 610, 162, 428, 189, 611, 612, 398, 399, 575, + 614, 163, 148, 165, 429, 526, 167, 150, 395, 549, + 169, 550, -78, 753, 754, 755, 756, 687, 689, 691, + 692, 693, 504, 432, 433, 150, 604, 505, 506, 586, + 687, 689, 373, 451, 706, 445, 188, 373, 501, 445, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 628, + 629, 630, 379, 516, 576, 577, 172, 578, 642, 694, + 150, 393, 528, 579, 580, 59, 312, 313, 171, 189, + 432, 591, 790, 791, 792, 793, 464, 616, 174, 738, + 178, 581, 582, 583, 584, 585, 88, 357, 180, -24, + -24, 799, 800, 801, 802, 519, 670, 106, 763, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, 184, 358, 359, 360, 191, 361, 695, 194, 362, + 68, 412, 413, 195, 414, 91, 148, 388, 696, 364, + 365, 150, 367, 368, 369, 370, 371, 768, 415, 751, + 751, 751, 751, 751, 522, 680, 697, 229, 230, 231, + 150, 232, 233, 210, 416, 211, 417, 699, 700, 212, + 489, 234, 213, 786, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 742, 743, 214, 235, 236, 237, 238, + 722, -24, 490, 219, 491, 492, 220, 759, 243, 493, + 494, 495, 496, 244, 189, 245, 393, 767, 248, 751, + 751, 751, 751, 312, 313, 683, 781, 249, 314, 315, + 316, 317, 121, 122, 262, 734, 479, 251, 751, 751, + 751, 751, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 606, 323, 265, 150, 268, 505, + 506, 672, 267, 765, 269, 395, 505, 273, 188, 271, + 272, 148, 285, 149, 286, 188, 150, 287, 607, 608, + 583, 584, 585, 288, 505, 673, 674, 675, 676, 677, + 289, 323, 323, 188, 323, 323, 323, 323, 323, 514, + 515, 189, 58, 607, 608, 583, 584, 585, 189, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 505, 57, + 58, 290, 293, 59, 145, 294, 189, 188, 61, 62, + 63, 64, 65, 295, 663, 664, 296, 673, 674, 675, + 676, 677, 297, 298, 303, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 72, 73, 74, 75, 76, + 189, 308, 322, 337, 331, 312, 313, 332, 79, 80, + 314, 315, 316, 724, 312, 313, 334, 335, 342, 771, + 772, 773, 774, 336, 344, -17, 345, 353, 354, 355, + 356, 366, 372, 373, 379, 381, 389, 409, 410, 411, + 420, 421, 422, 423, 425, 426, 427, 431, 438, 441, + 439, 440, 448, 455, 456, 464, 467, 468, 470, 393, + 480, 537, 488, 498, 500, 508, 512, 513, 519, 522, + 518, 527, 531, 539, 538, 546, 547, 548, 559, 562, + 483, 587, 566, 567, 588, 589, 593, 594, 605, 609, + 550, 622, 613, 623, 624, 632, 633, 648, 649, 660, + 651, 654, 658, 659, 661, 662, 625, 87, 666, 667, + 668, 669, 678, 679, 683, 739, 698, 707, 708, 709, + 716, 723, 725, 726, 727, 728, 729, 730, 731, 732, + 736, 116, 737, 740, 741, 757, 762, 179, 766, 769, + 770, 776, 777, 778, 779, 775, 780, 787, 788, 789, + 794, 795, 796, 797, 804, 805, 806, 807, 808, 809, + 535, 300, 744, 639, 517, 617, 798, 52, 190, 735, + 276, 532, 173, 119, 652, 653, 0, 0, 30, 29, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 78 +}; + +static const yytype_int16 yycheck[] = +{ + 60, 153, 114, 357, 411, 157, 158, 159, 91, 1, + 409, 190, 411, 409, 186, 411, 409, 409, 411, 411, + 363, 1, 3, 12, 240, 565, 1, 473, 217, 218, + 579, 210, 211, 212, 213, 214, 148, 3, 0, 151, + 152, 4, 154, 155, 156, 3, 225, 186, 73, 3, + 409, 3, 411, 312, 313, 3, 208, 1, 1, 403, + 3, 3, 3, 4, 407, 14, 282, 3, 6, 106, + 3, 758, 759, 93, 11, 112, 28, 26, 3, 68, + 1, 106, 631, 3, 47, 106, 4, 482, 51, 149, + 4, 203, 106, 205, 206, 207, 268, 209, 314, 315, + 316, 317, 3, 643, 644, 1, 285, 286, 191, 1, + 797, 454, 3, 3, 106, 510, 511, 229, 230, 3, + 232, 233, 301, 302, 478, 106, 106, 299, 82, 268, + 389, 106, 80, 349, 350, 351, 352, 197, 80, 4, + 4, 107, 254, 255, 80, 504, 505, 80, 106, 493, + 494, 495, 496, 107, 108, 109, 108, 109, 76, 107, + 108, 109, 106, 275, 276, 277, 107, 108, 109, 106, + 359, 107, 108, 109, 107, 108, 109, 576, 577, 3, + 576, 577, 107, 108, 109, 106, 581, 582, 583, 584, + 585, 92, 106, 552, 640, 641, 1, 556, 557, 543, + 544, 545, 561, 4, 28, 548, 107, 108, 109, 655, + 106, 4, 607, 608, 106, 106, 106, 576, 577, 4, + 760, 761, 106, 335, 336, 59, 485, 92, 92, 108, + 109, 570, 491, 492, 4, 4, 4, 640, 641, 108, + 109, 106, 106, 355, 356, 4, 64, 3, 4, 83, + 84, 403, 659, 73, 3, 73, 655, 601, 9, 655, + 659, 108, 109, 659, 15, 16, 659, 659, 7, 89, + 1, 91, 4, 78, 79, 1, 455, 3, 673, 674, + 675, 676, 677, 106, 108, 109, 732, 626, 106, 3, + 373, 92, 110, 3, 406, 407, 655, 357, 4, 92, + 659, 480, 4, 4, 96, 106, 98, 92, 100, 106, + 393, 710, 106, 106, 710, 106, 711, 712, 713, 714, + 715, 106, 92, 3, 92, 720, 721, 3, 59, 732, + 1, 62, 3, 92, 4, 66, 106, 449, 106, 3, + 48, 493, 494, 495, 496, 4, 48, 106, 56, 57, + 58, 710, 83, 84, 1, 48, 3, 59, 60, 61, + 62, 63, 64, 56, 57, 58, 59, 4, 428, 429, + 1, 73, 3, 4, 3, 4, 771, 772, 773, 774, + 4, 735, 534, 562, 3, 4, 88, 89, 90, 91, + 542, 543, 544, 545, 506, 790, 791, 792, 793, 3, + 4, 552, 4, 48, 106, 556, 557, 75, 76, 1, + 561, 45, 57, 4, 59, 475, 4, 62, 478, 1, + 4, 3, 4, 712, 713, 714, 715, 643, 644, 645, + 646, 647, 59, 3, 4, 62, 548, 64, 65, 522, + 656, 657, 3, 4, 660, 597, 73, 3, 4, 601, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 571, + 572, 573, 3, 4, 56, 57, 112, 59, 580, 648, + 62, 3, 4, 65, 66, 13, 106, 107, 4, 106, + 3, 4, 771, 772, 773, 774, 3, 4, 4, 705, + 4, 83, 84, 85, 86, 87, 1, 35, 4, 4, + 5, 790, 791, 792, 793, 3, 4, 3, 724, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 4, 70, 71, 72, 3, 74, 48, 69, 77, + 43, 56, 57, 4, 59, 3, 57, 763, 59, 323, + 324, 62, 326, 327, 328, 329, 330, 736, 73, 711, + 712, 713, 714, 715, 3, 4, 649, 59, 60, 61, + 62, 63, 64, 3, 89, 3, 91, 3, 4, 3, + 82, 73, 3, 762, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 3, 4, 3, 88, 89, 90, 91, + 683, 106, 104, 4, 106, 107, 92, 719, 4, 111, + 112, 113, 114, 106, 106, 4, 3, 4, 4, 771, + 772, 773, 774, 106, 107, 3, 4, 4, 111, 112, + 113, 114, 4, 5, 67, 695, 696, 4, 790, 791, + 792, 793, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 59, 287, 106, 62, 112, 64, + 65, 59, 4, 733, 4, 735, 64, 4, 73, 226, + 227, 57, 3, 59, 3, 73, 62, 4, 83, 84, + 85, 86, 87, 4, 64, 83, 84, 85, 86, 87, + 4, 323, 324, 73, 326, 327, 328, 329, 330, 467, + 468, 106, 10, 83, 84, 85, 86, 87, 106, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 64, 9, + 10, 4, 4, 13, 106, 4, 106, 73, 36, 37, + 38, 39, 40, 4, 622, 623, 4, 83, 84, 85, + 86, 87, 4, 4, 4, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 36, 37, 38, 39, 40, + 106, 4, 3, 55, 4, 106, 107, 4, 49, 50, + 111, 112, 113, 114, 106, 107, 46, 46, 112, 111, + 112, 113, 114, 46, 4, 8, 106, 8, 4, 4, + 4, 4, 4, 3, 3, 94, 107, 51, 51, 51, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 108, 108, 4, 3, 3, 3, 3, 3, 92, 3, + 3, 108, 4, 4, 4, 4, 4, 4, 3, 3, + 81, 4, 3, 106, 4, 4, 4, 4, 3, 3, + 106, 4, 92, 92, 4, 4, 4, 4, 4, 4, + 3, 81, 4, 81, 4, 4, 3, 3, 3, 114, + 4, 4, 4, 4, 4, 4, 3, 58, 4, 4, + 4, 4, 4, 4, 3, 80, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 3, 84, 4, 4, 4, 4, 3, 108, 4, 4, + 4, 4, 4, 4, 4, 81, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 484, 266, 710, 577, 469, 563, 789, 26, 113, 696, + 230, 481, 104, 87, 597, 601, -1, -1, 21, 20, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 41 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 3, 28, 108, 109, 117, 118, 227, 240, 241, + 242, 243, 244, 11, 106, 108, 109, 0, 3, 240, + 6, 93, 3, 120, 106, 139, 145, 240, 240, 244, + 242, 12, 68, 1, 3, 119, 123, 125, 206, 207, + 208, 210, 211, 212, 214, 215, 216, 217, 218, 225, + 226, 4, 139, 7, 106, 1, 106, 9, 10, 13, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 213, 4, 119, 119, 119, 119, 119, 3, 211, 119, + 119, 4, 4, 106, 121, 124, 106, 122, 1, 126, + 1, 3, 197, 1, 106, 1, 106, 1, 106, 1, + 106, 106, 138, 140, 146, 1, 3, 127, 128, 1, + 132, 141, 150, 3, 204, 3, 124, 4, 3, 207, + 4, 4, 5, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 106, 224, 4, 57, 59, + 62, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 201, 4, 4, 45, 223, 4, 223, 4, 223, 4, + 223, 4, 112, 140, 4, 1, 106, 129, 4, 127, + 4, 3, 4, 133, 4, 106, 112, 148, 73, 106, + 130, 3, 198, 203, 69, 4, 198, 196, 197, 198, + 198, 108, 109, 187, 198, 198, 198, 187, 187, 187, + 3, 3, 3, 3, 3, 3, 106, 147, 149, 4, + 92, 136, 137, 1, 106, 135, 147, 149, 136, 59, + 60, 61, 63, 64, 73, 88, 89, 90, 91, 130, + 190, 201, 202, 4, 106, 4, 4, 197, 4, 4, + 198, 4, 198, 198, 198, 187, 198, 136, 136, 136, + 136, 136, 67, 138, 138, 106, 143, 4, 112, 4, + 136, 141, 141, 4, 198, 200, 200, 198, 198, 142, + 3, 107, 185, 187, 188, 3, 3, 4, 4, 4, + 4, 198, 198, 4, 4, 4, 4, 4, 4, 151, + 137, 147, 149, 4, 4, 198, 4, 198, 4, 4, + 92, 145, 106, 107, 111, 112, 113, 114, 122, 185, + 136, 136, 3, 125, 209, 228, 229, 230, 232, 233, + 234, 4, 4, 197, 46, 46, 46, 55, 4, 149, + 136, 136, 112, 134, 4, 106, 144, 142, 142, 185, + 185, 185, 185, 8, 4, 4, 4, 35, 70, 71, + 72, 74, 77, 231, 228, 228, 4, 228, 228, 228, + 228, 228, 4, 3, 191, 195, 198, 198, 198, 3, + 174, 94, 4, 4, 185, 4, 185, 185, 185, 107, + 198, 198, 1, 3, 192, 197, 152, 138, 75, 76, + 1, 78, 79, 235, 191, 4, 48, 59, 201, 51, + 51, 51, 56, 57, 59, 73, 89, 91, 175, 219, + 4, 4, 4, 4, 142, 4, 4, 4, 48, 59, + 201, 4, 3, 4, 153, 180, 181, 205, 4, 108, + 108, 4, 3, 82, 107, 187, 189, 236, 4, 106, + 198, 4, 191, 198, 199, 3, 3, 155, 159, 178, + 179, 182, 183, 203, 3, 170, 155, 3, 3, 177, + 92, 4, 47, 51, 4, 106, 197, 192, 194, 197, + 3, 64, 73, 106, 110, 131, 4, 76, 4, 82, + 104, 106, 107, 111, 112, 113, 114, 237, 4, 198, + 4, 4, 191, 136, 59, 64, 65, 201, 4, 59, + 83, 84, 4, 4, 175, 175, 4, 174, 81, 3, + 220, 222, 3, 160, 162, 184, 197, 4, 4, 192, + 136, 3, 205, 3, 188, 152, 142, 108, 4, 106, + 142, 142, 236, 236, 236, 236, 4, 4, 4, 1, + 3, 154, 156, 157, 178, 179, 182, 183, 184, 3, + 203, 198, 3, 171, 188, 188, 92, 92, 176, 185, + 48, 56, 57, 58, 59, 1, 56, 57, 59, 65, + 66, 83, 84, 85, 86, 87, 201, 4, 4, 4, + 187, 4, 4, 4, 4, 4, 4, 236, 238, 236, + 236, 236, 239, 191, 198, 4, 59, 83, 84, 4, + 154, 154, 154, 4, 154, 136, 4, 170, 3, 80, + 186, 186, 81, 81, 4, 3, 106, 222, 198, 198, + 198, 221, 4, 3, 166, 167, 169, 178, 179, 166, + 161, 220, 198, 188, 188, 188, 188, 188, 3, 3, + 193, 4, 238, 239, 4, 158, 188, 188, 4, 4, + 114, 4, 4, 176, 176, 222, 4, 4, 4, 4, + 4, 220, 59, 83, 84, 85, 86, 87, 4, 4, + 4, 160, 160, 3, 163, 164, 3, 185, 186, 185, + 186, 185, 185, 185, 136, 48, 59, 201, 4, 3, + 4, 178, 179, 184, 155, 80, 185, 4, 4, 4, + 168, 188, 188, 188, 188, 188, 4, 1, 59, 66, + 83, 84, 201, 4, 114, 4, 4, 4, 4, 4, + 4, 4, 4, 106, 197, 194, 3, 4, 185, 80, + 4, 4, 3, 4, 169, 178, 179, 3, 92, 172, + 173, 187, 188, 172, 172, 172, 172, 4, 165, 198, + 188, 188, 3, 185, 160, 197, 4, 4, 136, 4, + 4, 111, 112, 113, 114, 81, 4, 4, 4, 4, + 4, 4, 164, 164, 186, 186, 136, 4, 4, 4, + 172, 172, 172, 172, 4, 4, 4, 4, 193, 172, + 172, 172, 172, 164, 4, 4, 4, 4, 4, 4 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. However, + YYFAIL appears to be in use. Nevertheless, it is formally deprecated + in Bison 2.4.2's NEWS entry, where a plan to phase it out is + discussed. */ + +#define YYFAIL goto yyerrlab +#if defined YYFAIL + /* This is here to suppress warnings from the GCC cpp's + -Wunused-macros. Normally we don't worry about that warning, but + some users do, and we want to make it easy for users to remove + YYFAIL uses, which will produce warnings from Bison 2.5. */ +#endif + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +#else +static void +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; +#endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) +{ + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } +} +#endif /* YYERROR_VERBOSE */ + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + YYUSE (yyvaluep); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} + +/* Prevent warnings from -Wmissing-prototypes. */ +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + +/* The lookahead symbol. */ +int yychar; + +/* The semantic value of the lookahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void) +#else +int +yyparse () + +#endif +#endif +{ + + + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYSIZE_T yystacksize; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yystacksize = YYINITDEPTH; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + yyssp = yyss; + yyvsp = yyvs; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token. */ + yychar = YYEMPTY; + + yystate = yyn; + *++yyvsp = yylval; + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: + +/* Line 1464 of yacc.c */ +#line 260 "src/pddl+.yacc" + {top_thing= (yyvsp[(1) - (1)].t_domain); current_analysis->the_domain= (yyvsp[(1) - (1)].t_domain);;} + break; + + case 3: + +/* Line 1464 of yacc.c */ +#line 261 "src/pddl+.yacc" + {top_thing= (yyvsp[(1) - (1)].t_problem); current_analysis->the_problem= (yyvsp[(1) - (1)].t_problem);;} + break; + + case 4: + +/* Line 1464 of yacc.c */ +#line 262 "src/pddl+.yacc" + {top_thing= (yyvsp[(1) - (1)].t_plan); ;} + break; + + case 5: + +/* Line 1464 of yacc.c */ +#line 267 "src/pddl+.yacc" + {(yyval.t_domain)= (yyvsp[(4) - (5)].t_domain); (yyval.t_domain)->name= (yyvsp[(3) - (5)].cp);delete [] (yyvsp[(3) - (5)].cp); + if (types_used && !types_defined) { + yyerrok; log_error(E_FATAL,"Syntax error in domain - no :types section, but types used in definitions."); + } + ;} + break; + + case 6: + +/* Line 1464 of yacc.c */ +#line 273 "src/pddl+.yacc" + {yyerrok; (yyval.t_domain)=static_cast(NULL); + log_error(E_FATAL,"Syntax error in domain"); ;} + break; + + case 7: + +/* Line 1464 of yacc.c */ +#line 279 "src/pddl+.yacc" + {(yyval.t_domain)= (yyvsp[(2) - (2)].t_domain); (yyval.t_domain)->req= (yyvsp[(1) - (2)].t_pddl_req_flag);;} + break; + + case 8: + +/* Line 1464 of yacc.c */ +#line 280 "src/pddl+.yacc" + {types_defined = true; (yyval.t_domain)= (yyvsp[(2) - (2)].t_domain); (yyval.t_domain)->types= (yyvsp[(1) - (2)].t_type_list);;} + break; + + case 9: + +/* Line 1464 of yacc.c */ +#line 281 "src/pddl+.yacc" + {(yyval.t_domain)= (yyvsp[(2) - (2)].t_domain); (yyval.t_domain)->constants= (yyvsp[(1) - (2)].t_const_symbol_list);;} + break; + + case 10: + +/* Line 1464 of yacc.c */ +#line 282 "src/pddl+.yacc" + {(yyval.t_domain)= (yyvsp[(2) - (2)].t_domain); + (yyval.t_domain)->predicates= (yyvsp[(1) - (2)].t_pred_decl_list); ;} + break; + + case 11: + +/* Line 1464 of yacc.c */ +#line 284 "src/pddl+.yacc" + {(yyval.t_domain)= (yyvsp[(2) - (2)].t_domain); + (yyval.t_domain)->functions= (yyvsp[(1) - (2)].t_func_decl_list); ;} + break; + + case 12: + +/* Line 1464 of yacc.c */ +#line 286 "src/pddl+.yacc" + {(yyval.t_domain)= (yyvsp[(2) - (2)].t_domain); + (yyval.t_domain)->constraints = (yyvsp[(1) - (2)].t_con_goal);;} + break; + + case 13: + +/* Line 1464 of yacc.c */ +#line 288 "src/pddl+.yacc" + {(yyval.t_domain) = (yyvsp[(2) - (2)].t_domain);;} + break; + + case 14: + +/* Line 1464 of yacc.c */ +#line 289 "src/pddl+.yacc" + {(yyval.t_domain)= new domain((yyvsp[(1) - (1)].t_structure_store)); ;} + break; + + case 15: + +/* Line 1464 of yacc.c */ +#line 292 "src/pddl+.yacc" + {(yyval.cp)=(yyvsp[(3) - (4)].cp);;} + break; + + case 16: + +/* Line 1464 of yacc.c */ +#line 296 "src/pddl+.yacc" + { (yyval.t_class)=current_analysis->classes_tab.new_symbol_put((yyvsp[(1) - (1)].cp)); + delete [] (yyvsp[(1) - (1)].cp); ;} + break; + + case 17: + +/* Line 1464 of yacc.c */ +#line 299 "src/pddl+.yacc" + { (yyval.t_class) = current_analysis->classes_tab.symbol_get((yyvsp[(1) - (1)].cp)); delete [] (yyvsp[(1) - (1)].cp);;} + break; + + case 18: + +/* Line 1464 of yacc.c */ +#line 301 "src/pddl+.yacc" + {(yyval.t_dummy) = 0;;} + break; + + case 19: + +/* Line 1464 of yacc.c */ +#line 303 "src/pddl+.yacc" + {(yyval.t_dummy) = 0;;} + break; + + case 20: + +/* Line 1464 of yacc.c */ +#line 304 "src/pddl+.yacc" + {(yyval.t_dummy) = 0;;} + break; + + case 21: + +/* Line 1464 of yacc.c */ +#line 309 "src/pddl+.yacc" + { + // Stash in analysis object --- we need to refer to it during parse + // but domain object is not created yet, + current_analysis->req |= (yyvsp[(3) - (4)].t_pddl_req_flag); + (yyval.t_pddl_req_flag)=(yyvsp[(3) - (4)].t_pddl_req_flag); + ;} + break; + + case 22: + +/* Line 1464 of yacc.c */ +#line 316 "src/pddl+.yacc" + {yyerrok; + log_error(E_FATAL,"Syntax error in requirements declaration."); + (yyval.t_pddl_req_flag)= 0; ;} + break; + + case 23: + +/* Line 1464 of yacc.c */ +#line 322 "src/pddl+.yacc" + { (yyval.t_pddl_req_flag)= (yyvsp[(1) - (2)].t_pddl_req_flag) | (yyvsp[(2) - (2)].t_pddl_req_flag); ;} + break; + + case 24: + +/* Line 1464 of yacc.c */ +#line 323 "src/pddl+.yacc" + { (yyval.t_pddl_req_flag)= 0; ;} + break; + + case 25: + +/* Line 1464 of yacc.c */ +#line 329 "src/pddl+.yacc" + {(yyval.t_pred_decl_list)=(yyvsp[(2) - (2)].t_pred_decl_list); (yyval.t_pred_decl_list)->push_front((yyvsp[(1) - (2)].t_pred_decl));;} + break; + + case 26: + +/* Line 1464 of yacc.c */ +#line 331 "src/pddl+.yacc" + { (yyval.t_pred_decl_list)=new pred_decl_list; + (yyval.t_pred_decl_list)->push_front((yyvsp[(1) - (1)].t_pred_decl)); ;} + break; + + case 27: + +/* Line 1464 of yacc.c */ +#line 336 "src/pddl+.yacc" + {(yyval.t_pred_decl)= new pred_decl((yyvsp[(2) - (4)].t_pred_symbol),(yyvsp[(3) - (4)].t_var_symbol_list),current_analysis->var_tab_stack.pop());;} + break; + + case 28: + +/* Line 1464 of yacc.c */ +#line 338 "src/pddl+.yacc" + {yyerrok; + // hope someone makes this error someday + log_error(E_FATAL,"Syntax error in predicate declaration."); + (yyval.t_pred_decl)= static_cast(NULL); ;} + break; + + case 29: + +/* Line 1464 of yacc.c */ +#line 346 "src/pddl+.yacc" + { (yyval.t_pred_symbol)=current_analysis->pred_tab.new_symbol_put((yyvsp[(1) - (1)].cp)); + current_analysis->var_tab_stack.push( + current_analysis->buildPredTab()); + delete [] (yyvsp[(1) - (1)].cp); ;} + break; + + case 30: + +/* Line 1464 of yacc.c */ +#line 353 "src/pddl+.yacc" + { (yyval.t_pred_symbol)=current_analysis->pred_tab.symbol_ref("="); + requires(E_EQUALITY); ;} + break; + + case 31: + +/* Line 1464 of yacc.c */ +#line 355 "src/pddl+.yacc" + { (yyval.t_pred_symbol)=current_analysis->pred_tab.symbol_get((yyvsp[(1) - (1)].cp)); delete [] (yyvsp[(1) - (1)].cp); ;} + break; + + case 32: + +/* Line 1464 of yacc.c */ +#line 363 "src/pddl+.yacc" + { (yyval.t_pred_symbol)=current_analysis->pred_tab.symbol_get((yyvsp[(1) - (1)].cp)); delete [] (yyvsp[(1) - (1)].cp);;} + break; + + case 33: + +/* Line 1464 of yacc.c */ +#line 369 "src/pddl+.yacc" + {(yyval.t_func_decl_list)=(yyvsp[(1) - (2)].t_func_decl_list); (yyval.t_func_decl_list)->push_back((yyvsp[(2) - (2)].t_func_decl));;} + break; + + case 34: + +/* Line 1464 of yacc.c */ +#line 370 "src/pddl+.yacc" + { (yyval.t_func_decl_list)=new func_decl_list; ;} + break; + + case 35: + +/* Line 1464 of yacc.c */ +#line 375 "src/pddl+.yacc" + {(yyval.t_func_decl)= new func_decl((yyvsp[(2) - (5)].t_func_symbol),(yyvsp[(3) - (5)].t_var_symbol_list),current_analysis->var_tab_stack.pop());;} + break; + + case 36: + +/* Line 1464 of yacc.c */ +#line 377 "src/pddl+.yacc" + {yyerrok; + log_error(E_FATAL,"Syntax error in functor declaration."); + (yyval.t_func_decl)= (int) NULL; ;} + break; + + case 37: + +/* Line 1464 of yacc.c */ +#line 383 "src/pddl+.yacc" + {(yyval.t_dummy) = (int) NULL;;} + break; + + case 38: + +/* Line 1464 of yacc.c */ +#line 383 "src/pddl+.yacc" + {(yyval.t_dummy)= (int) NULL;;} + break; + + case 39: + +/* Line 1464 of yacc.c */ +#line 387 "src/pddl+.yacc" + { (yyval.t_func_symbol)=current_analysis->func_tab.new_symbol_put((yyvsp[(1) - (1)].cp)); + current_analysis->var_tab_stack.push( + current_analysis->buildFuncTab()); + delete [] (yyvsp[(1) - (1)].cp); ;} + break; + + case 40: + +/* Line 1464 of yacc.c */ +#line 400 "src/pddl+.yacc" + { + (yyval.t_var_symbol_list)= (yyvsp[(1) - (4)].t_var_symbol_list); + (yyval.t_var_symbol_list)->set_types((yyvsp[(3) - (4)].t_type)); /* Set types for variables */ + (yyval.t_var_symbol_list)->splice((yyval.t_var_symbol_list)->end(),*(yyvsp[(4) - (4)].t_var_symbol_list)); /* Join lists */ + delete (yyvsp[(4) - (4)].t_var_symbol_list); /* Delete (now empty) list */ + requires(E_TYPING); + types_used = true; + ;} + break; + + case 41: + +/* Line 1464 of yacc.c */ +#line 409 "src/pddl+.yacc" + { + (yyval.t_var_symbol_list)= (yyvsp[(1) - (4)].t_var_symbol_list); + (yyval.t_var_symbol_list)->set_either_types((yyvsp[(3) - (4)].t_type_list)); /* Set types for variables */ + (yyval.t_var_symbol_list)->splice((yyval.t_var_symbol_list)->end(),*(yyvsp[(4) - (4)].t_var_symbol_list)); /* Join lists */ + delete (yyvsp[(4) - (4)].t_var_symbol_list); /* Delete (now empty) list */ + requires(E_TYPING); + types_used = true; + ;} + break; + + case 42: + +/* Line 1464 of yacc.c */ +#line 418 "src/pddl+.yacc" + { + (yyval.t_var_symbol_list)= (yyvsp[(1) - (1)].t_var_symbol_list); + ;} + break; + + case 43: + +/* Line 1464 of yacc.c */ +#line 430 "src/pddl+.yacc" + {(yyval.t_var_symbol_list)=(yyvsp[(3) - (3)].t_var_symbol_list); (yyvsp[(3) - (3)].t_var_symbol_list)->push_front((yyvsp[(2) - (3)].t_var_symbol)); ;} + break; + + case 44: + +/* Line 1464 of yacc.c */ +#line 431 "src/pddl+.yacc" + {(yyval.t_var_symbol_list)= new var_symbol_list; ;} + break; + + case 45: + +/* Line 1464 of yacc.c */ +#line 438 "src/pddl+.yacc" + { + (yyval.t_const_symbol_list)= (yyvsp[(1) - (4)].t_const_symbol_list); + (yyvsp[(1) - (4)].t_const_symbol_list)->set_types((yyvsp[(3) - (4)].t_type)); /* Set types for constants */ + (yyvsp[(1) - (4)].t_const_symbol_list)->splice((yyvsp[(1) - (4)].t_const_symbol_list)->end(),*(yyvsp[(4) - (4)].t_const_symbol_list)); /* Join lists */ + delete (yyvsp[(4) - (4)].t_const_symbol_list); /* Delete (now empty) list */ + requires(E_TYPING); + types_used = true; + ;} + break; + + case 46: + +/* Line 1464 of yacc.c */ +#line 447 "src/pddl+.yacc" + { + (yyval.t_const_symbol_list)= (yyvsp[(1) - (4)].t_const_symbol_list); + (yyvsp[(1) - (4)].t_const_symbol_list)->set_either_types((yyvsp[(3) - (4)].t_type_list)); + (yyvsp[(1) - (4)].t_const_symbol_list)->splice((yyvsp[(1) - (4)].t_const_symbol_list)->end(),*(yyvsp[(4) - (4)].t_const_symbol_list)); + delete (yyvsp[(4) - (4)].t_const_symbol_list); + requires(E_TYPING); + types_used = true; + ;} + break; + + case 47: + +/* Line 1464 of yacc.c */ +#line 456 "src/pddl+.yacc" + {(yyval.t_const_symbol_list)= (yyvsp[(1) - (1)].t_const_symbol_list);;} + break; + + case 48: + +/* Line 1464 of yacc.c */ +#line 461 "src/pddl+.yacc" + {(yyval.t_const_symbol_list)=(yyvsp[(2) - (2)].t_const_symbol_list); (yyvsp[(2) - (2)].t_const_symbol_list)->push_front((yyvsp[(1) - (2)].t_const_symbol));;} + break; + + case 49: + +/* Line 1464 of yacc.c */ +#line 462 "src/pddl+.yacc" + {(yyval.t_const_symbol_list)=new const_symbol_list;;} + break; + + case 50: + +/* Line 1464 of yacc.c */ +#line 466 "src/pddl+.yacc" + {(yyval.t_const_symbol_list)=(yyvsp[(2) - (2)].t_const_symbol_list); (yyvsp[(2) - (2)].t_const_symbol_list)->push_front((yyvsp[(1) - (2)].t_const_symbol));;} + break; + + case 51: + +/* Line 1464 of yacc.c */ +#line 467 "src/pddl+.yacc" + {(yyval.t_const_symbol_list)=new const_symbol_list;;} + break; + + case 52: + +/* Line 1464 of yacc.c */ +#line 476 "src/pddl+.yacc" + { + (yyval.t_type_list)= (yyvsp[(1) - (4)].t_type_list); + (yyval.t_type_list)->set_types((yyvsp[(3) - (4)].t_type)); /* Set types for constants */ + (yyval.t_type_list)->splice((yyval.t_type_list)->end(),*(yyvsp[(4) - (4)].t_type_list)); /* Join lists */ + delete (yyvsp[(4) - (4)].t_type_list); /* Delete (now empty) list */ + ;} + break; + + case 53: + +/* Line 1464 of yacc.c */ +#line 483 "src/pddl+.yacc" + { + // This parse needs to be excluded, we think (DPL&MF: 6/9/01) + (yyval.t_type_list)= (yyvsp[(1) - (4)].t_type_list); + (yyval.t_type_list)->set_either_types((yyvsp[(3) - (4)].t_type_list)); + (yyval.t_type_list)->splice((yyvsp[(1) - (4)].t_type_list)->end(),*(yyvsp[(4) - (4)].t_type_list)); + delete (yyvsp[(4) - (4)].t_type_list); + ;} + break; + + case 54: + +/* Line 1464 of yacc.c */ +#line 492 "src/pddl+.yacc" + { (yyval.t_type_list)= (yyvsp[(1) - (1)].t_type_list); ;} + break; + + case 55: + +/* Line 1464 of yacc.c */ +#line 498 "src/pddl+.yacc" + {(yyval.t_parameter_symbol_list)=(yyvsp[(1) - (2)].t_parameter_symbol_list); (yyval.t_parameter_symbol_list)->push_back((yyvsp[(2) - (2)].t_const_symbol)); ;} + break; + + case 56: + +/* Line 1464 of yacc.c */ +#line 500 "src/pddl+.yacc" + {(yyval.t_parameter_symbol_list)=(yyvsp[(1) - (3)].t_parameter_symbol_list); (yyval.t_parameter_symbol_list)->push_back((yyvsp[(3) - (3)].t_var_symbol)); ;} + break; + + case 57: + +/* Line 1464 of yacc.c */ +#line 501 "src/pddl+.yacc" + {(yyval.t_parameter_symbol_list)= new parameter_symbol_list;;} + break; + + case 58: + +/* Line 1464 of yacc.c */ +#line 508 "src/pddl+.yacc" + { (yyval.t_var_symbol)= current_analysis->var_tab_stack.top()->symbol_put((yyvsp[(1) - (1)].cp)); delete [] (yyvsp[(1) - (1)].cp); ;} + break; + + case 59: + +/* Line 1464 of yacc.c */ +#line 514 "src/pddl+.yacc" + { (yyval.t_var_symbol)= current_analysis->var_tab_stack.symbol_get((yyvsp[(1) - (1)].cp)); delete [] (yyvsp[(1) - (1)].cp); ;} + break; + + case 60: + +/* Line 1464 of yacc.c */ +#line 518 "src/pddl+.yacc" + { (yyval.t_const_symbol)= current_analysis->const_tab.symbol_get((yyvsp[(1) - (1)].cp)); delete [] (yyvsp[(1) - (1)].cp); ;} + break; + + case 61: + +/* Line 1464 of yacc.c */ +#line 522 "src/pddl+.yacc" + { (yyval.t_const_symbol)= current_analysis->const_tab.new_symbol_put((yyvsp[(1) - (1)].cp)); delete [] (yyvsp[(1) - (1)].cp);;} + break; + + case 62: + +/* Line 1464 of yacc.c */ +#line 527 "src/pddl+.yacc" + { (yyval.t_type_list)= (yyvsp[(3) - (4)].t_type_list); ;} + break; + + case 63: + +/* Line 1464 of yacc.c */ +#line 532 "src/pddl+.yacc" + { (yyval.t_type)= current_analysis->pddl_type_tab.symbol_ref((yyvsp[(1) - (1)].cp)); delete [] (yyvsp[(1) - (1)].cp);;} + break; + + case 64: + +/* Line 1464 of yacc.c */ +#line 539 "src/pddl+.yacc" + { (yyval.t_type)= current_analysis->pddl_type_tab.symbol_ref((yyvsp[(1) - (1)].cp)); delete [] (yyvsp[(1) - (1)].cp);;} + break; + + case 65: + +/* Line 1464 of yacc.c */ +#line 544 "src/pddl+.yacc" + {(yyval.t_type_list)= (yyvsp[(1) - (2)].t_type_list); (yyval.t_type_list)->push_back((yyvsp[(2) - (2)].t_type));;} + break; + + case 66: + +/* Line 1464 of yacc.c */ +#line 545 "src/pddl+.yacc" + {(yyval.t_type_list)= new pddl_type_list;;} + break; + + case 67: + +/* Line 1464 of yacc.c */ +#line 550 "src/pddl+.yacc" + {(yyval.t_type_list)= (yyvsp[(1) - (2)].t_type_list); (yyval.t_type_list)->push_back((yyvsp[(2) - (2)].t_type));;} + break; + + case 68: + +/* Line 1464 of yacc.c */ +#line 551 "src/pddl+.yacc" + {(yyval.t_type_list)= new pddl_type_list;;} + break; + + case 69: + +/* Line 1464 of yacc.c */ +#line 556 "src/pddl+.yacc" + { (yyval.t_effect_lists)=(yyvsp[(1) - (6)].t_effect_lists); + (yyval.t_effect_lists)->assign_effects.push_back(new assignment((yyvsp[(4) - (6)].t_func_term),E_ASSIGN,(yyvsp[(5) - (6)].t_num_expression))); + if((yyvsp[(4) - (6)].t_func_term)->getFunction()->getName()=="total-cost") + { + requires(E_ACTIONCOSTS); + // Should also check that $5 is 0... + } + else + { + requires(E_NFLUENTS); + } + ;} + break; + + case 70: + +/* Line 1464 of yacc.c */ +#line 569 "src/pddl+.yacc" + { (yyval.t_effect_lists)=(yyvsp[(1) - (2)].t_effect_lists); (yyval.t_effect_lists)->add_effects.push_back((yyvsp[(2) - (2)].t_simple_effect)); ;} + break; + + case 71: + +/* Line 1464 of yacc.c */ +#line 571 "src/pddl+.yacc" + { (yyval.t_effect_lists)=(yyvsp[(1) - (2)].t_effect_lists); (yyval.t_effect_lists)->del_effects.push_back((yyvsp[(2) - (2)].t_simple_effect)); ;} + break; + + case 72: + +/* Line 1464 of yacc.c */ +#line 573 "src/pddl+.yacc" + { (yyval.t_effect_lists)=(yyvsp[(1) - (2)].t_effect_lists); (yyval.t_effect_lists)->timed_effects.push_back((yyvsp[(2) - (2)].t_timed_effect)); ;} + break; + + case 73: + +/* Line 1464 of yacc.c */ +#line 575 "src/pddl+.yacc" + { (yyval.t_effect_lists)= new effect_lists;;} + break; + + case 74: + +/* Line 1464 of yacc.c */ +#line 580 "src/pddl+.yacc" + { requires(E_TIMED_INITIAL_LITERALS); + (yyval.t_timed_effect)=new timed_initial_literal((yyvsp[(3) - (4)].t_effect_lists),(yyvsp[(2) - (4)].fval));;} + break; + + case 75: + +/* Line 1464 of yacc.c */ +#line 585 "src/pddl+.yacc" + {(yyval.t_effect_lists)=(yyvsp[(2) - (2)].t_effect_lists); (yyval.t_effect_lists)->append_effects((yyvsp[(1) - (2)].t_effect_lists)); delete (yyvsp[(1) - (2)].t_effect_lists);;} + break; + + case 76: + +/* Line 1464 of yacc.c */ +#line 586 "src/pddl+.yacc" + {(yyval.t_effect_lists)=(yyvsp[(2) - (2)].t_effect_lists); (yyval.t_effect_lists)->cond_effects.push_front((yyvsp[(1) - (2)].t_cond_effect)); + requires(E_COND_EFFS);;} + break; + + case 77: + +/* Line 1464 of yacc.c */ +#line 588 "src/pddl+.yacc" + {(yyval.t_effect_lists)=(yyvsp[(2) - (2)].t_effect_lists); (yyval.t_effect_lists)->forall_effects.push_front((yyvsp[(1) - (2)].t_forall_effect)); + requires(E_COND_EFFS);;} + break; + + case 78: + +/* Line 1464 of yacc.c */ +#line 590 "src/pddl+.yacc" + {(yyval.t_effect_lists)=new effect_lists(); ;} + break; + + case 79: + +/* Line 1464 of yacc.c */ +#line 599 "src/pddl+.yacc" + {(yyval.t_effect_lists)= (yyvsp[(1) - (1)].t_effect_lists);;} + break; + + case 80: + +/* Line 1464 of yacc.c */ +#line 600 "src/pddl+.yacc" + {(yyval.t_effect_lists)=new effect_lists; (yyval.t_effect_lists)->add_effects.push_front((yyvsp[(1) - (1)].t_simple_effect));;} + break; + + case 81: + +/* Line 1464 of yacc.c */ +#line 601 "src/pddl+.yacc" + {(yyval.t_effect_lists)=new effect_lists; (yyval.t_effect_lists)->del_effects.push_front((yyvsp[(1) - (1)].t_simple_effect));;} + break; + + case 82: + +/* Line 1464 of yacc.c */ +#line 602 "src/pddl+.yacc" + {(yyval.t_effect_lists)=new effect_lists; (yyval.t_effect_lists)->cond_effects.push_front((yyvsp[(1) - (1)].t_cond_effect));;} + break; + + case 83: + +/* Line 1464 of yacc.c */ +#line 603 "src/pddl+.yacc" + {(yyval.t_effect_lists)=new effect_lists; (yyval.t_effect_lists)->forall_effects.push_front((yyvsp[(1) - (1)].t_forall_effect));;} + break; + + case 84: + +/* Line 1464 of yacc.c */ +#line 607 "src/pddl+.yacc" + {(yyval.t_effect_lists)= (yyvsp[(3) - (4)].t_effect_lists);;} + break; + + case 85: + +/* Line 1464 of yacc.c */ +#line 608 "src/pddl+.yacc" + {(yyval.t_effect_lists)= (yyvsp[(1) - (1)].t_effect_lists);;} + break; + + case 86: + +/* Line 1464 of yacc.c */ +#line 613 "src/pddl+.yacc" + {(yyval.t_effect_lists)=new effect_lists; (yyval.t_effect_lists)->del_effects.push_front((yyvsp[(1) - (1)].t_simple_effect));;} + break; + + case 87: + +/* Line 1464 of yacc.c */ +#line 615 "src/pddl+.yacc" + {(yyval.t_effect_lists)=new effect_lists; (yyval.t_effect_lists)->add_effects.push_front((yyvsp[(1) - (1)].t_simple_effect));;} + break; + + case 88: + +/* Line 1464 of yacc.c */ +#line 617 "src/pddl+.yacc" + {(yyval.t_effect_lists)=new effect_lists; (yyval.t_effect_lists)->assign_effects.push_front((yyvsp[(1) - (1)].t_assignment)); + requires(E_NFLUENTS);;} + break; + + case 89: + +/* Line 1464 of yacc.c */ +#line 623 "src/pddl+.yacc" + {(yyval.t_effect_lists)= (yyvsp[(1) - (2)].t_effect_lists); (yyval.t_effect_lists)->del_effects.push_back((yyvsp[(2) - (2)].t_simple_effect));;} + break; + + case 90: + +/* Line 1464 of yacc.c */ +#line 624 "src/pddl+.yacc" + {(yyval.t_effect_lists)= (yyvsp[(1) - (2)].t_effect_lists); (yyval.t_effect_lists)->add_effects.push_back((yyvsp[(2) - (2)].t_simple_effect));;} + break; + + case 91: + +/* Line 1464 of yacc.c */ +#line 625 "src/pddl+.yacc" + {(yyval.t_effect_lists)= (yyvsp[(1) - (2)].t_effect_lists); (yyval.t_effect_lists)->assign_effects.push_back((yyvsp[(2) - (2)].t_assignment)); + requires(E_NFLUENTS); ;} + break; + + case 92: + +/* Line 1464 of yacc.c */ +#line 627 "src/pddl+.yacc" + { (yyval.t_effect_lists)= new effect_lists; ;} + break; + + case 93: + +/* Line 1464 of yacc.c */ +#line 632 "src/pddl+.yacc" + { (yyval.t_effect_lists)=(yyvsp[(3) - (4)].t_effect_lists); ;} + break; + + case 94: + +/* Line 1464 of yacc.c */ +#line 634 "src/pddl+.yacc" + {yyerrok; (yyval.t_effect_lists)=NULL; + log_error(E_FATAL,"Syntax error in (and ...)"); + ;} + break; + + case 95: + +/* Line 1464 of yacc.c */ +#line 642 "src/pddl+.yacc" + { (yyval.t_effect_lists)=(yyvsp[(3) - (4)].t_effect_lists); ;} + break; + + case 96: + +/* Line 1464 of yacc.c */ +#line 647 "src/pddl+.yacc" + { (yyval.t_effect_lists)= new effect_lists; + (yyval.t_effect_lists)->forall_effects.push_back( + new forall_effect((yyvsp[(6) - (7)].t_effect_lists), (yyvsp[(4) - (7)].t_var_symbol_list), current_analysis->var_tab_stack.pop())); + requires(E_COND_EFFS);;} + break; + + case 97: + +/* Line 1464 of yacc.c */ +#line 652 "src/pddl+.yacc" + { (yyval.t_effect_lists)= new effect_lists; + (yyval.t_effect_lists)->cond_effects.push_back( + new cond_effect((yyvsp[(3) - (5)].t_goal),(yyvsp[(4) - (5)].t_effect_lists))); + requires(E_COND_EFFS); ;} + break; + + case 98: + +/* Line 1464 of yacc.c */ +#line 657 "src/pddl+.yacc" + { (yyval.t_effect_lists)= new effect_lists; + (yyval.t_effect_lists)->cond_assign_effects.push_back( + new cond_effect((yyvsp[(3) - (5)].t_goal),(yyvsp[(4) - (5)].t_effect_lists))); + requires(E_COND_EFFS); ;} + break; + + case 99: + +/* Line 1464 of yacc.c */ +#line 662 "src/pddl+.yacc" + { (yyval.t_effect_lists)=new effect_lists; + (yyval.t_effect_lists)->timed_effects.push_back((yyvsp[(1) - (1)].t_timed_effect)); ;} + break; + + case 100: + +/* Line 1464 of yacc.c */ +#line 665 "src/pddl+.yacc" + { (yyval.t_effect_lists)= new effect_lists; + (yyval.t_effect_lists)->assign_effects.push_front((yyvsp[(1) - (1)].t_assignment)); + requires(E_NFLUENTS); ;} + break; + + case 101: + +/* Line 1464 of yacc.c */ +#line 671 "src/pddl+.yacc" + { (yyval.t_effect_lists)=(yyvsp[(1) - (2)].t_effect_lists); (yyvsp[(1) - (2)].t_effect_lists)->append_effects((yyvsp[(2) - (2)].t_effect_lists)); delete (yyvsp[(2) - (2)].t_effect_lists); ;} + break; + + case 102: + +/* Line 1464 of yacc.c */ +#line 672 "src/pddl+.yacc" + { (yyval.t_effect_lists)= new effect_lists; ;} + break; + + case 103: + +/* Line 1464 of yacc.c */ +#line 677 "src/pddl+.yacc" + {(yyval.t_timed_effect)=new timed_effect((yyvsp[(3) - (4)].t_effect_lists),E_AT_START);;} + break; + + case 104: + +/* Line 1464 of yacc.c */ +#line 679 "src/pddl+.yacc" + {(yyval.t_timed_effect)=new timed_effect((yyvsp[(3) - (4)].t_effect_lists),E_AT_END);;} + break; + + case 105: + +/* Line 1464 of yacc.c */ +#line 681 "src/pddl+.yacc" + {(yyval.t_timed_effect)=new timed_effect(new effect_lists,E_CONTINUOUS); + (yyval.t_timed_effect)->effs->assign_effects.push_front( + new assignment((yyvsp[(3) - (5)].t_func_term),E_INCREASE,(yyvsp[(4) - (5)].t_expression))); ;} + break; + + case 106: + +/* Line 1464 of yacc.c */ +#line 685 "src/pddl+.yacc" + {(yyval.t_timed_effect)=new timed_effect(new effect_lists,E_CONTINUOUS); + (yyval.t_timed_effect)->effs->assign_effects.push_front( + new assignment((yyvsp[(3) - (5)].t_func_term),E_DECREASE,(yyvsp[(4) - (5)].t_expression))); ;} + break; + + case 107: + +/* Line 1464 of yacc.c */ +#line 689 "src/pddl+.yacc" + {yyerrok; (yyval.t_timed_effect)=NULL; + log_error(E_FATAL,"Syntax error in timed effect"); ;} + break; + + case 108: + +/* Line 1464 of yacc.c */ +#line 695 "src/pddl+.yacc" + {(yyval.t_timed_effect)=new timed_effect(new effect_lists,E_CONTINUOUS); + (yyval.t_timed_effect)->effs->assign_effects.push_front( + new assignment((yyvsp[(3) - (5)].t_func_term),E_INCREASE,(yyvsp[(4) - (5)].t_expression))); ;} + break; + + case 109: + +/* Line 1464 of yacc.c */ +#line 699 "src/pddl+.yacc" + {(yyval.t_timed_effect)=new timed_effect(new effect_lists,E_CONTINUOUS); + (yyval.t_timed_effect)->effs->assign_effects.push_front( + new assignment((yyvsp[(3) - (5)].t_func_term),E_DECREASE,(yyvsp[(4) - (5)].t_expression))); ;} + break; + + case 110: + +/* Line 1464 of yacc.c */ +#line 703 "src/pddl+.yacc" + {yyerrok; (yyval.t_timed_effect)=NULL; + log_error(E_FATAL,"Syntax error in conditional continuous effect"); ;} + break; + + case 111: + +/* Line 1464 of yacc.c */ +#line 709 "src/pddl+.yacc" + { (yyval.t_effect_lists)=(yyvsp[(3) - (4)].t_effect_lists); ;} + break; + + case 112: + +/* Line 1464 of yacc.c */ +#line 714 "src/pddl+.yacc" + { (yyval.t_effect_lists)= new effect_lists; + (yyval.t_effect_lists)->forall_effects.push_back( + new forall_effect((yyvsp[(6) - (7)].t_effect_lists), (yyvsp[(4) - (7)].t_var_symbol_list), current_analysis->var_tab_stack.pop())); + requires(E_COND_EFFS);;} + break; + + case 113: + +/* Line 1464 of yacc.c */ +#line 719 "src/pddl+.yacc" + { (yyval.t_effect_lists)= new effect_lists; + (yyval.t_effect_lists)->cond_assign_effects.push_back( + new cond_effect((yyvsp[(3) - (5)].t_goal),(yyvsp[(4) - (5)].t_effect_lists))); + requires(E_COND_EFFS); ;} + break; + + case 114: + +/* Line 1464 of yacc.c */ +#line 724 "src/pddl+.yacc" + { (yyval.t_effect_lists)=new effect_lists; + (yyval.t_effect_lists)->timed_effects.push_back((yyvsp[(1) - (1)].t_timed_effect)); ;} + break; + + case 115: + +/* Line 1464 of yacc.c */ +#line 729 "src/pddl+.yacc" + { (yyval.t_effect_lists)=(yyvsp[(1) - (2)].t_effect_lists); (yyvsp[(1) - (2)].t_effect_lists)->append_effects((yyvsp[(2) - (2)].t_effect_lists)); delete (yyvsp[(2) - (2)].t_effect_lists); ;} + break; + + case 116: + +/* Line 1464 of yacc.c */ +#line 730 "src/pddl+.yacc" + { (yyval.t_effect_lists)= new effect_lists; ;} + break; + + case 117: + +/* Line 1464 of yacc.c */ +#line 734 "src/pddl+.yacc" + {(yyval.t_effect_lists)= (yyvsp[(3) - (4)].t_effect_lists);;} + break; + + case 118: + +/* Line 1464 of yacc.c */ +#line 735 "src/pddl+.yacc" + {(yyval.t_effect_lists)= (yyvsp[(1) - (1)].t_effect_lists);;} + break; + + case 119: + +/* Line 1464 of yacc.c */ +#line 740 "src/pddl+.yacc" + {(yyval.t_effect_lists)=new effect_lists; (yyval.t_effect_lists)->del_effects.push_front((yyvsp[(1) - (1)].t_simple_effect));;} + break; + + case 120: + +/* Line 1464 of yacc.c */ +#line 742 "src/pddl+.yacc" + {(yyval.t_effect_lists)=new effect_lists; (yyval.t_effect_lists)->add_effects.push_front((yyvsp[(1) - (1)].t_simple_effect));;} + break; + + case 121: + +/* Line 1464 of yacc.c */ +#line 744 "src/pddl+.yacc" + {(yyval.t_effect_lists)=new effect_lists; (yyval.t_effect_lists)->assign_effects.push_front((yyvsp[(1) - (1)].t_assignment)); + requires(E_NFLUENTS);;} + break; + + case 122: + +/* Line 1464 of yacc.c */ +#line 750 "src/pddl+.yacc" + {(yyval.t_effect_lists)= (yyvsp[(1) - (2)].t_effect_lists); (yyval.t_effect_lists)->del_effects.push_back((yyvsp[(2) - (2)].t_simple_effect));;} + break; + + case 123: + +/* Line 1464 of yacc.c */ +#line 751 "src/pddl+.yacc" + {(yyval.t_effect_lists)= (yyvsp[(1) - (2)].t_effect_lists); (yyval.t_effect_lists)->add_effects.push_back((yyvsp[(2) - (2)].t_simple_effect));;} + break; + + case 124: + +/* Line 1464 of yacc.c */ +#line 752 "src/pddl+.yacc" + {(yyval.t_effect_lists)= (yyvsp[(1) - (2)].t_effect_lists); (yyval.t_effect_lists)->assign_effects.push_back((yyvsp[(2) - (2)].t_assignment)); + requires(E_NFLUENTS); ;} + break; + + case 125: + +/* Line 1464 of yacc.c */ +#line 754 "src/pddl+.yacc" + { (yyval.t_effect_lists)= new effect_lists; ;} + break; + + case 126: + +/* Line 1464 of yacc.c */ +#line 760 "src/pddl+.yacc" + { (yyval.t_assignment)= new assignment((yyvsp[(3) - (5)].t_func_term),E_ASSIGN,(yyvsp[(4) - (5)].t_expression)); ;} + break; + + case 127: + +/* Line 1464 of yacc.c */ +#line 762 "src/pddl+.yacc" + { (yyval.t_assignment)= new assignment((yyvsp[(3) - (5)].t_func_term),E_INCREASE,(yyvsp[(4) - (5)].t_expression)); ;} + break; + + case 128: + +/* Line 1464 of yacc.c */ +#line 764 "src/pddl+.yacc" + { (yyval.t_assignment)= new assignment((yyvsp[(3) - (5)].t_func_term),E_DECREASE,(yyvsp[(4) - (5)].t_expression)); ;} + break; + + case 129: + +/* Line 1464 of yacc.c */ +#line 766 "src/pddl+.yacc" + { (yyval.t_assignment)= new assignment((yyvsp[(3) - (5)].t_func_term),E_SCALE_UP,(yyvsp[(4) - (5)].t_expression)); ;} + break; + + case 130: + +/* Line 1464 of yacc.c */ +#line 768 "src/pddl+.yacc" + { (yyval.t_assignment)= new assignment((yyvsp[(3) - (5)].t_func_term),E_SCALE_DOWN,(yyvsp[(4) - (5)].t_expression)); ;} + break; + + case 131: + +/* Line 1464 of yacc.c */ +#line 773 "src/pddl+.yacc" + {(yyval.t_effect_lists)=new effect_lists; + timed_effect * te = new timed_effect(new effect_lists,E_CONTINUOUS); + (yyval.t_effect_lists)->timed_effects.push_front(te); + te->effs->assign_effects.push_front( + new assignment((yyvsp[(3) - (5)].t_func_term),E_INCREASE,(yyvsp[(4) - (5)].t_expression))); ;} + break; + + case 132: + +/* Line 1464 of yacc.c */ +#line 779 "src/pddl+.yacc" + {(yyval.t_effect_lists)=new effect_lists; + timed_effect * te = new timed_effect(new effect_lists,E_CONTINUOUS); + (yyval.t_effect_lists)->timed_effects.push_front(te); + te->effs->assign_effects.push_front( + new assignment((yyvsp[(3) - (5)].t_func_term),E_DECREASE,(yyvsp[(4) - (5)].t_expression))); ;} + break; + + case 133: + +/* Line 1464 of yacc.c */ +#line 785 "src/pddl+.yacc" + {(yyval.t_effect_lists) = (yyvsp[(3) - (4)].t_effect_lists);;} + break; + + case 134: + +/* Line 1464 of yacc.c */ +#line 789 "src/pddl+.yacc" + { (yyval.t_effect_lists)=(yyvsp[(1) - (2)].t_effect_lists); (yyvsp[(1) - (2)].t_effect_lists)->append_effects((yyvsp[(2) - (2)].t_effect_lists)); delete (yyvsp[(2) - (2)].t_effect_lists); ;} + break; + + case 135: + +/* Line 1464 of yacc.c */ +#line 790 "src/pddl+.yacc" + { (yyval.t_effect_lists)= new effect_lists; ;} + break; + + case 136: + +/* Line 1464 of yacc.c */ +#line 794 "src/pddl+.yacc" + {(yyval.t_expression)= (yyvsp[(1) - (1)].t_expression);;} + break; + + case 137: + +/* Line 1464 of yacc.c */ +#line 795 "src/pddl+.yacc" + {(yyval.t_expression)= new special_val_expr(E_DURATION_VAR); + requires( E_DURATION_INEQUALITIES );;} + break; + + case 138: + +/* Line 1464 of yacc.c */ +#line 797 "src/pddl+.yacc" + { (yyval.t_expression)=(yyvsp[(1) - (1)].t_num_expression); ;} + break; + + case 139: + +/* Line 1464 of yacc.c */ +#line 798 "src/pddl+.yacc" + { (yyval.t_expression)= (yyvsp[(1) - (1)].t_func_term); ;} + break; + + case 140: + +/* Line 1464 of yacc.c */ +#line 803 "src/pddl+.yacc" + { (yyval.t_expression)= new plus_expression((yyvsp[(3) - (5)].t_expression),(yyvsp[(4) - (5)].t_expression)); ;} + break; + + case 141: + +/* Line 1464 of yacc.c */ +#line 805 "src/pddl+.yacc" + { (yyval.t_expression)= new minus_expression((yyvsp[(3) - (5)].t_expression),(yyvsp[(4) - (5)].t_expression)); ;} + break; + + case 142: + +/* Line 1464 of yacc.c */ +#line 807 "src/pddl+.yacc" + { (yyval.t_expression)= new mul_expression((yyvsp[(3) - (5)].t_expression),(yyvsp[(4) - (5)].t_expression)); ;} + break; + + case 143: + +/* Line 1464 of yacc.c */ +#line 809 "src/pddl+.yacc" + { (yyval.t_expression)= new div_expression((yyvsp[(3) - (5)].t_expression),(yyvsp[(4) - (5)].t_expression)); ;} + break; + + case 144: + +/* Line 1464 of yacc.c */ +#line 814 "src/pddl+.yacc" + { (yyval.t_goal)= new conj_goal((yyvsp[(3) - (4)].t_goal_list)); ;} + break; + + case 145: + +/* Line 1464 of yacc.c */ +#line 816 "src/pddl+.yacc" + { (yyval.t_goal)= new timed_goal(new comparison((yyvsp[(2) - (6)].t_comparison_op), + new special_val_expr(E_DURATION_VAR),(yyvsp[(5) - (6)].t_expression)),E_AT_START); ;} + break; + + case 146: + +/* Line 1464 of yacc.c */ +#line 819 "src/pddl+.yacc" + { (yyval.t_goal) = new timed_goal(new comparison((yyvsp[(4) - (9)].t_comparison_op), + new special_val_expr(E_DURATION_VAR),(yyvsp[(7) - (9)].t_expression)),E_AT_START);;} + break; + + case 147: + +/* Line 1464 of yacc.c */ +#line 822 "src/pddl+.yacc" + { (yyval.t_goal) = new timed_goal(new comparison((yyvsp[(4) - (9)].t_comparison_op), + new special_val_expr(E_DURATION_VAR),(yyvsp[(7) - (9)].t_expression)),E_AT_END);;} + break; + + case 148: + +/* Line 1464 of yacc.c */ +#line 827 "src/pddl+.yacc" + {(yyval.t_comparison_op)= E_LESSEQ; requires(E_DURATION_INEQUALITIES);;} + break; + + case 149: + +/* Line 1464 of yacc.c */ +#line 828 "src/pddl+.yacc" + {(yyval.t_comparison_op)= E_GREATEQ; requires(E_DURATION_INEQUALITIES);;} + break; + + case 150: + +/* Line 1464 of yacc.c */ +#line 829 "src/pddl+.yacc" + {(yyval.t_comparison_op)= E_EQUALS; ;} + break; + + case 151: + +/* Line 1464 of yacc.c */ +#line 837 "src/pddl+.yacc" + {(yyval.t_expression)= (yyvsp[(1) - (1)].t_expression); ;} + break; + + case 152: + +/* Line 1464 of yacc.c */ +#line 842 "src/pddl+.yacc" + { (yyval.t_goal_list)=(yyvsp[(1) - (2)].t_goal_list); (yyval.t_goal_list)->push_back((yyvsp[(2) - (2)].t_goal)); ;} + break; + + case 153: + +/* Line 1464 of yacc.c */ +#line 844 "src/pddl+.yacc" + { (yyval.t_goal_list)= new goal_list; ;} + break; + + case 154: + +/* Line 1464 of yacc.c */ +#line 849 "src/pddl+.yacc" + { (yyval.t_simple_effect)= new simple_effect((yyvsp[(3) - (4)].t_proposition)); ;} + break; + + case 155: + +/* Line 1464 of yacc.c */ +#line 854 "src/pddl+.yacc" + { (yyval.t_simple_effect)= new simple_effect((yyvsp[(1) - (1)].t_proposition)); ;} + break; + + case 156: + +/* Line 1464 of yacc.c */ +#line 861 "src/pddl+.yacc" + { (yyval.t_simple_effect)= new simple_effect((yyvsp[(3) - (4)].t_proposition)); ;} + break; + + case 157: + +/* Line 1464 of yacc.c */ +#line 866 "src/pddl+.yacc" + { (yyval.t_simple_effect)= new simple_effect((yyvsp[(1) - (1)].t_proposition)); ;} + break; + + case 158: + +/* Line 1464 of yacc.c */ +#line 871 "src/pddl+.yacc" + { (yyval.t_forall_effect)= new forall_effect((yyvsp[(6) - (7)].t_effect_lists), (yyvsp[(4) - (7)].t_var_symbol_list), current_analysis->var_tab_stack.pop());;} + break; + + case 159: + +/* Line 1464 of yacc.c */ +#line 876 "src/pddl+.yacc" + { (yyval.t_cond_effect)= new cond_effect((yyvsp[(3) - (5)].t_goal),(yyvsp[(4) - (5)].t_effect_lists)); ;} + break; + + case 160: + +/* Line 1464 of yacc.c */ +#line 881 "src/pddl+.yacc" + { (yyval.t_assignment)= new assignment((yyvsp[(3) - (5)].t_func_term),E_ASSIGN,(yyvsp[(4) - (5)].t_expression)); ;} + break; + + case 161: + +/* Line 1464 of yacc.c */ +#line 883 "src/pddl+.yacc" + { (yyval.t_assignment)= new assignment((yyvsp[(3) - (5)].t_func_term),E_INCREASE,(yyvsp[(4) - (5)].t_expression)); ;} + break; + + case 162: + +/* Line 1464 of yacc.c */ +#line 885 "src/pddl+.yacc" + { (yyval.t_assignment)= new assignment((yyvsp[(3) - (5)].t_func_term),E_DECREASE,(yyvsp[(4) - (5)].t_expression)); ;} + break; + + case 163: + +/* Line 1464 of yacc.c */ +#line 887 "src/pddl+.yacc" + { (yyval.t_assignment)= new assignment((yyvsp[(3) - (5)].t_func_term),E_SCALE_UP,(yyvsp[(4) - (5)].t_expression)); ;} + break; + + case 164: + +/* Line 1464 of yacc.c */ +#line 889 "src/pddl+.yacc" + { (yyval.t_assignment)= new assignment((yyvsp[(3) - (5)].t_func_term),E_SCALE_DOWN,(yyvsp[(4) - (5)].t_expression)); ;} + break; + + case 165: + +/* Line 1464 of yacc.c */ +#line 894 "src/pddl+.yacc" + { (yyval.t_expression)= new uminus_expression((yyvsp[(3) - (4)].t_expression)); requires(E_NFLUENTS); ;} + break; + + case 166: + +/* Line 1464 of yacc.c */ +#line 896 "src/pddl+.yacc" + { (yyval.t_expression)= new plus_expression((yyvsp[(3) - (5)].t_expression),(yyvsp[(4) - (5)].t_expression)); requires(E_NFLUENTS); ;} + break; + + case 167: + +/* Line 1464 of yacc.c */ +#line 898 "src/pddl+.yacc" + { (yyval.t_expression)= new minus_expression((yyvsp[(3) - (5)].t_expression),(yyvsp[(4) - (5)].t_expression)); requires(E_NFLUENTS); ;} + break; + + case 168: + +/* Line 1464 of yacc.c */ +#line 900 "src/pddl+.yacc" + { (yyval.t_expression)= new mul_expression((yyvsp[(3) - (5)].t_expression),(yyvsp[(4) - (5)].t_expression)); requires(E_NFLUENTS); ;} + break; + + case 169: + +/* Line 1464 of yacc.c */ +#line 902 "src/pddl+.yacc" + { (yyval.t_expression)= new div_expression((yyvsp[(3) - (5)].t_expression),(yyvsp[(4) - (5)].t_expression)); requires(E_NFLUENTS); ;} + break; + + case 170: + +/* Line 1464 of yacc.c */ +#line 903 "src/pddl+.yacc" + { (yyval.t_expression)=(yyvsp[(1) - (1)].t_num_expression); ;} + break; + + case 171: + +/* Line 1464 of yacc.c */ +#line 904 "src/pddl+.yacc" + { (yyval.t_expression)= (yyvsp[(1) - (1)].t_func_term); requires(E_NFLUENTS); ;} + break; + + case 172: + +/* Line 1464 of yacc.c */ +#line 909 "src/pddl+.yacc" + { (yyval.t_expression)= new mul_expression(new special_val_expr(E_HASHT),(yyvsp[(4) - (5)].t_expression)); ;} + break; + + case 173: + +/* Line 1464 of yacc.c */ +#line 911 "src/pddl+.yacc" + { (yyval.t_expression)= new mul_expression((yyvsp[(3) - (5)].t_expression), new special_val_expr(E_HASHT)); ;} + break; + + case 174: + +/* Line 1464 of yacc.c */ +#line 913 "src/pddl+.yacc" + { (yyval.t_expression)= new special_val_expr(E_HASHT); ;} + break; + + case 175: + +/* Line 1464 of yacc.c */ +#line 918 "src/pddl+.yacc" + { (yyval.t_num_expression)=new int_expression((yyvsp[(1) - (1)].ival)); ;} + break; + + case 176: + +/* Line 1464 of yacc.c */ +#line 919 "src/pddl+.yacc" + { (yyval.t_num_expression)=new float_expression((yyvsp[(1) - (1)].fval)); ;} + break; + + case 177: + +/* Line 1464 of yacc.c */ +#line 923 "src/pddl+.yacc" + { (yyval.t_func_term)=new func_term( current_analysis->func_tab.symbol_get((yyvsp[(2) - (4)].cp)), (yyvsp[(3) - (4)].t_parameter_symbol_list)); delete [] (yyvsp[(2) - (4)].cp); ;} + break; + + case 178: + +/* Line 1464 of yacc.c */ +#line 926 "src/pddl+.yacc" + { (yyval.t_func_term)=new func_term( current_analysis->func_tab.symbol_get((yyvsp[(2) - (4)].cp)), (yyvsp[(3) - (4)].t_parameter_symbol_list)); delete [] (yyvsp[(2) - (4)].cp); ;} + break; + + case 179: + +/* Line 1464 of yacc.c */ +#line 928 "src/pddl+.yacc" + { (yyval.t_func_term)=new func_term( current_analysis->func_tab.symbol_get((yyvsp[(1) - (1)].cp)), + new parameter_symbol_list); delete [] (yyvsp[(1) - (1)].cp);;} + break; + + case 180: + +/* Line 1464 of yacc.c */ +#line 931 "src/pddl+.yacc" + { (yyval.t_func_term) = new class_func_term( (yyvsp[(2) - (6)].t_class), current_analysis->func_tab.symbol_get((yyvsp[(4) - (6)].cp)), (yyvsp[(5) - (6)].t_parameter_symbol_list)); delete [] (yyvsp[(4) - (6)].cp);;} + break; + + case 181: + +/* Line 1464 of yacc.c */ +#line 948 "src/pddl+.yacc" + { (yyval.t_func_term)=new func_term( current_analysis->func_tab.symbol_get((yyvsp[(2) - (4)].cp)), (yyvsp[(3) - (4)].t_parameter_symbol_list)); delete [] (yyvsp[(2) - (4)].cp); ;} + break; + + case 182: + +/* Line 1464 of yacc.c */ +#line 950 "src/pddl+.yacc" + { (yyval.t_func_term)=new func_term( current_analysis->func_tab.symbol_get((yyvsp[(2) - (4)].cp)), (yyvsp[(3) - (4)].t_parameter_symbol_list)); delete [] (yyvsp[(2) - (4)].cp); ;} + break; + + case 183: + +/* Line 1464 of yacc.c */ +#line 952 "src/pddl+.yacc" + { (yyval.t_func_term)=new func_term( current_analysis->func_tab.symbol_get((yyvsp[(1) - (1)].cp)), + new parameter_symbol_list); delete [] (yyvsp[(1) - (1)].cp);;} + break; + + case 184: + +/* Line 1464 of yacc.c */ +#line 957 "src/pddl+.yacc" + { (yyval.t_comparison_op)= E_GREATER; ;} + break; + + case 185: + +/* Line 1464 of yacc.c */ +#line 958 "src/pddl+.yacc" + { (yyval.t_comparison_op)= E_GREATEQ; ;} + break; + + case 186: + +/* Line 1464 of yacc.c */ +#line 959 "src/pddl+.yacc" + { (yyval.t_comparison_op)= E_LESS; ;} + break; + + case 187: + +/* Line 1464 of yacc.c */ +#line 960 "src/pddl+.yacc" + { (yyval.t_comparison_op)= E_LESSEQ; ;} + break; + + case 188: + +/* Line 1464 of yacc.c */ +#line 961 "src/pddl+.yacc" + { (yyval.t_comparison_op)= E_EQUALS; ;} + break; + + case 189: + +/* Line 1464 of yacc.c */ +#line 974 "src/pddl+.yacc" + {(yyval.t_goal)= (yyvsp[(1) - (1)].t_goal);;} + break; + + case 190: + +/* Line 1464 of yacc.c */ +#line 981 "src/pddl+.yacc" + {(yyval.t_goal) = new conj_goal((yyvsp[(3) - (4)].t_goal_list));;} + break; + + case 191: + +/* Line 1464 of yacc.c */ +#line 984 "src/pddl+.yacc" + {(yyval.t_goal)= new qfied_goal(E_FORALL,(yyvsp[(4) - (7)].t_var_symbol_list),(yyvsp[(6) - (7)].t_goal),current_analysis->var_tab_stack.pop()); + requires(E_UNIV_PRECS);;} + break; + + case 192: + +/* Line 1464 of yacc.c */ +#line 986 "src/pddl+.yacc" + {(yyval.t_goal) = new conj_goal(new goal_list);;} + break; + + case 193: + +/* Line 1464 of yacc.c */ +#line 987 "src/pddl+.yacc" + {(yyval.t_goal) = new conj_goal(new goal_list);;} + break; + + case 194: + +/* Line 1464 of yacc.c */ +#line 992 "src/pddl+.yacc" + {(yyval.t_con_goal) = new preference((yyvsp[(3) - (4)].t_con_goal));requires(E_PREFERENCES);;} + break; + + case 195: + +/* Line 1464 of yacc.c */ +#line 994 "src/pddl+.yacc" + {(yyval.t_con_goal) = new preference((yyvsp[(3) - (5)].cp),(yyvsp[(4) - (5)].t_con_goal));requires(E_PREFERENCES);;} + break; + + case 196: + +/* Line 1464 of yacc.c */ +#line 996 "src/pddl+.yacc" + {(yyval.t_con_goal) = new conj_goal((yyvsp[(3) - (4)].t_goal_list));;} + break; + + case 197: + +/* Line 1464 of yacc.c */ +#line 999 "src/pddl+.yacc" + {(yyval.t_con_goal)= new qfied_goal(E_FORALL,(yyvsp[(4) - (7)].t_var_symbol_list),(yyvsp[(6) - (7)].t_con_goal),current_analysis->var_tab_stack.pop()); + requires(E_UNIV_PRECS);;} + break; + + case 198: + +/* Line 1464 of yacc.c */ +#line 1002 "src/pddl+.yacc" + {(yyval.t_con_goal) = (yyvsp[(1) - (1)].t_con_goal);;} + break; + + case 199: + +/* Line 1464 of yacc.c */ +#line 1007 "src/pddl+.yacc" + {(yyval.t_con_goal) = new preference((yyvsp[(3) - (4)].t_con_goal));requires(E_PREFERENCES);;} + break; + + case 200: + +/* Line 1464 of yacc.c */ +#line 1009 "src/pddl+.yacc" + {(yyval.t_con_goal) = new preference((yyvsp[(3) - (5)].cp),(yyvsp[(4) - (5)].t_con_goal));requires(E_PREFERENCES);;} + break; + + case 201: + +/* Line 1464 of yacc.c */ +#line 1011 "src/pddl+.yacc" + {(yyval.t_con_goal) = new conj_goal((yyvsp[(3) - (4)].t_goal_list));;} + break; + + case 202: + +/* Line 1464 of yacc.c */ +#line 1014 "src/pddl+.yacc" + {(yyval.t_con_goal)= new qfied_goal(E_FORALL,(yyvsp[(4) - (7)].t_var_symbol_list),(yyvsp[(6) - (7)].t_con_goal),current_analysis->var_tab_stack.pop()); + requires(E_UNIV_PRECS);;} + break; + + case 203: + +/* Line 1464 of yacc.c */ +#line 1020 "src/pddl+.yacc" + {(yyval.t_goal_list)=(yyvsp[(1) - (2)].t_goal_list); (yyvsp[(1) - (2)].t_goal_list)->push_back((yyvsp[(2) - (2)].t_con_goal));;} + break; + + case 204: + +/* Line 1464 of yacc.c */ +#line 1022 "src/pddl+.yacc" + {(yyval.t_goal_list)= new goal_list; (yyval.t_goal_list)->push_back((yyvsp[(1) - (1)].t_con_goal));;} + break; + + case 205: + +/* Line 1464 of yacc.c */ +#line 1027 "src/pddl+.yacc" + {(yyval.t_goal)= new preference((yyvsp[(3) - (4)].t_goal)); requires(E_PREFERENCES);;} + break; + + case 206: + +/* Line 1464 of yacc.c */ +#line 1029 "src/pddl+.yacc" + {(yyval.t_goal)= new preference((yyvsp[(3) - (5)].cp),(yyvsp[(4) - (5)].t_goal)); requires(E_PREFERENCES);;} + break; + + case 207: + +/* Line 1464 of yacc.c */ +#line 1033 "src/pddl+.yacc" + {(yyval.t_goal)=(yyvsp[(1) - (1)].t_goal);;} + break; + + case 208: + +/* Line 1464 of yacc.c */ +#line 1038 "src/pddl+.yacc" + {(yyval.t_goal_list) = (yyvsp[(1) - (2)].t_goal_list); (yyval.t_goal_list)->push_back((yyvsp[(2) - (2)].t_con_goal));;} + break; + + case 209: + +/* Line 1464 of yacc.c */ +#line 1040 "src/pddl+.yacc" + {(yyval.t_goal_list) = new goal_list; (yyval.t_goal_list)->push_back((yyvsp[(1) - (1)].t_con_goal));;} + break; + + case 210: + +/* Line 1464 of yacc.c */ +#line 1045 "src/pddl+.yacc" + {(yyval.t_con_goal)= new conj_goal((yyvsp[(3) - (4)].t_goal_list));;} + break; + + case 211: + +/* Line 1464 of yacc.c */ +#line 1047 "src/pddl+.yacc" + {(yyval.t_con_goal) = new qfied_goal(E_FORALL,(yyvsp[(4) - (7)].t_var_symbol_list),(yyvsp[(6) - (7)].t_con_goal),current_analysis->var_tab_stack.pop()); + requires(E_UNIV_PRECS);;} + break; + + case 212: + +/* Line 1464 of yacc.c */ +#line 1050 "src/pddl+.yacc" + {(yyval.t_con_goal) = new constraint_goal(E_ATEND,(yyvsp[(3) - (4)].t_goal));;} + break; + + case 213: + +/* Line 1464 of yacc.c */ +#line 1052 "src/pddl+.yacc" + {(yyval.t_con_goal) = new constraint_goal(E_ALWAYS,(yyvsp[(3) - (4)].t_goal));;} + break; + + case 214: + +/* Line 1464 of yacc.c */ +#line 1054 "src/pddl+.yacc" + {(yyval.t_con_goal) = new constraint_goal(E_SOMETIME,(yyvsp[(3) - (4)].t_goal));;} + break; + + case 215: + +/* Line 1464 of yacc.c */ +#line 1056 "src/pddl+.yacc" + {(yyval.t_con_goal) = new constraint_goal(E_WITHIN,(yyvsp[(4) - (5)].t_goal),NULL,(yyvsp[(3) - (5)].t_num_expression)->double_value(),0.0);delete (yyvsp[(3) - (5)].t_num_expression);;} + break; + + case 216: + +/* Line 1464 of yacc.c */ +#line 1058 "src/pddl+.yacc" + {(yyval.t_con_goal) = new constraint_goal(E_ATMOSTONCE,(yyvsp[(3) - (4)].t_goal));;} + break; + + case 217: + +/* Line 1464 of yacc.c */ +#line 1060 "src/pddl+.yacc" + {(yyval.t_con_goal) = new constraint_goal(E_SOMETIMEAFTER,(yyvsp[(4) - (5)].t_goal),(yyvsp[(3) - (5)].t_goal));;} + break; + + case 218: + +/* Line 1464 of yacc.c */ +#line 1062 "src/pddl+.yacc" + {(yyval.t_con_goal) = new constraint_goal(E_SOMETIMEBEFORE,(yyvsp[(4) - (5)].t_goal),(yyvsp[(3) - (5)].t_goal));;} + break; + + case 219: + +/* Line 1464 of yacc.c */ +#line 1064 "src/pddl+.yacc" + {(yyval.t_con_goal) = new constraint_goal(E_ALWAYSWITHIN,(yyvsp[(5) - (6)].t_goal),(yyvsp[(4) - (6)].t_goal),(yyvsp[(3) - (6)].t_num_expression)->double_value(),0.0);delete (yyvsp[(3) - (6)].t_num_expression);;} + break; + + case 220: + +/* Line 1464 of yacc.c */ +#line 1066 "src/pddl+.yacc" + {(yyval.t_con_goal) = new constraint_goal(E_HOLDDURING,(yyvsp[(5) - (6)].t_goal),NULL,(yyvsp[(4) - (6)].t_num_expression)->double_value(),(yyvsp[(3) - (6)].t_num_expression)->double_value());delete (yyvsp[(3) - (6)].t_num_expression);delete (yyvsp[(4) - (6)].t_num_expression);;} + break; + + case 221: + +/* Line 1464 of yacc.c */ +#line 1068 "src/pddl+.yacc" + {(yyval.t_con_goal) = new constraint_goal(E_HOLDAFTER,(yyvsp[(4) - (5)].t_goal),NULL,0.0,(yyvsp[(3) - (5)].t_num_expression)->double_value());delete (yyvsp[(3) - (5)].t_num_expression);;} + break; + + case 222: + +/* Line 1464 of yacc.c */ +#line 1073 "src/pddl+.yacc" + {(yyval.t_goal)= new simple_goal((yyvsp[(1) - (1)].t_proposition),E_POS);;} + break; + + case 223: + +/* Line 1464 of yacc.c */ +#line 1075 "src/pddl+.yacc" + {(yyval.t_goal)= new neg_goal((yyvsp[(3) - (4)].t_goal));simple_goal * s = dynamic_cast((yyvsp[(3) - (4)].t_goal)); + if(s && s->getProp()->head->getName()=="=") {requires(E_EQUALITY);} + else{requires(E_NEGATIVE_PRECONDITIONS);};;} + break; + + case 224: + +/* Line 1464 of yacc.c */ +#line 1079 "src/pddl+.yacc" + {(yyval.t_goal)= new conj_goal((yyvsp[(3) - (4)].t_goal_list));;} + break; + + case 225: + +/* Line 1464 of yacc.c */ +#line 1081 "src/pddl+.yacc" + {(yyval.t_goal)= new disj_goal((yyvsp[(3) - (4)].t_goal_list)); + requires(E_DISJUNCTIVE_PRECONDS);;} + break; + + case 226: + +/* Line 1464 of yacc.c */ +#line 1084 "src/pddl+.yacc" + {(yyval.t_goal)= new imply_goal((yyvsp[(3) - (5)].t_goal),(yyvsp[(4) - (5)].t_goal)); + requires(E_DISJUNCTIVE_PRECONDS);;} + break; + + case 227: + +/* Line 1464 of yacc.c */ +#line 1088 "src/pddl+.yacc" + {(yyval.t_goal)= new qfied_goal((yyvsp[(2) - (7)].t_quantifier),(yyvsp[(4) - (7)].t_var_symbol_list),(yyvsp[(6) - (7)].t_goal),current_analysis->var_tab_stack.pop());;} + break; + + case 228: + +/* Line 1464 of yacc.c */ +#line 1091 "src/pddl+.yacc" + {(yyval.t_goal)= new qfied_goal((yyvsp[(2) - (7)].t_quantifier),(yyvsp[(4) - (7)].t_var_symbol_list),(yyvsp[(6) - (7)].t_goal),current_analysis->var_tab_stack.pop());;} + break; + + case 229: + +/* Line 1464 of yacc.c */ +#line 1093 "src/pddl+.yacc" + {(yyval.t_goal)= new comparison((yyvsp[(2) - (5)].t_comparison_op),(yyvsp[(3) - (5)].t_expression),(yyvsp[(4) - (5)].t_expression)); + requires(E_NFLUENTS);;} + break; + + case 230: + +/* Line 1464 of yacc.c */ +#line 1099 "src/pddl+.yacc" + {(yyval.t_goal_list)=(yyvsp[(1) - (2)].t_goal_list); (yyvsp[(1) - (2)].t_goal_list)->push_back((yyvsp[(2) - (2)].t_goal));;} + break; + + case 231: + +/* Line 1464 of yacc.c */ +#line 1101 "src/pddl+.yacc" + {(yyval.t_goal_list)= new goal_list; (yyval.t_goal_list)->push_back((yyvsp[(1) - (1)].t_goal));;} + break; + + case 232: + +/* Line 1464 of yacc.c */ +#line 1106 "src/pddl+.yacc" + {(yyval.t_goal_list)=(yyvsp[(1) - (2)].t_goal_list); (yyvsp[(1) - (2)].t_goal_list)->push_back((yyvsp[(2) - (2)].t_goal));;} + break; + + case 233: + +/* Line 1464 of yacc.c */ +#line 1108 "src/pddl+.yacc" + {(yyval.t_goal_list)= new goal_list; (yyval.t_goal_list)->push_back((yyvsp[(1) - (1)].t_goal));;} + break; + + case 234: + +/* Line 1464 of yacc.c */ +#line 1118 "src/pddl+.yacc" + {(yyval.t_quantifier)=E_FORALL; + current_analysis->var_tab_stack.push( + current_analysis->buildForallTab());;} + break; + + case 235: + +/* Line 1464 of yacc.c */ +#line 1125 "src/pddl+.yacc" + {(yyval.t_quantifier)=E_EXISTS; + current_analysis->var_tab_stack.push( + current_analysis->buildExistsTab());;} + break; + + case 236: + +/* Line 1464 of yacc.c */ +#line 1132 "src/pddl+.yacc" + {(yyval.t_proposition)=new proposition((yyvsp[(2) - (4)].t_pred_symbol),(yyvsp[(3) - (4)].t_parameter_symbol_list));;} + break; + + case 237: + +/* Line 1464 of yacc.c */ +#line 1137 "src/pddl+.yacc" + {(yyval.t_proposition) = new proposition((yyvsp[(2) - (4)].t_pred_symbol),(yyvsp[(3) - (4)].t_var_symbol_list));;} + break; + + case 238: + +/* Line 1464 of yacc.c */ +#line 1142 "src/pddl+.yacc" + {(yyval.t_proposition)=new proposition((yyvsp[(2) - (4)].t_pred_symbol),(yyvsp[(3) - (4)].t_parameter_symbol_list));;} + break; + + case 239: + +/* Line 1464 of yacc.c */ +#line 1147 "src/pddl+.yacc" + {(yyval.t_pred_decl_list)= (yyvsp[(3) - (4)].t_pred_decl_list);;} + break; + + case 240: + +/* Line 1464 of yacc.c */ +#line 1149 "src/pddl+.yacc" + {yyerrok; (yyval.t_pred_decl_list)=NULL; + log_error(E_FATAL,"Syntax error in (:predicates ...)"); + ;} + break; + + case 241: + +/* Line 1464 of yacc.c */ +#line 1156 "src/pddl+.yacc" + {(yyval.t_func_decl_list)= (yyvsp[(3) - (4)].t_func_decl_list);;} + break; + + case 242: + +/* Line 1464 of yacc.c */ +#line 1158 "src/pddl+.yacc" + {yyerrok; (yyval.t_func_decl_list)=NULL; + log_error(E_FATAL,"Syntax error in (:functions ...)"); + ;} + break; + + case 243: + +/* Line 1464 of yacc.c */ +#line 1165 "src/pddl+.yacc" + {(yyval.t_con_goal) = (yyvsp[(3) - (4)].t_con_goal);;} + break; + + case 244: + +/* Line 1464 of yacc.c */ +#line 1167 "src/pddl+.yacc" + {yyerrok; (yyval.t_con_goal)=NULL; + log_error(E_FATAL,"Syntax error in (:constraints ...)"); + ;} + break; + + case 245: + +/* Line 1464 of yacc.c */ +#line 1174 "src/pddl+.yacc" + {(yyval.t_con_goal) = (yyvsp[(3) - (4)].t_con_goal);;} + break; + + case 246: + +/* Line 1464 of yacc.c */ +#line 1176 "src/pddl+.yacc" + {yyerrok; (yyval.t_con_goal)=NULL; + log_error(E_FATAL,"Syntax error in (:constraints ...)"); + ;} + break; + + case 247: + +/* Line 1464 of yacc.c */ +#line 1182 "src/pddl+.yacc" + { (yyval.t_structure_store)=(yyvsp[(1) - (2)].t_structure_store); (yyval.t_structure_store)->push_back((yyvsp[(2) - (2)].t_structure_def)); ;} + break; + + case 248: + +/* Line 1464 of yacc.c */ +#line 1183 "src/pddl+.yacc" + { (yyval.t_structure_store)= new structure_store; (yyval.t_structure_store)->push_back((yyvsp[(1) - (1)].t_structure_def)); ;} + break; + + case 249: + +/* Line 1464 of yacc.c */ +#line 1187 "src/pddl+.yacc" + { (yyval.t_structure_def)= (yyvsp[(1) - (1)].t_action_def); ;} + break; + + case 250: + +/* Line 1464 of yacc.c */ +#line 1188 "src/pddl+.yacc" + { (yyval.t_structure_def)= (yyvsp[(1) - (1)].t_event_def); requires(E_TIME); ;} + break; + + case 251: + +/* Line 1464 of yacc.c */ +#line 1189 "src/pddl+.yacc" + { (yyval.t_structure_def)= (yyvsp[(1) - (1)].t_process_def); requires(E_TIME); ;} + break; + + case 252: + +/* Line 1464 of yacc.c */ +#line 1190 "src/pddl+.yacc" + { (yyval.t_structure_def)= (yyvsp[(1) - (1)].t_durative_action_def); requires(E_DURATIVE_ACTIONS); ;} + break; + + case 253: + +/* Line 1464 of yacc.c */ +#line 1191 "src/pddl+.yacc" + { (yyval.t_structure_def)= (yyvsp[(1) - (1)].t_derivation_rule); requires(E_DERIVED_PREDICATES);;} + break; + + case 254: + +/* Line 1464 of yacc.c */ +#line 1192 "src/pddl+.yacc" + { (yyval.t_structure_def) = (yyvsp[(1) - (1)].t_class_def); requires(E_MODULES);;} + break; + + case 255: + +/* Line 1464 of yacc.c */ +#line 1200 "src/pddl+.yacc" + {(yyval.t_class_def) = new class_def((yyvsp[(3) - (5)].t_class),(yyvsp[(4) - (5)].t_func_decl_list));;} + break; + + case 256: + +/* Line 1464 of yacc.c */ +#line 1204 "src/pddl+.yacc" + {(yyval.t_dummy)= 0; + current_analysis->var_tab_stack.push( + current_analysis->buildRuleTab());;} + break; + + case 257: + +/* Line 1464 of yacc.c */ +#line 1215 "src/pddl+.yacc" + {(yyval.t_derivation_rule) = new derivation_rule((yyvsp[(3) - (5)].t_proposition),(yyvsp[(4) - (5)].t_goal),current_analysis->var_tab_stack.pop());;} + break; + + case 258: + +/* Line 1464 of yacc.c */ +#line 1227 "src/pddl+.yacc" + { (yyval.t_action_def)= current_analysis->buildAction(current_analysis->op_tab.new_symbol_put((yyvsp[(3) - (12)].cp)), + (yyvsp[(6) - (12)].t_var_symbol_list),(yyvsp[(9) - (12)].t_goal),(yyvsp[(11) - (12)].t_effect_lists), + current_analysis->var_tab_stack.pop()); delete [] (yyvsp[(3) - (12)].cp); ;} + break; + + case 259: + +/* Line 1464 of yacc.c */ +#line 1231 "src/pddl+.yacc" + {yyerrok; + log_error(E_FATAL,"Syntax error in action declaration."); + (yyval.t_action_def)= NULL; ;} + break; + + case 260: + +/* Line 1464 of yacc.c */ +#line 1244 "src/pddl+.yacc" + {(yyval.t_event_def)= current_analysis->buildEvent(current_analysis->op_tab.new_symbol_put((yyvsp[(3) - (12)].cp)), + (yyvsp[(6) - (12)].t_var_symbol_list),(yyvsp[(9) - (12)].t_goal),(yyvsp[(11) - (12)].t_effect_lists), + current_analysis->var_tab_stack.pop()); delete [] (yyvsp[(3) - (12)].cp);;} + break; + + case 261: + +/* Line 1464 of yacc.c */ +#line 1249 "src/pddl+.yacc" + {yyerrok; + log_error(E_FATAL,"Syntax error in event declaration."); + (yyval.t_event_def)= NULL; ;} + break; + + case 262: + +/* Line 1464 of yacc.c */ +#line 1261 "src/pddl+.yacc" + {(yyval.t_process_def)= current_analysis->buildProcess(current_analysis->op_tab.new_symbol_put((yyvsp[(3) - (12)].cp)), + (yyvsp[(6) - (12)].t_var_symbol_list),(yyvsp[(9) - (12)].t_goal),(yyvsp[(11) - (12)].t_effect_lists), + current_analysis->var_tab_stack.pop()); delete [] (yyvsp[(3) - (12)].cp);;} + break; + + case 263: + +/* Line 1464 of yacc.c */ +#line 1265 "src/pddl+.yacc" + {yyerrok; + log_error(E_FATAL,"Syntax error in process declaration."); + (yyval.t_process_def)= NULL; ;} + break; + + case 264: + +/* Line 1464 of yacc.c */ +#line 1277 "src/pddl+.yacc" + { (yyval.t_durative_action_def)= (yyvsp[(10) - (11)].t_durative_action_def); + (yyval.t_durative_action_def)->name= current_analysis->op_tab.new_symbol_put((yyvsp[(3) - (11)].cp)); + (yyval.t_durative_action_def)->symtab= current_analysis->var_tab_stack.pop(); + (yyval.t_durative_action_def)->parameters= (yyvsp[(6) - (11)].t_var_symbol_list); + (yyval.t_durative_action_def)->dur_constraint= (yyvsp[(9) - (11)].t_goal); + delete [] (yyvsp[(3) - (11)].cp); + ;} + break; + + case 265: + +/* Line 1464 of yacc.c */ +#line 1286 "src/pddl+.yacc" + {yyerrok; + log_error(E_FATAL,"Syntax error in durative-action declaration."); + (yyval.t_durative_action_def)= NULL; ;} + break; + + case 266: + +/* Line 1464 of yacc.c */ +#line 1293 "src/pddl+.yacc" + {(yyval.t_durative_action_def)=(yyvsp[(1) - (3)].t_durative_action_def); (yyval.t_durative_action_def)->effects=(yyvsp[(3) - (3)].t_effect_lists);;} + break; + + case 267: + +/* Line 1464 of yacc.c */ +#line 1295 "src/pddl+.yacc" + {(yyval.t_durative_action_def)=(yyvsp[(1) - (3)].t_durative_action_def); (yyval.t_durative_action_def)->precondition=(yyvsp[(3) - (3)].t_goal);;} + break; + + case 268: + +/* Line 1464 of yacc.c */ +#line 1296 "src/pddl+.yacc" + {(yyval.t_durative_action_def)= current_analysis->buildDurativeAction();;} + break; + + case 269: + +/* Line 1464 of yacc.c */ +#line 1301 "src/pddl+.yacc" + { (yyval.t_goal)=(yyvsp[(1) - (1)].t_goal); ;} + break; + + case 270: + +/* Line 1464 of yacc.c */ +#line 1303 "src/pddl+.yacc" + { (yyval.t_goal)= new conj_goal((yyvsp[(3) - (4)].t_goal_list)); ;} + break; + + case 271: + +/* Line 1464 of yacc.c */ +#line 1308 "src/pddl+.yacc" + { (yyval.t_goal_list)=(yyvsp[(1) - (2)].t_goal_list); (yyval.t_goal_list)->push_back((yyvsp[(2) - (2)].t_goal)); ;} + break; + + case 272: + +/* Line 1464 of yacc.c */ +#line 1310 "src/pddl+.yacc" + { (yyval.t_goal_list)= new goal_list; ;} + break; + + case 273: + +/* Line 1464 of yacc.c */ +#line 1315 "src/pddl+.yacc" + {(yyval.t_goal)= new timed_goal((yyvsp[(3) - (4)].t_goal),E_AT_START);;} + break; + + case 274: + +/* Line 1464 of yacc.c */ +#line 1317 "src/pddl+.yacc" + {(yyval.t_goal)= new timed_goal((yyvsp[(3) - (4)].t_goal),E_AT_END);;} + break; + + case 275: + +/* Line 1464 of yacc.c */ +#line 1319 "src/pddl+.yacc" + {(yyval.t_goal)= new timed_goal((yyvsp[(3) - (4)].t_goal),E_OVER_ALL);;} + break; + + case 276: + +/* Line 1464 of yacc.c */ +#line 1321 "src/pddl+.yacc" + {timed_goal * tg = dynamic_cast((yyvsp[(4) - (5)].t_goal)); + (yyval.t_goal) = new timed_goal(new preference((yyvsp[(3) - (5)].cp),tg->clearGoal()),tg->getTime()); + delete tg; + requires(E_PREFERENCES);;} + break; + + case 277: + +/* Line 1464 of yacc.c */ +#line 1326 "src/pddl+.yacc" + {(yyval.t_goal) = new preference((yyvsp[(3) - (4)].t_goal));requires(E_PREFERENCES);;} + break; + + case 278: + +/* Line 1464 of yacc.c */ +#line 1330 "src/pddl+.yacc" + {(yyval.t_dummy)= 0; current_analysis->var_tab_stack.push( + current_analysis->buildOpTab());;} + break; + + case 279: + +/* Line 1464 of yacc.c */ +#line 1335 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag)= E_EQUALITY;;} + break; + + case 280: + +/* Line 1464 of yacc.c */ +#line 1336 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag)= E_STRIPS;;} + break; + + case 281: + +/* Line 1464 of yacc.c */ +#line 1338 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag)= E_TYPING;;} + break; + + case 282: + +/* Line 1464 of yacc.c */ +#line 1340 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag)= E_NEGATIVE_PRECONDITIONS;;} + break; + + case 283: + +/* Line 1464 of yacc.c */ +#line 1342 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag)= E_DISJUNCTIVE_PRECONDS;;} + break; + + case 284: + +/* Line 1464 of yacc.c */ +#line 1343 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag)= E_EXT_PRECS;;} + break; + + case 285: + +/* Line 1464 of yacc.c */ +#line 1344 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag)= E_UNIV_PRECS;;} + break; + + case 286: + +/* Line 1464 of yacc.c */ +#line 1345 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag)= E_COND_EFFS;;} + break; + + case 287: + +/* Line 1464 of yacc.c */ +#line 1346 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag)= E_NFLUENTS | E_OFLUENTS;;} + break; + + case 288: + +/* Line 1464 of yacc.c */ +#line 1348 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag)= E_DURATIVE_ACTIONS;;} + break; + + case 289: + +/* Line 1464 of yacc.c */ +#line 1349 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag)= E_TIME | + E_NFLUENTS | + E_DURATIVE_ACTIONS; ;} + break; + + case 290: + +/* Line 1464 of yacc.c */ +#line 1352 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag)=E_ACTIONCOSTS | E_NFLUENTS;;} + break; + + case 291: + +/* Line 1464 of yacc.c */ +#line 1355 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag)=E_OFLUENTS;;} + break; + + case 292: + +/* Line 1464 of yacc.c */ +#line 1356 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag)=E_NFLUENTS;;} + break; + + case 293: + +/* Line 1464 of yacc.c */ +#line 1357 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag)=E_MODULES;;} + break; + + case 294: + +/* Line 1464 of yacc.c */ +#line 1359 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag)= E_STRIPS | + E_TYPING | + E_NEGATIVE_PRECONDITIONS | + E_DISJUNCTIVE_PRECONDS | + E_EQUALITY | + E_EXT_PRECS | + E_UNIV_PRECS | + E_COND_EFFS;;} + break; + + case 295: + +/* Line 1464 of yacc.c */ +#line 1368 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag)= E_EXT_PRECS | + E_UNIV_PRECS;;} + break; + + case 296: + +/* Line 1464 of yacc.c */ +#line 1372 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag)= E_DURATION_INEQUALITIES;;} + break; + + case 297: + +/* Line 1464 of yacc.c */ +#line 1375 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag)= E_CONTINUOUS_EFFECTS;;} + break; + + case 298: + +/* Line 1464 of yacc.c */ +#line 1377 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag) = E_DERIVED_PREDICATES;;} + break; + + case 299: + +/* Line 1464 of yacc.c */ +#line 1379 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag) = E_TIMED_INITIAL_LITERALS;;} + break; + + case 300: + +/* Line 1464 of yacc.c */ +#line 1381 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag) = E_PREFERENCES;;} + break; + + case 301: + +/* Line 1464 of yacc.c */ +#line 1383 "src/pddl+.yacc" + {(yyval.t_pddl_req_flag) = E_CONSTRAINTS;;} + break; + + case 302: + +/* Line 1464 of yacc.c */ +#line 1385 "src/pddl+.yacc" + {log_error(E_WARNING,"Unrecognised requirements declaration "); + (yyval.t_pddl_req_flag)= 0; delete [] (yyvsp[(1) - (1)].cp);;} + break; + + case 303: + +/* Line 1464 of yacc.c */ +#line 1391 "src/pddl+.yacc" + {(yyval.t_const_symbol_list)=(yyvsp[(3) - (4)].t_const_symbol_list);;} + break; + + case 304: + +/* Line 1464 of yacc.c */ +#line 1395 "src/pddl+.yacc" + {(yyval.t_type_list)=(yyvsp[(3) - (4)].t_type_list); requires(E_TYPING);;} + break; + + case 305: + +/* Line 1464 of yacc.c */ +#line 1405 "src/pddl+.yacc" + {(yyval.t_problem)=(yyvsp[(11) - (12)].t_problem); (yyval.t_problem)->name = (yyvsp[(5) - (12)].cp); (yyval.t_problem)->domain_name = (yyvsp[(9) - (12)].cp); + if (types_used && !types_defined) { + yyerrok; log_error(E_FATAL,"Syntax error in problem file - types used, but no :types section in domain file."); + } + + ;} + break; + + case 306: + +/* Line 1464 of yacc.c */ +#line 1412 "src/pddl+.yacc" + {yyerrok; (yyval.t_problem)=NULL; + log_error(E_FATAL,"Syntax error in problem definition."); ;} + break; + + case 307: + +/* Line 1464 of yacc.c */ +#line 1418 "src/pddl+.yacc" + {(yyval.t_problem)=(yyvsp[(2) - (2)].t_problem); (yyval.t_problem)->req= (yyvsp[(1) - (2)].t_pddl_req_flag);;} + break; + + case 308: + +/* Line 1464 of yacc.c */ +#line 1419 "src/pddl+.yacc" + {(yyval.t_problem)=(yyvsp[(2) - (2)].t_problem); (yyval.t_problem)->objects= (yyvsp[(1) - (2)].t_const_symbol_list);;} + break; + + case 309: + +/* Line 1464 of yacc.c */ +#line 1420 "src/pddl+.yacc" + {(yyval.t_problem)=(yyvsp[(2) - (2)].t_problem); (yyval.t_problem)->initial_state= (yyvsp[(1) - (2)].t_effect_lists);;} + break; + + case 310: + +/* Line 1464 of yacc.c */ +#line 1421 "src/pddl+.yacc" + {(yyval.t_problem)=(yyvsp[(2) - (2)].t_problem); (yyval.t_problem)->the_goal= (yyvsp[(1) - (2)].t_goal);;} + break; + + case 311: + +/* Line 1464 of yacc.c */ +#line 1423 "src/pddl+.yacc" + {(yyval.t_problem)=(yyvsp[(2) - (2)].t_problem); (yyval.t_problem)->constraints = (yyvsp[(1) - (2)].t_con_goal);;} + break; + + case 312: + +/* Line 1464 of yacc.c */ +#line 1424 "src/pddl+.yacc" + {(yyval.t_problem)=(yyvsp[(2) - (2)].t_problem); if((yyval.t_problem)->metric == 0) {(yyval.t_problem)->metric= (yyvsp[(1) - (2)].t_metric);} + else {(yyval.t_problem)->metric->add((yyvsp[(1) - (2)].t_metric));};} + break; + + case 313: + +/* Line 1464 of yacc.c */ +#line 1426 "src/pddl+.yacc" + {(yyval.t_problem)=(yyvsp[(2) - (2)].t_problem); (yyval.t_problem)->length= (yyvsp[(1) - (2)].t_length_spec);;} + break; + + case 314: + +/* Line 1464 of yacc.c */ +#line 1427 "src/pddl+.yacc" + {(yyval.t_problem)=new problem;;} + break; + + case 315: + +/* Line 1464 of yacc.c */ +#line 1430 "src/pddl+.yacc" + {(yyval.t_const_symbol_list)=(yyvsp[(3) - (4)].t_const_symbol_list);;} + break; + + case 316: + +/* Line 1464 of yacc.c */ +#line 1433 "src/pddl+.yacc" + {(yyval.t_effect_lists)=(yyvsp[(3) - (4)].t_effect_lists);;} + break; + + case 317: + +/* Line 1464 of yacc.c */ +#line 1436 "src/pddl+.yacc" + {(yyval.vtab) = current_analysis->buildOpTab();;} + break; + + case 318: + +/* Line 1464 of yacc.c */ +#line 1439 "src/pddl+.yacc" + {(yyval.t_goal)=(yyvsp[(3) - (4)].t_goal);delete (yyvsp[(2) - (4)].vtab);;} + break; + + case 319: + +/* Line 1464 of yacc.c */ +#line 1444 "src/pddl+.yacc" + { (yyval.t_metric)= new metric_spec((yyvsp[(3) - (5)].t_optimization),(yyvsp[(4) - (5)].t_expression)); ;} + break; + + case 320: + +/* Line 1464 of yacc.c */ +#line 1446 "src/pddl+.yacc" + {yyerrok; + log_error(E_FATAL,"Syntax error in metric declaration."); + (yyval.t_metric)= NULL; ;} + break; + + case 321: + +/* Line 1464 of yacc.c */ +#line 1453 "src/pddl+.yacc" + {(yyval.t_length_spec)= new length_spec(E_BOTH,(yyvsp[(4) - (7)].ival),(yyvsp[(6) - (7)].ival));;} + break; + + case 322: + +/* Line 1464 of yacc.c */ +#line 1456 "src/pddl+.yacc" + {(yyval.t_length_spec) = new length_spec(E_SERIAL,(yyvsp[(4) - (5)].ival));;} + break; + + case 323: + +/* Line 1464 of yacc.c */ +#line 1460 "src/pddl+.yacc" + {(yyval.t_length_spec) = new length_spec(E_PARALLEL,(yyvsp[(4) - (5)].ival));;} + break; + + case 324: + +/* Line 1464 of yacc.c */ +#line 1466 "src/pddl+.yacc" + {(yyval.t_optimization)= E_MINIMIZE;;} + break; + + case 325: + +/* Line 1464 of yacc.c */ +#line 1467 "src/pddl+.yacc" + {(yyval.t_optimization)= E_MAXIMIZE;;} + break; + + case 326: + +/* Line 1464 of yacc.c */ +#line 1472 "src/pddl+.yacc" + {(yyval.t_expression)= (yyvsp[(2) - (3)].t_expression);;} + break; + + case 327: + +/* Line 1464 of yacc.c */ +#line 1473 "src/pddl+.yacc" + {(yyval.t_expression)= (yyvsp[(1) - (1)].t_func_term);;} + break; + + case 328: + +/* Line 1464 of yacc.c */ +#line 1474 "src/pddl+.yacc" + {(yyval.t_expression)= (yyvsp[(1) - (1)].t_num_expression);;} + break; + + case 329: + +/* Line 1464 of yacc.c */ +#line 1475 "src/pddl+.yacc" + { (yyval.t_expression)= new special_val_expr(E_TOTAL_TIME); ;} + break; + + case 330: + +/* Line 1464 of yacc.c */ +#line 1477 "src/pddl+.yacc" + {(yyval.t_expression) = new violation_term((yyvsp[(3) - (4)].cp));;} + break; + + case 331: + +/* Line 1464 of yacc.c */ +#line 1478 "src/pddl+.yacc" + { (yyval.t_expression)= new special_val_expr(E_TOTAL_TIME); ;} + break; + + case 332: + +/* Line 1464 of yacc.c */ +#line 1482 "src/pddl+.yacc" + { (yyval.t_expression)= new plus_expression((yyvsp[(2) - (3)].t_expression),(yyvsp[(3) - (3)].t_expression)); ;} + break; + + case 333: + +/* Line 1464 of yacc.c */ +#line 1483 "src/pddl+.yacc" + { (yyval.t_expression)= new minus_expression((yyvsp[(2) - (3)].t_expression),(yyvsp[(3) - (3)].t_expression)); ;} + break; + + case 334: + +/* Line 1464 of yacc.c */ +#line 1484 "src/pddl+.yacc" + { (yyval.t_expression)= new mul_expression((yyvsp[(2) - (3)].t_expression),(yyvsp[(3) - (3)].t_expression)); ;} + break; + + case 335: + +/* Line 1464 of yacc.c */ +#line 1485 "src/pddl+.yacc" + { (yyval.t_expression)= new div_expression((yyvsp[(2) - (3)].t_expression),(yyvsp[(3) - (3)].t_expression)); ;} + break; + + case 336: + +/* Line 1464 of yacc.c */ +#line 1489 "src/pddl+.yacc" + {(yyval.t_expression) = (yyvsp[(1) - (1)].t_expression);;} + break; + + case 337: + +/* Line 1464 of yacc.c */ +#line 1491 "src/pddl+.yacc" + {(yyval.t_expression) = new plus_expression((yyvsp[(1) - (2)].t_expression),(yyvsp[(2) - (2)].t_expression));;} + break; + + case 338: + +/* Line 1464 of yacc.c */ +#line 1495 "src/pddl+.yacc" + {(yyval.t_expression) = (yyvsp[(1) - (1)].t_expression);;} + break; + + case 339: + +/* Line 1464 of yacc.c */ +#line 1497 "src/pddl+.yacc" + {(yyval.t_expression) = new mul_expression((yyvsp[(1) - (2)].t_expression),(yyvsp[(2) - (2)].t_expression));;} + break; + + case 340: + +/* Line 1464 of yacc.c */ +#line 1503 "src/pddl+.yacc" + {(yyval.t_plan)= (yyvsp[(2) - (2)].t_plan); + (yyval.t_plan)->push_front((yyvsp[(1) - (2)].t_step)); ;} + break; + + case 341: + +/* Line 1464 of yacc.c */ +#line 1506 "src/pddl+.yacc" + {(yyval.t_plan) = (yyvsp[(3) - (3)].t_plan);(yyval.t_plan)->insertTime((yyvsp[(2) - (3)].fval));;} + break; + + case 342: + +/* Line 1464 of yacc.c */ +#line 1508 "src/pddl+.yacc" + {(yyval.t_plan) = (yyvsp[(3) - (3)].t_plan);(yyval.t_plan)->insertTime((yyvsp[(2) - (3)].ival));;} + break; + + case 343: + +/* Line 1464 of yacc.c */ +#line 1510 "src/pddl+.yacc" + {(yyval.t_plan)= new plan;;} + break; + + case 344: + +/* Line 1464 of yacc.c */ +#line 1515 "src/pddl+.yacc" + {(yyval.t_step)=(yyvsp[(3) - (3)].t_step); + (yyval.t_step)->start_time_given=1; + (yyval.t_step)->start_time=(yyvsp[(1) - (3)].fval);;} + break; + + case 345: + +/* Line 1464 of yacc.c */ +#line 1519 "src/pddl+.yacc" + {(yyval.t_step)=(yyvsp[(1) - (1)].t_step); + (yyval.t_step)->start_time_given=0;;} + break; + + case 346: + +/* Line 1464 of yacc.c */ +#line 1525 "src/pddl+.yacc" + {(yyval.t_step)= (yyvsp[(1) - (4)].t_step); + (yyval.t_step)->duration_given=1; + (yyval.t_step)->duration= (yyvsp[(3) - (4)].fval);;} + break; + + case 347: + +/* Line 1464 of yacc.c */ +#line 1529 "src/pddl+.yacc" + {(yyval.t_step)= (yyvsp[(1) - (1)].t_step); + (yyval.t_step)->duration_given=0;;} + break; + + case 348: + +/* Line 1464 of yacc.c */ +#line 1535 "src/pddl+.yacc" + {(yyval.t_step)= new plan_step( + current_analysis->op_tab.symbol_get((yyvsp[(2) - (4)].cp)), + (yyvsp[(3) - (4)].t_const_symbol_list)); delete [] (yyvsp[(2) - (4)].cp); + ;} + break; + + case 349: + +/* Line 1464 of yacc.c */ +#line 1542 "src/pddl+.yacc" + {(yyval.fval)= (yyvsp[(1) - (1)].fval);;} + break; + + case 350: + +/* Line 1464 of yacc.c */ +#line 1543 "src/pddl+.yacc" + {(yyval.fval)= (float) (yyvsp[(1) - (1)].ival);;} + break; + + + +/* Line 1464 of yacc.c */ +#line 5022 "src/pddl+.cpp" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#if !defined(yyoverflow) || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); +} + + + +/* Line 1684 of yacc.c */ +#line 1546 "src/pddl+.yacc" + + +#include +#include +int line_no= 1; +using std::istream; +#include "lex.yy.cc" + +namespace VAL { +extern yyFlexLexer* yfl; +}; + + +int yyerror(char * s) +{ + return 0; +} + +int yylex() +{ + return yfl->yylex(); +} + diff --git a/src/pddl+.lex b/src/pddl+.lex new file mode 100644 index 0000000..5af4bb9 --- /dev/null +++ b/src/pddl+.lex @@ -0,0 +1,175 @@ +%{ + +#include + +#include + using std::cin; + using std::cout; + using std::cerr; + using std::istream; + using namespace VAL; +extern "C" int yywrap(); + +%} +%option case-insensitive + +char [a-zA-Z_] +digit [0-9] +int -?{digit}* +float -?{digit}+(\.{digit}*)? +string {char}+(-|{char}|{digit})* +whitespace [ \t]+ +nl \n +comment ;.*$ +at_time "at"{whitespace}{float} +flawed {digit}+{char}+ + +%% +"(" {return OPEN_BRAC;} +")" {return CLOSE_BRAC;} +"[" {return OPEN_SQ;} +"]" {return CLOSE_SQ;} +":requirements" {return REQS;} +":equality" {return EQUALITY;} +":strips" {return STRIPS;} +":adl" {return ADL;} +":typing" {return TYPING;} +":disjunctive-preconditions" {return DISJUNCTIVE_PRECONDS;} +":existential-preconditions" {return EXT_PRECS;} +":universal-preconditions" {return UNIV_PRECS;} +":quantified-preconditions" {return QUANT_PRECS;} +":conditional-effects" {return COND_EFFS;} +":fluents" {return FLUENTS;} +":numeric-fluents" {return NUMERICFLUENTS;} +":object-fluents" {return OBJECTFLUENTS;} +":action-costs" {return ACTIONCOSTS;} +":time" {return TIME;} +":preferences" {return PREFERENCES;} +":constraints" {return CONSTRAINTS;} +":constants" {return CONSTANTS;} +":predicates" {return PREDS;} +":functions" {return FUNCTIONS;} +":classes" {return CLASSES;} +":class" {return CLASS;} +":types" {return TYPES;} +":durative-actions" {return DURATIVE_ACTIONS;} +":duration-inequalities" {return DURATION_INEQUALITIES;} +":continuous-effects" {return CONTINUOUS_EFFECTS;} +":negative-preconditions" {return NEGATIVE_PRECONDITIONS;} +":derived-predicates" {return DERIVED_PREDICATES;} +":timed-initial-literals" {return TIMED_INITIAL_LITERALS;} +"define" {return DEFINE;} +"domain" {return PDDLDOMAIN;} +":action" {return ACTION;} +":process" {return PROCESS;} +":event" {return EVENT;} +":durative-action" {return DURATIVE_ACTION;} +":derived" {return DERIVED;} +":parameters" {return ARGS;} +":precondition" {return PRE;} +":condition" {return CONDITION;} +":start-precondition" {return START_PRE;} +":end-precondition" {return END_PRE;} +"at start" {return AT_START;} +"at end" {return AT_END;} +"over all" {return OVER_ALL;} +":effect" {return EFFECTS;} +":initial-effect" {return INITIAL_EFFECT;} +":final-effect" {return FINAL_EFFECT;} +":invariant" {return INVARIANT;} +":duration" {return DURATION;} +"and" {return AND;} +"or" {return OR;} +"exists" {return EXISTS;} +"forall" {return FORALL;} +"imply" {return IMPLY;} +"not" {return NOT;} +"when" {return WHEN;} +"either" {return EITHER;} +"problem" {return PROBLEM;} +":domain" {return FORDOMAIN;} +":objects" {return OBJECTS;} +":init" {return INITIALLY;} +":goal" {return GOALS;} +"=" {return EQ;} +":length" {return LENGTH;} +":serial" {return SERIAL;} +":parallel" {return PARALLEL;} +":metric" {return METRIC;} +"minimize" {return MINIMIZE;} +"maximize" {return MAXIMIZE;} +"is-violated" {return ISVIOLATED;} +"#t" {return HASHT;} +"duration" {return DURATION_VAR;} +"total-time" {return TOTAL_TIME;} +^"time" {return TIME;} +"number" {return NUMBER;} +"increase" {return INCREASE;} +"decrease" {return DECREASE;} +"scale-up" {return SCALE_UP;} +"scale-down" {return SCALE_DOWN;} +"assign" {return ASSIGN;} +"preference" {return PREFERENCE;} +"always" {return ALWAYS;} +"sometime" {return SOMETIME;} +"within" {return WITHIN;} +"at-most-once" {return ATMOSTONCE;} +"sometime-after" {return SOMETIMEAFTER;} +"sometime-before" {return SOMETIMEBEFORE;} +"always-within" {return ALWAYSWITHIN;} +"hold-during" {return HOLDDURING;} +"hold-after" {return HOLDAFTER;} +"+" {return PLUS;} +"-" {return HYPHEN;} +"*" {return MUL;} +"/" {return DIV;} +">" {return GREATER;} +">=" {return GREATEQ;} +"<" {return LESS;} +"<=" {return LESSEQ;} +"?" {return Q;} +":" {return COLON;} +"." {return DOT;} +":modules" {return MODULES;} + +{at_time} {unsigned int i; + for(i = 3;i < strlen(yytext);++i) + { + if(yytext[i] != '\t' && yytext[i] != ' ') break; + }; + yylval.fval = atof(yytext+i); + return (AT_TIME); + } + + +{string} {unsigned int i; + yylval.cp = new char[strlen(yytext)+1]; + strcpy(yylval.cp,yytext); + for(i = 0;ifunc_tab.symbol_probe(yylval.cp) != NULL) + return FUNCTION_SYMBOL; + else + return NAME;} + +{whitespace} ; +{comment} ; +{nl} {line_no++;}; + +{int} {yylval.ival = atoi(yytext);return (INTVAL);} +{float} {yylval.fval = atof(yytext);return (FLOATVAL);} +{flawed} {printf("Illegal symbol: %s\n",yytext); exit(0); return 0;} + +%% + + +extern "C++" { + int yyFlexLexer::yywrap() +{ + return 1; +}; +}; + diff --git a/validate b/validate new file mode 100644 index 0000000..086c5ba Binary files /dev/null and b/validate differ